Travis CI Artifacts Uploader
A smart little Go app to help aid in uploading build artifacts.
Installation
There are pre-built binaries of the latest stable build for 64-bit
Linux, OSX, and Windows available here via the following links. Please
note that the tests run on 64-bit Linux.
There is also an install script for Linux and OSX that may
be used like so:
curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/master/install | bash
Usage
Once the binary is in your $PATH
and has been made executable, you
will have access to the help system via artifacts help
(also available
here).
S3 ENVIRONMENT COMPATIBILITY
In addition to the environmental variables listed above for defining the
access key, secret, and bucket, some additional variables will also work.
environmental variables accepted for "key"
ARTIFACTS_KEY
ARTIFACTS_AWS_ACCESS_KEY
AWS_ACCESS_KEY_ID
AWS_ACCESS_KEY
environmental variables accepted for "secret"
ARTIFACTS_SECRET
ARTIFACTS_AWS_SECRET_KEY
AWS_SECRET_ACCESS_KEY
AWS_SECRET_KEY
environmental variables accepted for "bucket"
ARTIFACTS_BUCKET
ARTIFACTS_S3_BUCKET
EXAMPLES
Example: logs and coverage
In this case, the key and secret are passed as command line flags and
the log/
and coverage/
directories are passed as positional path
arguments:
artifacts upload \
--key AKIT339AFIY655O3Q9DZ \
--secret 48TmqyraUyJ7Efpegi6Lfd10yUskAMB0G2TtRCX1 \
--bucket my-fancy-bucket \
log/ coverage/
The same operation using environmental variables would look like this:
export ARTIFACTS_KEY="AKIT339AFIY655O3Q9DZ"
export ARTIFACTS_SECRET="48TmqyraUyJ7Efpegi6Lfd10yUskAMB0G2TtRCX1"
export ARTIFACTS_BUCKET="my-fancy-bucket"
export ARTIFACTS_PATHS="log/:coverage/"
artifacts upload
Example: untracked files
In order to upload all of the untracked files (according to git), one
might do this:
artifacts upload \
--key AKIT339AFIY655O3Q9DZ \
--secret 48TmqyraUyJ7Efpegi6Lfd10yUskAMB0G2TtRCX1 \
--bucket my-fancy-bucket \
$(git ls-files -o)
The same operation using environmental variables would look like this:
export ARTIFACTS_KEY="AKIT339AFIY655O3Q9DZ"
export ARTIFACTS_SECRET="48TmqyraUyJ7Efpegi6Lfd10yUskAMB0G2TtRCX1"
export ARTIFACTS_BUCKET="my-fancy-bucket"
export ARTIFACTS_PATHS="$(git ls-files -o | tr "\n" ":")"
artifacts upload
Example: multiple target paths
Specifying one or more custom target path will override the default of
artifacts/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER
. Multiple target paths
must be specified in ':'-delimited strings:
artifacts upload \
--key AKIT339AFIY655O3Q9DZ \
--secret 48TmqyraUyJ7Efpegi6Lfd10yUskAMB0G2TtRCX1 \
--bucket my-fancy-bucket \
--target-paths "artifacts/$TRAVIS_REPO_SLUG/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER:artifacts/$TRAVIS_REPO_SLUG/$TRAVIS_COMMIT" \
$(git ls-files -o)
The same operation using environmental variables would look like this:
export ARTIFACTS_TARGET_PATHS="artifacts/$TRAVIS_REPO_SLUG/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER:artifacts/$TRAVIS_REPO_SLUG/$TRAVIS_COMMIT"
export ARTIFACTS_KEY="AKIT339AFIY655O3Q9DZ"
export ARTIFACTS_SECRET="48TmqyraUyJ7Efpegi6Lfd10yUskAMB0G2TtRCX1"
export ARTIFACTS_BUCKET="my-fancy-bucket"
export ARTIFACTS_PATHS="$(git ls-files -o | tr "\n" ":")"
artifacts upload