Skip to content

Commit

Permalink
Fix errors when tag a build (#593)
Browse files Browse the repository at this point in the history
Git for-each-ref returns wrong tag name, use git describe to
get latest tag.
Remove branch and event conditions since branch is empty if
it is a tag event. Execute vic-ui and bundle when status is
success.
  • Loading branch information
DanielXiao authored Sep 5, 2018
1 parent 7dfa7a2 commit 586ed3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ pipeline:
commands:
- 'export BUILD_NUMBER=${DRONE_BUILD_NUMBER}'
- 'make vic-ui-plugins'
when:
status: success

bundle:
image: 'gcr.io/eminent-nation-87317/vic-integration-test:1.36'
Expand All @@ -56,8 +58,7 @@ pipeline:
- 'ls -la bundle'
when:
repo: vmware/vic-ui
event: [push, tag]
branch: [master, develop, 'releases/*']
status: success

publish-gcs-builds-on-pass:
image: 'victest/drone-gcs:1'
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.

REV :=$(shell git rev-parse --short=8 HEAD)
TAG :=$(shell git for-each-ref --format="%(refname:short)" --sort=-authordate --count=1 refs/tags) # e.g. `v0.9.0`
TAG_NUM :=$(shell git for-each-ref --format="%(refname:short)" --sort=-authordate --count=1 refs/tags | cut -c 2-) # e.g. `0.9.0`
TAG :=$(shell git describe --tags --abbrev=0) # e.g. `v0.9.0`
TAG_NUM :=$(shell git describe --tags --abbrev=0 | cut -c 2-) # e.g. `0.9.0`

BIN ?= bin

Expand Down

0 comments on commit 586ed3f

Please sign in to comment.