-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
38 lines (36 loc) · 1.08 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
stages:
- build
- deploy
build:
image: docker:19.03
services:
- docker:19.03-dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
stage: build
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
tags:
- image-builder
script:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG || true
- docker build --cache-from $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
- docker pull $CI_REGISTRY_IMAGE/minio:$CI_COMMIT_REF_SLUG || true
- docker build --cache-from $CI_REGISTRY_IMAGE/minio:$CI_COMMIT_REF_SLUG --tag $CI_REGISTRY_IMAGE/minio:$CI_COMMIT_REF_SLUG ./containers/minio/
- docker push $CI_REGISTRY_IMAGE/minio:$CI_COMMIT_REF_SLUG
develop:
stage: deploy
only:
- /^release_.*$/
environment:
name: staging
tags:
- sapsanshop
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
dependencies:
- build
script:
- docker-compose pull
- docker-compose up -d