variables:
|
|
DEBIAN_FRONTEND: noninteractive
|
|
# The name of the image would be user/repo:commit-sha
|
|
# Not using $CI_COMMIT_REF_SLUG because that adds the name of the branch
|
|
# and when pushing from a branch and pulling from other the name wouldn't
|
|
# match
|
|
IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
|
# To have a common name that can be referenced from other job
|
|
RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
|
|
# XXX: Change to "official" gnunet image if/when there's one
|
|
GNUNET_IMAGE: registry.gitlab.com/juga0/gnunet
|
|
|
|
# The following are jobs to create the dockerimage from docker with the
|
|
# gitlab runner.
|
|
build_docker:
|
|
stage: build
|
|
image: docker:stable
|
|
services:
|
|
- docker:stable-dind
|
|
before_script:
|
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
script:
|
|
- echo building $IMAGE and releasing as $RELEASE_IMAGE
|
|
- docker info
|
|
- docker build --pull -t $IMAGE .
|
|
- docker push $IMAGE
|
|
# tag it as latest and push it too
|
|
- docker tag $IMAGE $RELEASE_IMAGE
|
|
- docker push $RELEASE_IMAGE
|
|
only:
|
|
changes:
|
|
- "mixnet"
|
|
- "tests"
|
|
- "Dockerfile"
|
|
|
|
test_remailer:
|
|
stage: test
|
|
image: $RELEASE_IMAGE
|
|
before_script:
|
|
- apt update -yqq
|
|
- apt install -yqq tox make
|
|
script:
|
|
- tox
|
|
|
|
|
|
test_mixnet:
|
|
image: docker
|
|
services:
|
|
- docker:dind
|
|
before_script:
|
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
script:
|
|
- apk add --no-cache py-pip gcc libffi-dev openssl-dev libc-dev make python3-dev
|
|
- pip install docker-compose
|
|
- docker-compose up -d
|
|
- sleep 3
|
|
- docker exec alice.whatever.example client -n -d
|
|
-p EB85BB5FA33A75E15E944E63F231550C4F47E38E
|
|
-k /peppythonmixnet/tests/data/alice@openpgp.example.sec.asc
|
|
/peppythonmixnet/tests/data/bob@openpgp.example.asc
|
|
/peppythonmixnet/tests/data/root@n3.pep.example.asc
|
|
/peppythonmixnet/tests/data/root@n2.pep.example.asc
|
|
/peppythonmixnet/tests/data/root@n1.pep.example.asc
|
|
-f /peppythonmixnet/tests/data/plain_from_alice_to_bob.eml
|
|
- sleep 3
|
|
- docker exec alice.whatever.example cat /root/log/mixnet.log
|
|
- docker exec alice.whatever.example cat /var/log/mail.log
|
|
# The Email might take some seconds to arrive to the other containers.
|
|
- sleep 3
|
|
# - docker exec n1.pep.example cat /home/remailer/log/mixnet.log
|
|
- docker exec n1.pep.example cat /var/log/mail.log
|
|
- sleep 3
|
|
# - docker exec n2.pep.example cat /home/remailer/log/mixnet.log
|
|
- docker exec n2.pep.example cat /var/log/mail.log
|
|
- sleep 3
|
|
# - docker exec n3.pep.example cat /home/remailer/log/mixnet.log
|
|
- docker exec n3.pep.example cat /var/log/mail.log
|
|
- sleep 3
|
|
- docker exec bob.openpgp.example cat /var/mail/root
|
|
- docker exec bob.openpgp.example test /var/mail/root
|
|
- echo "Congratulations, Bob has received the encrypted Email from Alice."
|
|
|
|
test_gnunet_rest:
|
|
image: docker/compose
|
|
services:
|
|
- docker:dind
|
|
before_script:
|
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
- apk add --no-cache curl
|
|
script:
|
|
- /bin/sh docker/gnunet/test.sh
|
|
- /bin/sh docker/gnunet/test_rest.sh
|
|
|
|
pages:
|
|
image: python:3.7-buster
|
|
stage: deploy
|
|
script:
|
|
- pip install -U sphinx
|
|
- cd docs
|
|
- make html
|
|
- mv build/html ../public
|
|
artifacts:
|
|
paths:
|
|
- public
|