A smart little Go app to help aid in uploading build artifacts.
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 | bashOnce 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).
In addition to the environment variables listed above for defining the access key, secret, and bucket, some additional variables will also work.
ARTIFACTS_KEYARTIFACTS_AWS_ACCESS_KEYAWS_ACCESS_KEY_IDAWS_ACCESS_KEY
ARTIFACTS_SECRETARTIFACTS_AWS_SECRET_KEYAWS_SECRET_ACCESS_KEYAWS_SECRET_KEY
ARTIFACTS_BUCKETARTIFACTS_S3_BUCKET
ARTIFACTS_REGIONARTIFACTS_S3_REGION
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 environment 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 uploadIn 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 environment 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 uploadSpecifying 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 environment 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