Skip to content

Commit

Permalink
build image with hash tag, then retag and push
Browse files Browse the repository at this point in the history
  • Loading branch information
jangrewe committed Jun 6, 2019
1 parent 845819b commit 42e0c14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ stages:
build:
stage: build
script:
- docker build -t registry.faked.org/gitlab-ci/android:latest .
- docker build -t registry.faked.org/gitlab-ci/android:${CI_COMMIT_SHORT_SHA} .

push_latest:
stage: push
only:
- master
script:
- docker tag registry.faked.org/gitlab-ci/android:${CI_COMMIT_SHORT_SHA} registry.faked.org/gitlab-ci/android:latest
- docker push registry.faked.org/gitlab-ci/android:latest

push_tag:
stage: push
only:
- tags
script:
- docker tag registry.faked.org/gitlab-ci/android:${CI_COMMIT_SHORT_SHA} registry.faked.org/gitlab-ci/android:${CI_COMMIT_TAG}
- docker push registry.faked.org/gitlab-ci/android:${CI_COMMIT_TAG}

0 comments on commit 42e0c14

Please sign in to comment.