.gitlab-ci.yml 1.02 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
12
13
14
15
image: docker:latest

build:boinc:
  stage: build
  script:
16
    - docker build -t ${REPOSITORY}/boinc:${VERSION} docker/boinc
17
18
19
20

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

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

push:all:
  stage: push
  script:
38
    - /scripts/distribute_docker_image.sh ${REPOSITORY}/boinc:${VERSION}
39
40
41
42
43
44
45
46
47
48
  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
49
50
51
  artifacts:
    paths:
      - "*.json"
52
53
      - logo.png
      - "README*.md"
Daniele Venzano's avatar
Daniele Venzano committed
54
55
56
  only:
    - master