From 053ef5719a526d02ff2dfc6da89ab70bde7c64d6 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 8 Nov 2024 15:29:26 -0500 Subject: [PATCH] removing 18fgsa references and removing unused testing pipeline --- CONTRIBUTING.md | 9 ++++---- README.md | 56 ++++++++++++++++++++++++++++------------------- test/build.sh | 2 +- test/check | 2 +- test/in | 2 +- test/out | 2 +- test/pipeline.yml | 27 ----------------------- 7 files changed, 41 insertions(+), 59 deletions(-) delete mode 100644 test/pipeline.yml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2864871..320089d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ We want to ensure a welcoming environment for all of our projects. Our staff fol We encourage you to read this project's CONTRIBUTING policy (you are here), its [LICENSE](LICENSE.md), and its [README](README.md). -If you have any questions or want to read more, check out the [18F Open Source Policy GitHub repository]( https://github.com/18f/open-source-policy), or just [shoot us an email](mailto:18f@gsa.gov). +If you have any questions or want to read more, check out the [18F Open Source Policy GitHub repository](https://github.com/18f/open-source-policy), or just [shoot us an email](mailto:18f@gsa.gov). ## Development @@ -14,15 +14,14 @@ Requires [Docker](https://www.docker.com/). 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 `bucket`. + +- 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 `bucket`. 1. Run `./test/out `. 1. Run `./test/in `. 1. Run `./test/check`. -Every tag and branch created on this repository is automatically built on [Docker Hub](https://hub.docker.com/r/18fgsa/s3-resource-simple/). - ## Public domain This project is in the public domain within the United States, and diff --git a/README.md b/README.md index 9452e9a..8e7c88f 100644 --- a/README.md +++ b/README.md @@ -2,32 +2,40 @@ Resource to upload files to S3. Unlike the [the official S3 Resource](https://github.com/concourse/s3-resource), this Resource can upload or download multiple files. -## Usage +## Usage Include the following in your Pipeline YAML file, replacing the values in the angle brackets (`< >`): ```yaml resource_types: -- name: - type: docker-image - source: - repository: 18fgsa/s3-resource-simple + - name: + type: registry-image + source: + aws_access_key_id: ((ecr_aws_key)) + aws_secret_access_key: ((ecr_aws_secret)) + repository: s3-resource-simple + aws_region: ((aws_region)) + tag: ((tag)) resources: -- name: - type: - source: - access_key_id: {{aws-access-key}} - secret_access_key: {{aws-secret-key}} - bucket: {{aws-bucket}} - path: [, use to sync to a specific path of the bucket instead of root of bucket] - change_dir_to: [] - options: [] - region: + - name: + type: + source: + access_key_id: { { aws-access-key } } + secret_access_key: { { aws-secret-key } } + bucket: { { aws-bucket } } + path: + [ + , + use to sync to a specific path of the bucket instead of root of bucket, + ] + change_dir_to: [] + options: [] + region: jobs: -- name: - plan: - - - - put: + - name: + plan: + - + - put: ``` ## AWS Credentials @@ -44,7 +52,9 @@ test ├── 1.json └── 2.json ``` + and the config: + ``` - name: test type: s3-resource-simple @@ -76,13 +86,13 @@ we can upload _only_ the `results` subdirectory by using the following `options` ```yaml options: -- "--exclude '*'" -- "--include 'results/*'" + - "--exclude '*'" + - "--include 'results/*'" ``` ### Region -Interacting with some AWS regions (like London) requires AWS Signature Version -4. This options allows you to explicitly specify region where your bucket is + +Interacting with some AWS regions (like London) requires AWS Signature Version 4. This options allows you to explicitly specify region where your bucket is located (if this is set, AWS_DEFAULT_REGION env variable will be set accordingly). ```yaml diff --git a/test/build.sh b/test/build.sh index 377ca72..259fb0c 100755 --- a/test/build.sh +++ b/test/build.sh @@ -2,4 +2,4 @@ set -e -docker build -t 18fgsa/s3-resource-simple . +docker build -t s3-resource-simple . diff --git a/test/check b/test/check index 81f8d17..ca5c9a5 100755 --- a/test/check +++ b/test/check @@ -9,5 +9,5 @@ source "$(dirname $0)/build.sh" echo $json | docker run \ -i \ --rm \ - 18fgsa/s3-resource-simple \ + s3-resource-simple \ /opt/resource/check diff --git a/test/in b/test/in index 8425797..4e40fe8 100755 --- a/test/in +++ b/test/in @@ -17,5 +17,5 @@ echo $json | docker run \ -i \ --rm \ -v $dest:/tmp/output \ - 18fgsa/s3-resource-simple \ + s3-resource-simple \ /opt/resource/in /tmp/output diff --git a/test/out b/test/out index ce90e75..6cbbe31 100755 --- a/test/out +++ b/test/out @@ -17,5 +17,5 @@ echo $json | docker run \ -i \ --rm \ -v $source:/tmp/input \ - 18fgsa/s3-resource-simple \ + s3-resource-simple \ /opt/resource/out /tmp/input diff --git a/test/pipeline.yml b/test/pipeline.yml deleted file mode 100644 index faa519a..0000000 --- a/test/pipeline.yml +++ /dev/null @@ -1,27 +0,0 @@ -# Pipeline that clones this repository, then uploads it to S3. Local usage: -# -# fly set-pipeline -t lite -n -c test/pipeline.yml -p s3-resource-simple-test -v access_key_id= -v secret_access_key= -v aws-bucket= -bucket: {{aws-bucket}} -# -resource_types: -- name: s3-upload - type: docker-image - source: - repository: 18fgsa/s3-resource-simple -resources: -- name: scripts - type: git - source: - uri: https://github.com/18F/s3-resource-simple - branch: master -- name: s3-bucket - type: s3-upload - source: - access_key_id: {{aws-access-key}} - secret_access_key: {{aws-secret-key}} - bucket: {{aws-bucket}} -jobs: -- name: custom-resource-example - plan: - - get: scripts - - put: s3-bucket