Build version tags in CI (#1365)

* Build version tags in CI
* Simplify clean_head method

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
This commit is contained in:
Kevin Lingerfelt 2018-07-25 12:32:42 -07:00 committed by GitHub
parent 2971831508
commit 554ffe6a46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -7,13 +7,14 @@ sudo: false
branches:
only:
- master
- /^v\d+\.\d+\.[\w-]+$/ # build version tags
stages:
- name: test
- name: docker-deploy
if: branch = master AND type != pull_request
if: type != pull_request
- name: integration-test
if: branch = master AND type != pull_request
if: type != pull_request
jobs:
include:
@ -144,7 +145,7 @@ jobs:
(. bin/_gcp.sh ; get_k8s_ctx "$GCP_PROJECT" "$GCP_ZONE" "$GKE_CLUSTER")
- |
# Install linkerd cli.
version="git-$(git rev-parse --short=8 HEAD)"
version="$(CI_FORCE_CLEAN=1 bin/root-tag)"
image="gcr.io/linkerd-io/cli-bin:$version"
id=$(docker create $image)
docker cp "$id:/out/linkerd-linux" "./linkerd"

View File

@ -11,7 +11,7 @@ go_deps_sha() {
}
clean_head() {
git diff-index --quiet HEAD --
[ -n "${CI_FORCE_CLEAN:-}" ] || git diff-index --quiet HEAD --
}
named_tag() {