Skip to content

Commit

Permalink
handle circleci tags
Browse files Browse the repository at this point in the history
  • Loading branch information
karzak committed Oct 15, 2019
1 parent 9c85201 commit 0ccc1a6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@ commands:
name: "Restore source code cache"
keys:
- go-src-v1-{{ .Revision }}
- checkout
- run:
name: Checkout with tags
command: |
git fetch --force origin "refs/tags/${CIRCLE_TAG}:refs/tags/${CIRCLE_TAG}"
if [ -n "$CIRCLE_BRANCH" ]
if [ -n "$CIRCLE_TAG" ]
then
git reset --hard $CIRCLE_SHA1
git checkout -q -B $CIRCLE_BRANCH
git fetch --force origin "refs/tags/${CIRCLE_TAG}:refs/tags/${CIRCLE_TAG}"
fi
git reset --hard $CIRCLE_SHA1
- checkout
- restore_cache:
name: "Restore go modules cache"
keys:
Expand Down

0 comments on commit 0ccc1a6

Please sign in to comment.