Travis CI Artifacts Uploader
Go Makefile Shell Ruby
Latest commit d62580b Apr 15, 2016 @BanzaiMan BanzaiMan Update mitchellh/goamz to mitchellh/goamz@caaaea8
This commit is current as of 2015-03-17, which includes
support for eu-central-1 (Frankfurt) region.

See also: mitchellh/goamz#129
Permalink
Failed to load latest commit information.
artifact More tests for artifact package + fixing previous borkage Aug 21, 2014
client Addressing some golint gripes Sep 22, 2014
env Removing a bunch of unused stuff from the env package Sep 23, 2014
logging Addressing some golint gripes Sep 22, 2014
path Addressing some golint gripes Sep 22, 2014
upload Accept "ARTIFACTS_REGION" env var for S3 region Jul 29, 2015
.gitignore A few tweaks to the build setup & reported version Aug 20, 2014
.go-version Updating to 1.3.3, using deppy for dependencies Oct 7, 2014
.travis.yml Publish to travis-ci-gmbh, switch to go 1.5.1 Nov 14, 2015
Deps Update mitchellh/goamz to mitchellh/goamz@caaaea8 Apr 15, 2016
LICENSE Initial commit May 9, 2014
Makefile Quote ldflags better for go1.5, drop gox build toolchain step Nov 14, 2015
README.md Point at new S3 location Nov 16, 2015
UPLOAD_USAGE.txt Accept "ARTIFACTS_REGION" env var for S3 region Jul 29, 2015
USAGE.in.md Marking usage with a checksum comment instead of timestamp Jun 5, 2014
USAGE.md Accept "ARTIFACTS_REGION" env var for S3 region Jul 29, 2015
USAGE.txt Publish to travis-ci-gmbh, switch to go 1.5.1 Nov 14, 2015
artifacts.go Add -q/--quiet ARTIFACTS_QUIET option to set log level to panic Nov 25, 2014
artifacts_test.go Also including package main in coverage metrics May 19, 2014
deploy Compare go version correctly for deploy decision Nov 16, 2015
install Point at new S3 location Nov 16, 2015
markdownify-usage Marking usage with a checksum comment instead of timestamp Jun 5, 2014
test-upload Fixing how relative and absolute paths are handled May 18, 2014

README.md

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 environment variables listed above for defining the access key, secret, and bucket, some additional variables will also work.

environment variables accepted for "key"

  1. ARTIFACTS_KEY
  2. ARTIFACTS_AWS_ACCESS_KEY
  3. AWS_ACCESS_KEY_ID
  4. AWS_ACCESS_KEY

environment variables accepted for "secret"

  1. ARTIFACTS_SECRET
  2. ARTIFACTS_AWS_SECRET_KEY
  3. AWS_SECRET_ACCESS_KEY
  4. AWS_SECRET_KEY

environment variables accepted for "bucket"

  1. ARTIFACTS_BUCKET
  2. ARTIFACTS_S3_BUCKET

environment variables accepted for "region"

  1. ARTIFACTS_REGION
  2. ARTIFACTS_S3_REGION

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 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 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 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 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 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