Add a GitLab CI configuration
This commit is contained in:
30
.gitlab-ci.yml
Normal file
30
.gitlab-ci.yml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
image: docker:latest
|
||||||
|
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- build
|
||||||
|
|
||||||
|
staging:
|
||||||
|
stage: build
|
||||||
|
before_script:
|
||||||
|
- echo $CI_JOB_TOKEN | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
|
||||||
|
script:
|
||||||
|
- docker build -t $CI_REGISTRY_IMAGE:staging .
|
||||||
|
- docker push $CI_REGISTRY_IMAGE:staging
|
||||||
|
only:
|
||||||
|
- staging
|
||||||
|
|
||||||
|
production:
|
||||||
|
stage: build
|
||||||
|
before_script:
|
||||||
|
- echo $CI_JOB_TOKEN | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
|
||||||
|
script:
|
||||||
|
- docker build -t $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG .
|
||||||
|
- docker push $CI_REGISTRY_IMAGE:latest
|
||||||
|
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
except:
|
||||||
|
- branches
|
||||||
Reference in New Issue
Block a user