blob: 65005bb6f9d5d3d6c11e1803cd3e4391f38c53c0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
stages:
- "test"
- "build runtime"
- "build base"
- "manifest"
- "build"
test manifest:
variables:
GIT_STRATEGY: fetch
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
only:
changes:
- "gitlab/build_manifest.py"
coverage: '/TOTAL.*\s+(\d+%)$/'
artifacts:
reports:
junit:
- "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"
GIT_STRATEGY: fetch
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}
# If we are in a fork, push the image to the reigstry regardless the branch
- |
if [ "$CI_PROJECT_NAMESPACE" != "gstreamer" ]; then
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
docker push ${REF}
docker push ${LATEST}
fi
- echo "$CI_PROJECT_NAMESPACE"
# Push the images to the upstream registry
- |
if [ "$CI_COMMIT_REF_NAME" = "alatiera/check-namepsace" ] && [ "$CI_PROJECT_NAMESPACE" = "gstreamer" ]; 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 docker:
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 docker:
stage: "build base"
variables:
ARCH: "amd64"
TAG: "fedora-build"
CONTEXT_DIR: "docker/build-base-images/"
DOCKERFILE: "docker/build-base-images/Dockerfile-fedora"
extends: .base
include: "gitlab/ci_template.yml"
# Overwrite the job with the same name that comes from the include template,
# in order to use the `:latest` tag of the image built
build fedora x86_64:
# This comes from the `include:` above
extends: .build
image: "${CI_REGISTRY_IMAGE}/amd64/fedora-build:latest"
|