-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
43 lines (37 loc) · 906 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
image: docker:git
services:
- docker:dind
stages:
- build
- push-latest
variables:
DOCKER_IMAGE: registry.jojoc4.ch/hesound:${CI_BUILD_REF_NAME}
DOCKER_LATEST_IMAGE: registry.jojoc4.ch/hesound:latest
#
# Make sure we are logged into the GitLab container registry for each script.
#
before_script:
# - docker login -u jojoc4 -p ${CI_DOCKERHUB_PASSWORD}
#
# Build a docker image using the files in the 'docker/' subdirectory.
#
build:
stage: build
tags:
- ubuntu-docker
script:
- docker build -t ${DOCKER_IMAGE} .
- docker push ${DOCKER_IMAGE}
#
# Tag the master image as 'latest'.
#
push-latest:
stage: push-latest
tags:
- ubuntu-docker
script:
- docker pull ${DOCKER_IMAGE}
- docker tag ${DOCKER_IMAGE} ${DOCKER_LATEST_IMAGE}
- docker push ${DOCKER_LATEST_IMAGE}
only:
- master