blob: 50fd8a4e5f08812a42f98a5d6451416ed6bd24b0 (
plain)
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
59
60
61
62
63
64
|
stages:
- lint
- build
- test
- publish
variables:
http_proxy: "http://devwatt-proxy.si.fr.intraorange:8080"
https_proxy: "http://devwatt-proxy.si.fr.intraorange:8080"
no_proxy: dind, gitlab.forge.orange-labs.fr
DOCKER_DRIVER: overlay
DOCKER_HOST: tcp://dind:2375
CONTAINER_RELEASE_IMAGE: moonplatform/$CI_PROJECT_NAME
CONTAINER_TAG: dev
DOCKER_VERSION: "17.12"
services:
- name: dockerproxy-iva.si.francetelecom.fr/docker:$DOCKER_VERSION-dind
alias: dind
image: dockerproxy-iva.si.francetelecom.fr/docker:$DOCKER_VERSION
lint-job:
image: dockerfactory-iva.si.francetelecom.fr/docker/orange-dockerfile-lint:0.2.7-alpine3.6-2
tags:
- rsc
- docker
- shared
stage: lint
script:
- dockerfile_lint -f Dockerfile
build-job:
stage: build
tags:
- rsc
- docker-privileged
script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- docker build -t $CONTAINER_RELEASE_IMAGE:$CONTAINER_TAG --build-arg http_proxy=$http_proxy --build-arg https_proxy=$http_proxy .
- docker push $CONTAINER_RELEASE_IMAGE:$CONTAINER_TAG
test-job:
stage: test
tags:
- rsc
- docker-privileged
script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- docker run -e http_proxy=$http_proxy -e https_proxy=$http_proxy $CONTAINER_RELEASE_IMAGE:$CONTAINER_TAG curl http://localhost:8000
publish-job:
stage: publish
tags:
- rsc
- docker-privileged
script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- FINAL_TAG=$(grep version setup.cfg | cut -d "=" -f 2)
- echo FINAL_TAG=$FINAL_TAG
- docker pull $CONTAINER_RELEASE_IMAGE:$CONTAINER_TAG
- docker tag $CONTAINER_RELEASE_IMAGE:$CONTAINER_TAG $CONTAINER_RELEASE_IMAGE:$FINAL_TAG
- docker push $CONTAINER_RELEASE_IMAGE:$FINAL_TAG
only:
- master
|