2018-10-25 10:33:14 +00:00
|
|
|
stages:
|
|
|
|
- test
|
2018-11-05 18:52:37 +00:00
|
|
|
- "build runtime"
|
|
|
|
- "build base"
|
2018-11-09 18:57:45 +00:00
|
|
|
- "manifest"
|
|
|
|
- "build"
|
2018-10-25 10:33:14 +00:00
|
|
|
|
|
|
|
test manifest:
|
2018-11-09 18:57:45 +00:00
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: fetch
|
2018-10-25 10:33:14 +00:00
|
|
|
image: "fedora"
|
|
|
|
stage: "test"
|
|
|
|
before_script:
|
|
|
|
- dnf install -y python3-pytest python3-pytest-cov python3-requests
|
|
|
|
script:
|
|
|
|
- pytest-3 --junitxml=junit.xml --cov=build_manifest gitlab/build_manifest.py
|
|
|
|
coverage: '/TOTAL.*\s+(\d+%)$/'
|
|
|
|
artifacts:
|
|
|
|
reports:
|
|
|
|
junit:
|
2018-11-05 18:52:37 +00:00
|
|
|
- "junit.xml"
|
|
|
|
|
|
|
|
.base:
|
|
|
|
image: "docker:stable"
|
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
variables:
|
|
|
|
# When using dind, it's wise to use the overlayfs driver for
|
|
|
|
# improved performance.
|
|
|
|
DOCKER_DRIVER: "overlay2"
|
2018-11-09 18:57:45 +00:00
|
|
|
GIT_STRATEGY: fetch
|
2018-11-05 18:52:37 +00:00
|
|
|
script:
|
|
|
|
- export IMAGE="${CI_REGISTRY_IMAGE}/${ARCH}/${TAG}"
|
|
|
|
- export REF="${IMAGE}:${CI_COMMIT_SHA}"
|
|
|
|
- export LATEST="${IMAGE}:latest"
|
|
|
|
|
|
|
|
- docker build --pull -f ${DOCKERFILE} -t ${REF} ${CONTEXT_DIR}
|
|
|
|
- docker image tag ${REF} ${LATEST}
|
|
|
|
|
|
|
|
# Push the images
|
|
|
|
- |
|
|
|
|
if [ "$CI_COMMIT_REF_NAME" = "master" ]; then
|
|
|
|
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
|
|
docker push ${REF}
|
|
|
|
docker push ${LATEST}
|
|
|
|
fi
|
|
|
|
only:
|
|
|
|
changes:
|
|
|
|
- ".gitlab-ci.yml"
|
|
|
|
- "docker/**"
|
|
|
|
- "docker/*/**"
|
|
|
|
|
|
|
|
|
2018-11-09 18:57:45 +00:00
|
|
|
fedora amd64 run docker:
|
2018-11-05 18:52:37 +00:00
|
|
|
stage: "build runtime"
|
|
|
|
variables:
|
|
|
|
ARCH: "amd64"
|
|
|
|
TAG: "fedora-runtime"
|
|
|
|
CONTEXT_DIR: "docker/runtime-images/"
|
|
|
|
DOCKERFILE: "docker/runtime-images/Dockerfile-fedora"
|
|
|
|
extends: .base
|
|
|
|
|
2018-11-09 18:57:45 +00:00
|
|
|
fedora amd64 build docker:
|
2018-11-05 18:52:37 +00:00
|
|
|
stage: "build base"
|
|
|
|
variables:
|
|
|
|
ARCH: "amd64"
|
|
|
|
TAG: "fedora-build"
|
|
|
|
CONTEXT_DIR: "docker/build-base-images/"
|
|
|
|
DOCKERFILE: "docker/build-base-images/Dockerfile-fedora"
|
|
|
|
extends: .base
|
|
|
|
|
2018-11-09 18:57:45 +00:00
|
|
|
include: "gitlab/ci_template.yml"
|