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: branches:
only: only:
- master - master
- /^v\d+\.\d+\.[\w-]+$/ # build version tags
stages: stages:
- name: test - name: test
- name: docker-deploy - name: docker-deploy
if: branch = master AND type != pull_request if: type != pull_request
- name: integration-test - name: integration-test
if: branch = master AND type != pull_request if: type != pull_request
jobs: jobs:
include: include:
@ -144,7 +145,7 @@ jobs:
(. bin/_gcp.sh ; get_k8s_ctx "$GCP_PROJECT" "$GCP_ZONE" "$GKE_CLUSTER") (. bin/_gcp.sh ; get_k8s_ctx "$GCP_PROJECT" "$GCP_ZONE" "$GKE_CLUSTER")
- | - |
# Install linkerd cli. # 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" image="gcr.io/linkerd-io/cli-bin:$version"
id=$(docker create $image) id=$(docker create $image)
docker cp "$id:/out/linkerd-linux" "./linkerd" docker cp "$id:/out/linkerd-linux" "./linkerd"

View File

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