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

variables:
9
  VERSION: $CI_PIPELINE_ID
Daniele Venzano's avatar
Daniele Venzano committed
10

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
image: docker:latest

before_script:
  - mkdir -p /etc/docker/certs.d/$DOCKER_REGISTRY
  - cp /registry-ca.crt /etc/docker/certs.d/$DOCKER_REGISTRY/ca.crt
  - mkdir -p $HOME/.docker
  - echo $DOCKER_AUTH_CONFIG > $HOME/.docker/config.json

build:boinc:
  stage: build
  script:
    - docker build -t ${DOCKER_REGISTRY}/${REPOSITORY}/boinc:${VERSION} docker/boinc

build:json:
  image: python:3-alpine
  stage: build
Daniele Venzano's avatar
Daniele Venzano committed
27
28
  script:
    - python gen_json.py
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
  artifacts:
    paths:
      - boinc.json

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

push:all:
  stage: push
  script:
    - docker push ${DOCKER_REGISTRY}/${REPOSITORY}/boinc:${VERSION}
  only:
    - master

pull:all:
  stage: pull
  script:
    - docker -H ${SWARM} ${SWARM_TLS_OPTIONS} pull ${DOCKER_REGISTRY}/${REPOSITORY}/boinc:${VERSION}
  only:
    - master
 
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
62
63
64
  artifacts:
    paths:
      - "*.json"
65
66
      - logo.png
      - "README*.md"
Daniele Venzano's avatar
Daniele Venzano committed
67
68
69
  only:
    - master