Commit a3744e68 authored by Daniele Venzano's avatar Daniele Venzano

Update gitlab ci

parent 73abbbb3
......@@ -9,15 +9,13 @@ variables:
REPOSITORY: zapps
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:pytorch:
stage: build
script:
- docker build -t ${DOCKER_REGISTRY}/${REPOSITORY}/pytorch:${VERSION} docker/pytorch
- docker build -t ${REPOSITORY}/pytorch:${VERSION} docker/pytorch
build:json:
image: python:3-alpine
......@@ -34,12 +32,17 @@ test:json:
before_script:
- pip install requests
script:
- python validate.py ${ZOE_VALIDATION_URL} *notebook.json
- python /scripts/validate.py ${ZOE_VALIDATION_URL} *notebook.json
push:all:
stage: push
script:
- docker push ${DOCKER_REGISTRY}/${REPOSITORY}/pytorch:${VERSION}
- /scripts/distribute_images_json.sh
push:hub:
stage: push
script:
- docker push ${REPOSITORY}/pytorch:${VERSION}
deploy:json:
stage: deploy
......
#!/usr/bin/python
import json
import sys
import requests
URL = sys.argv[1]
files = sys.argv[2:]
for f in files:
data = json.load(open(f, encoding="utf-8"))
data_req = { "application": data }
r = requests.post(URL, json=data_req)
if r.status_code != 200:
rep = r.json()
print(rep['message'])
sys.exit(1)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment