Rename gitlab ci config
This commit is contained in:
30
.gitlab-ci.yml
Normal file
30
.gitlab-ci.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
# This file is a template, and might need editing before it works on your project.
|
||||
# Official docker image.
|
||||
image: docker:latest
|
||||
|
||||
stages:
|
||||
- build
|
||||
- release
|
||||
|
||||
variables:
|
||||
CONTAINER_TEST_IMAGE: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
|
||||
CONTAINER_RELEASE_IMAGE: "$CI_REGISTRY_IMAGE:latest"
|
||||
|
||||
before_script:
|
||||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
|
||||
|
||||
build:
|
||||
stage: build
|
||||
script:
|
||||
- docker build --pull -t "$CONTAINER_TEST_IMAGE" .
|
||||
- docker push "$CONTAINER_TEST_IMAGE"
|
||||
|
||||
release-image:
|
||||
stage: release
|
||||
script:
|
||||
- docker pull "$CONTAINER_TEST_IMAGE"
|
||||
- docker tag "$CONTAINER_TEST_IMAGE" "$CONTAINER_RELEASE_IMAGE"
|
||||
- docker push "$CONTAINER_RELEASE_IMAGE"
|
||||
only:
|
||||
- master
|
||||
|
||||
Reference in New Issue
Block a user