Commit 7743b923 authored by godog's avatar godog

Ship ai3test inside a container

Used to ship and run tests from inside test hosts.
parent a2c0558f
image: registry.git.autistici.org/ai3/docker/float-runner:master
stages:
- docker_build
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
docker_build_and_release_tests:
stage: docker_build
image: docker:latest
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.git.autistici.org
- cd test && docker build --build-arg ci_token=$CI_JOB_TOKEN --pull -t $IMAGE_TAG .
- docker tag $IMAGE_TAG $CI_REGISTRY_IMAGE:integration-test
- docker push $CI_REGISTRY_IMAGE:integration-test
only:
changes:
- test/**
---
- hosts: host1
gather_facts: no
tasks:
- name: Dump Ansible configuration for test
copy:
dest: /tmp/test-config.yml
content: "{{ vars|to_nice_yaml }}"
- name: Setup test Docker image
docker_image:
name: registry.git.autistici.org/ai3/config:integration-test
force: true
when: "float_debian_dist == 'stretch'"
- name: Setup test Docker image
command: "podman pull registry.git.autistici.org/ai3/config:integration-test"
when: "float_debian_dist != 'stretch'"
- name: Run tests
command: docker run --net host --mount type=bind,source=/tmp/test-config.yml,destination=/test-config.yml registry.git.autistici.org/ai3/config:integration-test
FROM ai3/float:integration-tests
RUN apt-get -q update && env DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends -y python python-pip python-setuptools python-yaml python-nose
ADD . /config
WORKDIR /config
RUN python setup.py install
ENV TEST_CONFIG=/test-config.yml
ENV PYTHONPATH=/src
CMD ["nosetests", "-v", "ai3test"]
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