.gitlab-ci.yml 2.32 KB
Newer Older
Daniele Venzano's avatar
Daniele Venzano committed
1
stages:
2
  - test
3
  - build
4
  - push
Daniele Venzano's avatar
Daniele Venzano committed
5
6
7
  - deploy

variables:
Daniele Venzano's avatar
Daniele Venzano committed
8
  VERSION: 7375
9
  REPOSITORY: zapps
Daniele Venzano's avatar
Daniele Venzano committed
10

11
12
13
before_script:
  - mkdir -p $HOME/.docker
  - echo $DOCKER_AUTH_CONFIG > $HOME/.docker/config.json
14

Daniele Venzano's avatar
Daniele Venzano committed
15
16
test:build:
  stage: test
17
  script:
Daniele Venzano's avatar
Daniele Venzano committed
18
    - docker build --build-arg VERSION=${VERSION} -t ${REPOSITORY}/boinc:${VERSION} boinc
19
20
21
22

build:json:
  image: python:3-alpine
  stage: build
Daniele Venzano's avatar
Daniele Venzano committed
23
24
  script:
    - python gen_json.py
25
26
27
28
29
30
31
32
33
34
  artifacts:
    paths:
      - boinc.json

test:json:
  image: python:3-alpine
  stage: test
  before_script:
    - pip install requests
  script:
35
    - python /scripts/validate.py ${ZOE_VALIDATION_URL} boinc.json
36

Daniele Venzano's avatar
Daniele Venzano committed
37
38
.build_template: &build_def
  stage: build
39
  script:
Daniele Venzano's avatar
Daniele Venzano committed
40
    - docker -H ${BUILD_HOST}.containers.bigfoot.eurecom.fr:2375 $DOCKER_TLS_OPTIONS build --build-arg VERSION=${VERSION} -t ${REPOSITORY}/boinc:${VERSION} boinc/
41
42
43
  only:
    - master

44
45
46
47
48
49
50
push:hub:
  stage: push
  script:
    - docker push ${REPOSITORY}/boinc:${VERSION}
  only:
    - master

51
52
53
54
55
56
57
deploy:json:
  stage: deploy
  script:
    - mkdir -p ${ZAPP_SHOP_BASE_PATH}/${CI_PROJECT_NAME}
    - cp *.json ${ZAPP_SHOP_BASE_PATH}/${CI_PROJECT_NAME}/
    - cp logo.png ${ZAPP_SHOP_BASE_PATH}/${CI_PROJECT_NAME}/
    - cp README*.md ${ZAPP_SHOP_BASE_PATH}/${CI_PROJECT_NAME}/
Daniele Venzano's avatar
Daniele Venzano committed
58
59
60
  artifacts:
    paths:
      - "*.json"
61
62
      - logo.png
      - "README*.md"
Daniele Venzano's avatar
Daniele Venzano committed
63
64
65
  only:
    - master

Daniele Venzano's avatar
Daniele Venzano committed
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
build:bf7:
  <<: *build_def
  variables:
    BUILD_HOST: bf7

build:bf8:
  <<: *build_def
  variables:
    BUILD_HOST: bf8

build:bf9:
  <<: *build_def
  variables:
    BUILD_HOST: bf9

build:bf10:
  <<: *build_def
  variables:
    BUILD_HOST: bf10

build:bf12:
  <<: *build_def
  variables:
    BUILD_HOST: bf12

build:bf13:
  <<: *build_def
  variables:
    BUILD_HOST: bf13

build:bf14:
  <<: *build_def
  variables:
    BUILD_HOST: bf14

build:bf15:
  <<: *build_def
  variables:
    BUILD_HOST: bf15

build:bf16:
  <<: *build_def
  variables:
    BUILD_HOST: bf16

build:bf17:
  <<: *build_def
  variables:
    BUILD_HOST: bf17

build:bf18:
  <<: *build_def
  variables:
    BUILD_HOST: bf18

build:bf19:
  <<: *build_def
  variables:
    BUILD_HOST: bf19

build:bf20:
  <<: *build_def
  variables:
    BUILD_HOST: bf20

build:bf21:
  <<: *build_def
  variables:
    BUILD_HOST: bf21

build:bf22:
  <<: *build_def
  variables:
    BUILD_HOST: bf22

build:deepfoot1:
  <<: *build_def
  variables:
    BUILD_HOST: deepfoot1