You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.1 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. # cURL File Resource
  2. Tracks the update of a single URL-addressable file.
  3. This is a useful resource for pipeline development time, while a required artifact is available only from a URL-addressable location and until it is moved to a file management repository such as [git](https://github.com/concourse/git-resource) or [S3](https://github.com/concourse/s3-resource).
  4. ## Source Configuration
  5. * `url`: *Required.* The url location of the file.
  6. * `filename`: *Optional.* The name of the file for the downloaded artifact to be save as. If not provided, the file will be saved using the full url string as its name.
  7. * `username`: *Optional.* Username for accessing an authenticated repository.
  8. * `password`: *Optional.* Password for accessing an authenticated repository.
  9. * `skip_ssl_verification`: *Optional.* Skips ssl verification if defined as `true`. Default is `false`.
  10. ### Example
  11. Resource configuration:
  12. ``` yaml
  13. resource_types:
  14. - name: file-url
  15. type: docker-image
  16. source:
  17. repository: pivotalservices/concourse-curl-resource
  18. tag: latest
  19. resources:
  20. - name: my-file
  21. type: file-url
  22. source:
  23. url: http://www-us.apache.org/dist/lucene/java/5.5.4/lucene-5.5.4-src.tgz
  24. filename: lucene-5.5.4-src.tgz
  25. ```
  26. ## Behavior
  27. ### `check`: Check for the latest version of the file.
  28. The resource uses `curl` under-the-covers to post a GET request and retrieve the HTTP header info for the file URL provided.
  29. If field `Last-Modified` is returned as part of the HTTP response header, then the resource will use that to build a version number timestamp with format "YYYYMMDDHHMMSS".
  30. Otherwise, the timestamp string will be built using the request's current time, which will result in a new version being returned every time `check` is executed for that file.
  31. To verify if a file URL returns the `Last-Modified` information in its HTTP response header, issue the `curl` command below and search for field "Last-Modified" in its output.
  32. ```curl -I <file-url>```
  33. ### `in`: Download the latest version of the file.
  34. Downloads the latest version of the file issuing a `curl` command under-the-covers.
  35. ### `out`: Not supported.