-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
58 lines (50 loc) · 1.23 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
image: docker:latest
# When using dind, use the overlayfs driver.
variables:
DOCKER_DRIVER: overlay
services:
- docker:dind
stages:
- build
- deploy
variables:
REGISTRY_SECURE_IMAGE: $CI_REGISTRY/avluis/iroffer:$CI_COMMIT_REF_NAME
REGISTRY_INTERNAL_IMAGE: $INT_REGISTRY/avluis/iroffer:$CI_COMMIT_REF_NAME
REGISTRY_PUBLIC_IMAGE: $PUB_REGISTRY/avluis/iroffer:$CI_COMMIT_REF_NAME
before_script:
- docker info
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
build:
script:
- echo "Building the app"
- docker build --pull -t $REGISTRY_SECURE_IMAGE .
- docker push $REGISTRY_SECURE_IMAGE
stage: build
tags:
- dind
- ubuntu
deploy_staging:
script:
- echo "Deploy to staging server"
- docker pull $REGISTRY_SECURE_IMAGE
- docker tag $REGISTRY_SECURE_IMAGE $REGISTRY_INTERNAL_IMAGE
- docker push $REGISTRY_INTERNAL_IMAGE
stage: deploy
environment:
name: staging
url: https://avnet.ws:5001/repository/avluis/iroffer
only:
- master
tags:
- dind
- ubuntu
deploy_prod:
stage: deploy
script:
- echo "Deploy to production server"
environment:
name: production
url: https://hub.docker.com/r/avluis/iroffer
when: manual
only:
- master