Commit 1b820977 authored by Daniele Venzano's avatar Daniele Venzano
Browse files

Modify gitlab CI

parent 73197082
Pipeline #4496 failed
stages:
- build
- test
- push
- pull
- deploy
variables:
VERSION: $CI_BUILD_ID
images:
image: docker:latest
stage: deploy
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
- apk update
- apk add python findutils bash
script:
- bash build_all.sh
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:spark2-jupyter-notebook:
stage: build
script:
- docker build -t ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-jupyter-notebook:${VERSION} docker/spark2-jupyter-notebook
build:spark2-master:
stage: build
script:
- docker build -t ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-master:${VERSION} docker/spark2-master
build:spark2-worker:
stage: build
script:
- docker build -t ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-worker:${VERSION} docker/spark2-worker
build:spark2-submit:
stage: build
script:
- docker build -t ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-submit:${VERSION} docker/spark2-submit
build:json:
image: python:3-alpine
stage: build
script:
- python gen_json.py
artifacts:
paths:
- "spark*.json"
test:json:
image: python:3-alpine
stage: test
before_script:
- pip install requests
script:
- python validate.py ${VALIDATION_URL} spark*.json
push:all:
stage: push
script:
- docker push ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-submit:${VERSION}
- docker push ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-master:${VERSION}
- docker push ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-worker:${VERSION}
- docker push ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-jupyter-notebook:${VERSION}
only:
- master
pull:all:
stage: pull
- docker -H ${SWARM} ${SWARM_TLS_OPTIONS} pull ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-submit:${VERSION}
- docker -H ${SWARM} ${SWARM_TLS_OPTIONS} pull ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-master:${VERSION}
- docker -H ${SWARM} ${SWARM_TLS_OPTIONS} pull ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-worker:${VERSION}
- docker -H ${SWARM} ${SWARM_TLS_OPTIONS} pull ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-jupyter-notebook:${VERSION}
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}/
artifacts:
paths:
- "*.json"
- logo.png
- "README*.md"
only:
- master
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