Commit 01c9a2fd authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

1st commit

parent bda82b98
Pipeline #1435 failed with stages
in 2 minutes and 24 seconds
image: git.opendatafrance.net:4567/observatoire/observatoire-scripts:latest
stages:
- build_docker_image
- build
- deploy
build_docker_image:
stage: build_docker_image
image: docker:stable
services:
- docker:18.09-dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
IMAGE_TAG: $CI_REGISTRY_IMAGE:latest
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
only:
changes:
- Dockerfile
tags:
- docker-privileged
build:
stage: build
script:
- ./download_and_prepare_data.sh
- ./process_and_generate.sh
artifacts:
paths:
- dumps/
- build/
# - db/odservatoire.sqlite
#cache:
# paths:
# - db/georef.sqlite
except:
- pushes
tags:
- observatoire
update_observatoire_data_repo:
stage: deploy
before_script:
- date
- locale
# Run ssh-agent (inside the build environment).
- eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store.
- ssh-add <(echo "$SSH_GIT_PRIVATE_KEY")
# Add the SSH keys of remote Git servers, to disable host key checking questions.
- mkdir -p ~/.ssh
- ssh-keyscan -t rsa git.opendatafrance.net >> ~/.ssh/known_hosts
- git config --global push.default simple
- git config --global user.email "cronbot@git.opendatafrance.net"
- git config --global user.name "observatoire update bot"
script:
- time git clone --quiet --depth=1 git@git.opendatafrance.net:observatoire/observatoire-data.git
- cd observatoire-data
- rm -fR sources
- mkdir sources
- cp -a ../dumps/* sources
- rm *.csv
- cp build/observatoire/*.csv .
- time git add .
- time git commit -m "Mise à jour quotidienne" --quiet || true
- time git push
environment:
name: production
url: https://git.opendatafrance.net/observatoire/observatoire-data/tree/master/sources
except:
- pushes
tags:
- observatoire
# update-superset-db:
# stage: deploy
# before_script:
# # Run ssh-agent (inside the build environment).
# - eval $(ssh-agent -s)
# # Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store.
# - ssh-add <(echo "$SSH_LAB_PRIVATE_KEY")
# # Add the SSH keys of remote Git servers, to disable host key checking questions.
# - mkdir -p ~/.ssh
# - ssh-keyscan -t rsa lab.observatoire-opendata.fr >> ~/.ssh/known_hosts
# script:
# - scp db/odservatoire.sqlite observatoire@lab.observatoire-opendata.fr:superset-dashboard/superset
# environment:
# name: production
# url: https://lab.observatoire-opendata.fr/
# except:
# - pushes
# tags:
# - observatoire
Supports Markdown
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