Commit 6fc55abc authored by DBnomics bot's avatar DBnomics bot
Browse files

Replace .gitlab-ci.yml with content of pipeline configuration

parent 1d0f7b00
Pipeline #280721 failed with stages
in 1 minute and 3 seconds
image: dbnomics/dbnomics-gitlab-ci:latest
variables:
# Can be "download" or "convert"
JOB: convert
PROVIDER_SLUG: drees
job:
stage: build
except:
- pushes
tags:
- docker
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"
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
build:
stage: build
only:
- changes
- master
except:
- schedules
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- >
if [ -f $CI_PROJECT_DIR/Dockerfile ]; then
mkdir -p /kaniko/.docker
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
# /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG --destination $CI_REGISTRY_IMAGE:latest
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:latest
fi
include:
- remote: https://git.nomics.world/dbnomics/dbnomics-fetcher-pipeline/-/raw/pipeline-ng/pipelines/fetcher.yml
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