Skip to content

Drone plugin to upload file/directories to AWS S3 Bucket and display the bucket url under 'Executions > Artifacts' tab.

License

Notifications You must be signed in to change notification settings

krishi0408/drone-s3-upload-publish

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drone-s3-upload-publish

Drone plugin to upload file/directories to AWS S3 Bucket and display the bucket url under 'Executions > Artifacts' tab.

Build

Build the binary with the following commands:

go build

Docker

Build the Docker image with the following commands:

./hacking/build.sh
docker buildx build -t DOCKER_ORG/drone-s3-upload-publish --platform linux/amd64 .

Please note incorrectly building the image for the correct x64 linux and with CGO disabled will result in an error when running the Docker image:

docker: Error response from daemon: Container command
'/bin/drone-s3-upload-publish' not found or does not exist..

Usage

docker run --rm \
  -e PLUGIN_AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
  -e PLUGIN_AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
  -e PLUGIN_AWS_DEFAULT_REGION=ap-southeast-2 \
  -e PLUGIN_AWS_BUCKET=bucket-name \
  -e PLUGIN_SOURCE=OBJECT_PATH \
  -e PLUGIN_ARTIFACT_FILE=url.txt \
  -v $(pwd):$(pwd) \
  -w $(pwd) \
  harnesscommunity/drone-s3-upload-publish

In Harness CI,

              - step:
                  type: Plugin
                  name: s3-upload-publish
                  identifier: custom_plugin
                  spec:
                    connectorRef: account.harnessImage
                    image: harnesscommunity/drone-s3-upload-publish
                    settings:
                      aws_access_key_id: <+pipeline.variables.AWS_ACCESS>
                      aws_secret_access_key: <+pipeline.variables.AWS_SECRET>
                      aws_default_region: ap-southeast-2
                      aws_bucket: bucket-name
                      artifact_file: url.txt
                      source: OBJECT_PATH
                    imagePullPolicy: IfNotPresent

To get the list of supported arguments:

go build

./drone-s3-upload-publish --help
NAME:
   drone-s3-upload-publish
...
...
GLOBAL OPTIONS:
   --aws-access-key value      AWS Access Key ID [$PLUGIN_AWS_ACCESS_KEY_ID]
   --aws-secret-key value      AWS Secret Access Key [$PLUGIN_AWS_SECRET_ACCESS_KEY]
   --aws-default-region value  AWS Default Region [$PLUGIN_AWS_DEFAULT_REGION]
   --aws-bucket value          AWS S3 Bucket [$PLUGIN_AWS_BUCKET]
   --source value              Source [$PLUGIN_SOURCE]
   --target-path value         target [$PLUGIN_TARGET]
   --artifact-file value       Artifact file [$PLUGIN_ARTIFACT_FILE]
...
...

About

Drone plugin to upload file/directories to AWS S3 Bucket and display the bucket url under 'Executions > Artifacts' tab.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 92.0%
  • Dockerfile 4.2%
  • Shell 3.8%