Build the docker images and push them to the gitalb registry

This commit is contained in:
Jordan Petridis 2018-11-05 20:52:37 +02:00
parent 2c1531ab57
commit d9604ca8d2
No known key found for this signature in database
GPG key ID: 902CC06D159744F5
2 changed files with 53 additions and 2 deletions

View file

@ -1,5 +1,7 @@
stages:
- test
- "build runtime"
- "build base"
test manifest:
image: "fedora"
@ -12,4 +14,53 @@ test manifest:
artifacts:
reports:
junit:
- "junit.xml"
- "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"
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/*/**"
fedora amd64 run:
stage: "build runtime"
variables:
ARCH: "amd64"
TAG: "fedora-runtime"
CONTEXT_DIR: "docker/runtime-images/"
DOCKERFILE: "docker/runtime-images/Dockerfile-fedora"
extends: .base
fedora amd64 build:
stage: "build base"
variables:
ARCH: "amd64"
TAG: "fedora-build"
CONTEXT_DIR: "docker/build-base-images/"
DOCKERFILE: "docker/build-base-images/Dockerfile-fedora"
extends: .base

View file

@ -1,4 +1,4 @@
FROM registry.freedesktop.org/thiblahute/gst-ci/fedora-runtime
FROM registry.freedesktop.org/thiblahute/gst-ci/amd64/fedora-runtime
# Add rpmfusion repositories and install all build dependencies of GStreamer
RUN dnf builddep -y \