Commit f27672a3 authored by Daniele Venzano's avatar Daniele Venzano

Test different way of pushing the image to the hosts

parent 48ac53d3
Pipeline #4754 failed with stages
in 1 minute and 16 seconds
......@@ -10,16 +10,10 @@ variables:
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
- docker build -t ${REPOSITORY}/boinc:${VERSION} docker/boinc
build:json:
image: python:3-alpine
......@@ -36,12 +30,12 @@ test:json:
before_script:
- pip install requests
script:
- python validate.py ${ZOE_VALIDATION_URL} boinc.json
- python /scripts/validate.py ${ZOE_VALIDATION_URL} boinc.json
push:all:
stage: push
script:
- docker push ${DOCKER_REGISTRY}/${REPOSITORY}/boinc:${VERSION}
- /script/distribute_docker_image.sh ${REPOSITORY}/boinc:${VERSION}
only:
- master
......
#!/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