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

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

11
image: docker:latest
12
13
14
15

before_script:
  - mkdir -p $HOME/.docker
  - echo $DOCKER_AUTH_CONFIG > $HOME/.docker/config.json
16
17
18
19

build:boinc:
  stage: build
  script:
20
    - docker build -t ${REPOSITORY}/boinc:${VERSION} docker/boinc
21
22
23
24

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

test:json:
  image: python:3-alpine
  stage: test
  before_script:
    - pip install requests
  script:
37
    - python /scripts/validate.py ${ZOE_VALIDATION_URL} boinc.json
38
39
40
41

push:all:
  stage: push
  script:
42
    - /scripts/distribute_docker_image.sh ${REPOSITORY}/boinc:${VERSION}
43
44
45
  only:
    - master

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

53
54
55
56
57
58
59
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
60
61
62
  artifacts:
    paths:
      - "*.json"
63
64
      - logo.png
      - "README*.md"
Daniele Venzano's avatar
Daniele Venzano committed
65
66
67
  only:
    - master