Update docs for Docker install, Development use, and Tests
This commit is contained in:
parent
d63b360859
commit
7010edacb5
3 changed files with 21 additions and 7 deletions
22
README.md
22
README.md
|
@ -1,6 +1,6 @@
|
|||
# Simple S3 Resource for [Concourse CI](http://concourse.ci)
|
||||
|
||||
Resource to upload files to S3. Unlike the [the official S3 Resource](https://github.com/concourse/s3-resource), this Resource doesn't care about files being versioned.
|
||||
Resource to upload files to S3.
|
||||
|
||||
## Usage
|
||||
|
||||
|
@ -26,14 +26,24 @@ jobs:
|
|||
- put: <resource name>
|
||||
```
|
||||
|
||||
See [the instructions for getting your AWS credentials](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html#cli-signup), then pass them and the bucket name in as [parameters](http://concourse.ci/fly-set-pipeline.html#section_parameters).
|
||||
|
||||
## Development
|
||||
|
||||
Requires [Docker](https://www.docker.com/).
|
||||
|
||||
### Building, Uploading, and Using the Docker Image
|
||||
1. Download [Docker Toolbox](https://www.docker.com/products/docker-toolbox).
|
||||
1. Get a [Docker Hub](https://www.dockerhub.com) account
|
||||
1. Launch the Docker Terminal and `cd` to this directory.
|
||||
1. `docker login -e <email> -p <password> -u <username>`
|
||||
1. `docker build -t <username>/s3-resource-simple .`
|
||||
1. verify with `docker images`
|
||||
1. `docker push <username>/s3-resource-simple`
|
||||
1. Now you can test your local Concourse pipelines using <username>/s3-resource-simple.
|
||||
|
||||
|
||||
### Tests
|
||||
1. Run `cp config.example.json config.json`.
|
||||
1. Modify `config.json`.
|
||||
* See [the instructions for getting your AWS credentials](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html#cli-signup).
|
||||
* Exclude the `s3://` prefix/protocol for the `bucket`.
|
||||
1. Run `./test/out </full/path/to/dir/or/file>`.
|
||||
* Recommended S3 setup is via `cloud.gov`'s `s3` service and a 1-off app.
|
||||
* Exclude the `s3://` prefix/protocol for `bucket`.
|
||||
1. Run `./test/out </full/path/to/dir>`.
|
||||
|
|
|
@ -28,6 +28,10 @@ echo "Uploading to S3..."
|
|||
export AWS_ACCESS_KEY_ID=$(echo "$payload" | jq -r '.source.access_key_id')
|
||||
export AWS_SECRET_ACCESS_KEY=$(echo "$payload" | jq -r '.source.secret_access_key')
|
||||
|
||||
# TODO: Get options from the config.
|
||||
# http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html#options
|
||||
# http://docs.aws.amazon.com/cli/latest/reference/s3/index.html#use-of-exclude-and-include-filters
|
||||
|
||||
aws s3 sync $source "s3://$bucket"
|
||||
|
||||
echo "...done."
|
||||
|
|
2
test/out
2
test/out
|
@ -5,7 +5,7 @@ set -e
|
|||
source=$1
|
||||
|
||||
if [ -z "$source" ]; then
|
||||
echo "usage: $0 </full/path/to/dir/or/file>"
|
||||
echo "usage: $0 </full/path/to/dir>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue