mirror of
https://gitlab.com/jessieh/simple-shortener.git
synced 2024-11-09 14:41:45 +00:00
Add GitLab CI integration
This commit is contained in:
parent
6d762385e3
commit
0554b43bd3
32
.gitlab-ci.yml
Normal file
32
.gitlab-ci.yml
Normal file
@ -0,0 +1,32 @@
|
||||
image: docker:20
|
||||
|
||||
stages:
|
||||
- build
|
||||
- tag
|
||||
|
||||
before_script:
|
||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||
|
||||
build:
|
||||
stage: build
|
||||
only:
|
||||
- main
|
||||
services:
|
||||
- docker:dind
|
||||
script:
|
||||
- docker build --quiet --tag=${CI_REGISTRY_IMAGE}:latest
|
||||
- docker push ${CI_REGISTRY_IMAGE}:latest
|
||||
|
||||
tag:
|
||||
stage: tag
|
||||
only:
|
||||
- tags
|
||||
variables:
|
||||
# Don't clone the project source-- we're just tagging a docker image:
|
||||
GIT_STRATEGY: none
|
||||
services:
|
||||
- docker:dind
|
||||
script:
|
||||
- docker pull ${CI_REGISTRY_IMAGE}:latest
|
||||
- docker tag ${CI_REGISTRY_IMAGE}:latest ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}
|
||||
- docker push ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}
|
Loading…
Reference in New Issue
Block a user