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

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

Daniele Venzano's avatar
Daniele Venzano committed
11 12 13 14 15 16 17
before_script:
  - mkdir -p $HOME/.docker
  - echo $DOCKER_AUTH_CONFIG > $HOME/.docker/config.json

build:pytorch:
  stage: build
  script:
Daniele Venzano's avatar
Daniele Venzano committed
18
    - docker build -t ${REPOSITORY}/pytorch:${VERSION} docker/pytorch
Daniele Venzano's avatar
Daniele Venzano committed
19

20 21 22 23 24 25 26 27 28
build:json:
  image: python:3-alpine
  stage: build
  script:
    - python gen_json.py
  artifacts:
    paths:
      - "*.json"

29 30 31 32 33 34
test:json:
  image: python:3-alpine
  stage: test
  before_script:
    - pip install requests
  script:
35
    - python /scripts/validate.py ${ZOE_VALIDATION_URL} pytorch-notebook.json
Daniele Venzano's avatar
Daniele Venzano committed
36
    - python /scripts/validate.py ${ZOE_VALIDATION_URL} pytorch-nb-gpu.json
37

Daniele Venzano's avatar
Daniele Venzano committed
38 39 40
push:all:
  stage: push
  script:
Daniele Venzano's avatar
Daniele Venzano committed
41
    - /scripts/distribute_docker_image.sh ${REPOSITORY}/pytorch:${VERSION}
Daniele Venzano's avatar
Daniele Venzano committed
42 43 44 45 46

push:hub:
  stage: push
  script:
    - docker push ${REPOSITORY}/pytorch:${VERSION}
Daniele Venzano's avatar
Daniele Venzano committed
47

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