Newer
Older
docker:
stage: docker
tags:
- dind
variables:
DOCKER_DRIVER: "overlay2"
DOCKER_TLS_CERTDIR: "/certs"
services:
- docker:20.10.17-dind
before_script:
- docker info
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
script:
- docker build -t ${IMAGE_NAME}:latest -f Dockerfile-base .
- docker push ${IMAGE_NAME}:latest
image: docker:20.10.17
allow_failure: true
tags:
- unprivileged
- virtualenv --python=/usr/bin/python3 .
- source bin/activate
- pip3 install -r requirements.txt
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- bin/
- lib/
- pyvenv.cfg
test_ppparis:
stage: test
- curl --silent --location --output artifacts.zip "${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERVER_PORT}/api/v4/projects/${CI_PROJECT_ID}/jobs/artifacts/${CI_COMMIT_BRANCH}/download?job=${CI_JOB_NAME}&job_token=${CI_JOB_TOKEN}" || true
- unzip -q artifacts.zip data/ppparis/* || true
- rm artifacts.zip || true
- python ./ppparis.py
only:
- main
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- bin/
- lib/
- pyvenv.cfg
test_pref13:
stage: test
image: ${IMAGE_NAME}:latest
tags:
- unprivileged
needs: [install]
script:
- curl --silent --location --output artifacts.zip "${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERVER_PORT}/api/v4/projects/${CI_PROJECT_ID}/jobs/artifacts/${CI_COMMIT_BRANCH}/download?job=${CI_JOB_NAME}&job_token=${CI_JOB_TOKEN}" || true
- unzip -q artifacts.zip data/pref13/* || true
- rm artifacts.zip || true
- source bin/activate
- /etc/init.d/tor start
- python ./pref13.py
retry: 2
only:
- main
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- bin/
- lib/
- pyvenv.cfg
artifacts:
paths:
- data/pref13/*.txt
- output.log
expire_in: 12 hours