Commit 33f61cf2 authored by Hispanico's avatar Hispanico

Update .gitlab-ci.yml

parent 767afc88
Pipeline #275 canceled with stages
stages:
- build
- test
- release
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
build:
tags:
- ninux
- docker
stage: build
script:
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
\ No newline at end of file
- docker build --pull -t $CONTAINER_TEST_IMAGE .
- docker push $CONTAINER_TEST_IMAGE
test:
tags:
- docker
stage: test
script:
- docker pull $CONTAINER_TEST_IMAGE
# Test running the container.
- docker run --name test-container -d --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro $CONTAINER_TEST_IMAGE /lib/systemd/systemd
# Verify Ansible is available in the container.
- docker exec --tty test-container env TERM=xterm ansible --version
release-image:
tags:
- ninux
- docker
stage: release
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
- docker push $CONTAINER_RELEASE_IMAGE
only:
- master
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