No description
assets | ||
test | ||
.gitignore | ||
config.example.json | ||
CONTRIBUTING.md | ||
Dockerfile | ||
LICENSE.md | ||
README.md |
Simple S3 Resource for Concourse CI
Resource to upload files to S3.
Usage
Include the following in your Pipeline YAML file, replacing the values in the angle brackets (< >
):
resource_types:
- name: <resource type name>
type: docker-image
source:
repository: 18fgsa/s3-resource-simple
resources:
- name: <resource name>
type: <resource type name>
source:
access_key_id: {{aws-access-key}}
secret_access_key: {{aws-secret-key}}
bucket: {{aws-bucket}}
options: [<optional, see note below>]
jobs:
- name: <job name>
plan:
- <some Resource or Task that outputs files>
- put: <resource name>
Options
The options
parameter is synonymous with the options that aws cli
accepts for sync
.
Please see
S3 Sync Options
And pay special attention to the
Use of Exclude and Include Filters
Given the following directory test
we can upload only the results
directory by using the options
JSON below.
test
├── results
│ ├── 1.json
│ └── 2.json
└── scripts
└── bad.sh
options: [
"--exclude: '*'",
"--include: 'results/*'"
]
Development
Requires Docker.
Building, Uploading, and Using the Docker Image
- Download Docker Toolbox.
- Get a Docker Hub account
- Launch the Docker Terminal and
cd
to this directory. docker login -e <email> -p <password> -u <username>
docker build -t <username>/s3-resource-simple .
- verify with
docker images
docker push <username>/s3-resource-simple
- Now you can test your local Concourse pipelines using /s3-resource-simple.
Tests
- Run
cp config.example.json config.json
. - Modify
config.json
.- Recommended S3 setup is via
cloud.gov
'ss3
service and a 1-off app. - Exclude the
s3://
prefix/protocol forbucket
.
- Recommended S3 setup is via
- Run
./test/out </full/path/to/dir>
.