Commit d6ec68bd authored by Bruno Duyé's avatar Bruno Duyé

Add .gitlab-ci.yml

parent e0e8135e
Pipeline #3333 failed with stage
in 16 seconds
image: dbnomics/dbnomics-gitlab-ci:latest
variables:
# Can be "download" or "convert"
JOB: convert
PROVIDER_SLUG: bea
before_script:
# Display info about environment.
- date
- locale
- echo "Running job ${JOB} for provider ${PROVIDER_SLUG}"
# Install fetcher dependencies.
- '[ -f requirements.txt ] && pip3 install --requirement requirements.txt'
# 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_PRIVATE_KEY")
# Add the SSH keys of remote Git servers, to disable host key checking questions.
- mkdir -p ~/.ssh
- ssh-keyscan -t rsa git.nomics.world >> ~/.ssh/known_hosts
- git config --global push.default simple
- git config --global user.email "${PROVIDER_SLUG}-fetcher@db.nomics.world"
- git config --global user.name "${PROVIDER_SLUG} fetcher"
job:
stage: build
only:
- triggers
tags:
- docker
script:
- set -x
- |
if [ "${JOB}" == "download" ]; then
time git clone --quiet --depth=1 git@git.nomics.world:dbnomics-source-data/${PROVIDER_SLUG}-source-data.git
cd ${PROVIDER_SLUG}-source-data
time find -not -path "./.git/*" -not -name ".git" -delete
cd ..
time python3 download.py ${PROVIDER_SLUG}-source-data
cd ${PROVIDER_SLUG}-source-data
time git add -A
time git commit -m "New download" --quiet || true
time git push
fi
- |
if [ "${JOB}" == "convert" ]; then
time git clone --quiet --depth=1 https://git.nomics.world/dbnomics-source-data/${PROVIDER_SLUG}-source-data.git
time git clone --quiet --depth=1 git@git.nomics.world:dbnomics-json-data/${PROVIDER_SLUG}-json-data.git
cd ${PROVIDER_SLUG}-json-data
time find -not -path "./.git/*" -not -name ".git" -delete
cd ..
time python3 convert.py ${PROVIDER_SLUG}-source-data ${PROVIDER_SLUG}-json-data
cd ${PROVIDER_SLUG}-json-data
time git add -A
time git commit -m "New conversion" --quiet || true
time git push
fi
\ No newline at end of file
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