You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
1.1 KiB

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
# 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 -t $IMAGE .
- docker push $IMAGE
# tag it as latest and push it too
- docker tag $IMAGE $RELEASE_IMAGE
- docker push $RELEASE_IMAGE
except:
- master
test_remailer:
stage: test
image: $RELEASE_IMAGE
before_script:
- apt update -yqq
- apt install -yqq tox
script:
- tox