diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..388be497 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: go +go: +- 1.11.4 +services: +- docker +script: +- make _output/bin/kubectl-trace +after_success: +- ./hack/release-image.sh diff --git a/Makefile b/Makefile index 025550e8..24280e36 100644 --- a/Makefile +++ b/Makefile @@ -46,3 +46,4 @@ image/push: image/latest: $(DOCKER) tag $(IMAGE_BPFTRACE_COMMIT) $(IMAGE_BPFTRACE_LATEST) $(DOCKER) push $(IMAGE_BPFTRACE_LATEST) + diff --git a/hack/release-image.sh b/hack/release-image.sh new file mode 100755 index 00000000..1e3ec132 --- /dev/null +++ b/hack/release-image.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -xeo pipefail + +# Script that builds the bpftrace image and releases +# it to quay only if the request is coming from the main repo. + +make=$(command -v make) +docker=$(command -v docker) + +$make image/build + +if [[ ! -z "$QUAY_TOKEN" ]]; then + $docker login -u="fntlnz+travisci" -p="$QUAY_TOKEN" quay.io + $make image/push + + if [[ "TRAVIS_BRANCH" == "master" ]]; then + $make image/latest + fi +fi +