Skip to content

Commit

Permalink
feat(ci): release docker image for PRs and master
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Fontana <[email protected]>
  • Loading branch information
fntlnz committed Dec 29, 2018
1 parent 09b7ec7 commit 8d739eb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: go
go:
- 1.11.4
services:
- docker
script:
- make _output/bin/kubectl-trace
after_success:
- ./hack/release-image.sh
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ image/push:
image/latest:
$(DOCKER) tag $(IMAGE_BPFTRACE_COMMIT) $(IMAGE_BPFTRACE_LATEST)
$(DOCKER) push $(IMAGE_BPFTRACE_LATEST)

20 changes: 20 additions & 0 deletions hack/release-image.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8d739eb

Please sign in to comment.