forked from memeLab/Jandig
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
45 lines (39 loc) · 990 Bytes
/
.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
stages:
- build
.build:
image: docker
stage: build
services:
- docker:dind
script:
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASS
- docker build . -f docker/Dockerfile -t jandigarte/django:$DOCKER_TAG --cache-from jandigarte/django:$DOCKER_TAG
- docker push jandigarte/django:$DOCKER_TAG
tags:
- docker
build develop:
extends: .build
environment: develop
only:
- develop
build staging:
extends: .build
environment: staging
only:
- master
except:
- tags
build tag:
extends: .build
environment: production
script:
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASS
- "docker build . -f docker/Dockerfile
-t jandigarte/django:$CI_COMMIT_TAG
-t jandigarte/django:$DOCKER_TAG
-t jandigarte/django:latest"
- docker push jandigarte/django:$CI_COMMIT_TAG
- docker push jandigarte/django:$DOCKER_TAG
- docker push jandigarte/django:latest
only:
- tags