forked from pEp.foundation/pygnunetrest
47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
variables:
|
|
DEBIAN_FRONTEND: noninteractive
|
|
IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
|
RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
|
|
|
|
|
|
|
|
|
|
image: docker:latest
|
|
services:
|
|
- docker:dind
|
|
before_script:
|
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
|
|
build:
|
|
timeout: 3h
|
|
stage: build
|
|
script:
|
|
- echo building $IMAGE and releasing as $RELEASE_IMAGE
|
|
- docker pull $RELEASE_IMAGE || true
|
|
- docker build --pull -t $IMAGE --cache-from $RELEASE_IMAGE .
|
|
- docker push $IMAGE
|
|
- docker tag $IMAGE $RELEASE_IMAGE
|
|
- docker push $RELEASE_IMAGE
|
|
only:
|
|
changes:
|
|
- Dockerfile
|
|
- pygnunetrest
|
|
- setup.cfg
|
|
- setup.py
|
|
- tests
|
|
|
|
test-docker:
|
|
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
|
|
# XXX: when there is an official gnunet image that works, replace this
|
|
# See https://bugs.gnunet.org/view.php?id=6628
|
|
- docker pull registry.gitlab.com/juga0/gnunet:latest
|
|
- docker pull $RELEASE_IMAGE || true
|
|
- mkdir -p tmp
|
|
- cp docker/gnunet.conf tmp/
|
|
- docker-compose up -d
|
|
- docker exec gnunetrest pytest-3 tests
|