2020-02-10 13:09:49 +00:00
|
|
|
include: "gitlab/ci_template.yml"
|
|
|
|
|
2018-10-25 10:33:14 +00:00
|
|
|
stages:
|
2018-11-25 00:03:29 +00:00
|
|
|
- "build docker"
|
2018-11-23 16:45:31 +00:00
|
|
|
- "preparation"
|
2019-06-12 05:38:14 +00:00
|
|
|
- "pre-build"
|
2018-11-09 18:57:45 +00:00
|
|
|
- "build"
|
2018-11-23 16:45:31 +00:00
|
|
|
- "test"
|
2019-06-12 05:38:14 +00:00
|
|
|
# use the binaries in some way
|
|
|
|
- "integrate"
|
2018-10-25 10:33:14 +00:00
|
|
|
|
|
|
|
test manifest:
|
2018-11-09 18:57:45 +00:00
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: fetch
|
2020-03-04 22:30:06 +00:00
|
|
|
rules:
|
|
|
|
- when: 'always'
|
2019-10-24 12:13:03 +00:00
|
|
|
image: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/test-manifest:2019-10-23-793476'
|
2018-11-23 16:45:31 +00:00
|
|
|
stage: "preparation"
|
2018-10-25 10:33:14 +00:00
|
|
|
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"
|
|
|
|
|
2020-06-18 16:18:27 +00:00
|
|
|
# have a special definition for the test if the image already exists
|
|
|
|
.check_image: &check_image_exists |
|
|
|
|
# if-not-exists steps
|
|
|
|
set -x
|
|
|
|
|
|
|
|
if [[ -z "$GST_FORCE_REBUILD" ]]
|
|
|
|
then
|
|
|
|
# disable exit on failure
|
|
|
|
set +e
|
|
|
|
|
|
|
|
# check if our image is already in the current registry
|
|
|
|
# we store the sha of the digest and the layers
|
|
|
|
skopeo inspect docker://$LOCAL_IMAGE | jq '[.Digest, .Layers]' > local_sha
|
|
|
|
|
|
|
|
# check if our image is already in the upstream registry
|
|
|
|
if [[ -z "$GST_UPSTREAM_REPO" ]]
|
|
|
|
then
|
|
|
|
echo "WARNING! Variable \$GST_UPSTREAM_REPO is undefined, cannot check for images"
|
|
|
|
else
|
|
|
|
skopeo inspect docker://$GST_UPSTREAM_IMAGE | jq '[.Digest, .Layers]' > upstream_sha
|
|
|
|
fi
|
|
|
|
|
|
|
|
# reenable exit on failure
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# if the upstream repo has an image, ensure we use the same
|
|
|
|
if [ -s upstream_sha ]
|
|
|
|
then
|
|
|
|
|
|
|
|
# ensure we use the same image from upstream
|
|
|
|
diff upstream_sha local_sha && exit 0 || true
|
|
|
|
|
|
|
|
# copy the original image into the current project registry namespace
|
|
|
|
# we do 2 attempts with skopeo copy at most
|
|
|
|
skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
|
|
|
|
docker://$GST_UPSTREAM_IMAGE \
|
|
|
|
docker://$LOCAL_IMAGE || \
|
|
|
|
skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
|
|
|
|
docker://$GST_UPSTREAM_IMAGE \
|
|
|
|
docker://$LOCAL_IMAGE
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# if we have a local image but none in the upstream repo, use our
|
|
|
|
if [ -s local_sha ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
set +x
|
|
|
|
|
2018-11-05 18:52:37 +00:00
|
|
|
.base:
|
2020-06-10 11:39:32 +00:00
|
|
|
image: 'registry.fedoraproject.org/fedora:32'
|
2020-03-04 22:30:06 +00:00
|
|
|
extends:
|
|
|
|
- '.global_ci_policy'
|
2020-04-15 16:54:15 +00:00
|
|
|
tags: ['gstreamer']
|
2020-03-04 22:30:06 +00:00
|
|
|
rules:
|
|
|
|
- when: 'manual'
|
|
|
|
allow_failure: true
|
2018-11-05 18:52:37 +00:00
|
|
|
variables:
|
2019-03-26 18:40:35 +00:00
|
|
|
STORAGE_DRIVER: 'vfs'
|
|
|
|
BUILDAH_FORMAT: 'docker'
|
2020-06-10 11:39:32 +00:00
|
|
|
BUILDAH_ISOLATION: 'chroot'
|
2020-06-18 16:18:27 +00:00
|
|
|
|
|
|
|
# FIXME: Probably needs to be changed to none and clone gst-ci repo each time, sigh
|
|
|
|
# as these jobs *could* run potentially in a fork of smth like -bad
|
|
|
|
# though given our current setup, its only possible to tweak the CI from a gst-ci
|
|
|
|
# fork so it might be fine
|
2018-11-09 18:57:45 +00:00
|
|
|
GIT_STRATEGY: fetch
|
2018-11-05 18:52:37 +00:00
|
|
|
script:
|
2020-06-18 16:18:27 +00:00
|
|
|
- echo $TAG
|
|
|
|
- echo $REPO_SUFFIX
|
|
|
|
|
|
|
|
- export LOCAL_IMAGE="$CI_REGISTRY_IMAGE/$REPO_SUFFIX:$TAG"
|
|
|
|
- export GST_UPSTREAM_IMAGE="$GST_UPSTREAM_REPO/$REPO_SUFFIX:$TAG"
|
|
|
|
|
|
|
|
- echo $LOCAL_IMAGE
|
|
|
|
- echo $GST_UPSTREAM_IMAGE
|
|
|
|
|
|
|
|
# FIXME: make an image since there will be multiple jobs running every pipeline
|
|
|
|
- dnf install -y buildah skopeo jq runc
|
2018-11-05 18:52:37 +00:00
|
|
|
|
2019-03-26 18:40:35 +00:00
|
|
|
# Newer versions of podman/buildah try to set overlayfs mount options when
|
|
|
|
# using the vfs driver, and this causes errors.
|
|
|
|
- sed -i '/^mountopt =.*/d' /etc/containers/storage.conf
|
|
|
|
|
2020-06-18 16:18:27 +00:00
|
|
|
- *check_image_exists
|
|
|
|
|
|
|
|
- echo "Building image $LOCAL_IMAGE"
|
2020-06-10 11:39:32 +00:00
|
|
|
|
|
|
|
- >
|
|
|
|
buildah bud
|
|
|
|
--build-arg DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH
|
|
|
|
--arch=${ARCH:=amd64}
|
|
|
|
--label ci.job_id=$CI_JOB_ID
|
|
|
|
--label pipeline.url=$CI_PIPELINE_URL
|
|
|
|
--label git.ref_name=$CI_COMMIT_REF_NAME
|
|
|
|
--label git.sha=$CI_COMMIT_SHA
|
|
|
|
--label gitlab.project_path=$CI_PROJECT_PATH
|
|
|
|
--label gitlab.project_url=$CI_PROJECT_URL
|
2020-06-18 16:18:27 +00:00
|
|
|
--label fdo.upstream-repo=$GST_UPSTREAM_REPO
|
|
|
|
--label fdo.expires-after="3w"
|
2020-06-10 11:39:32 +00:00
|
|
|
-f $DOCKERFILE
|
2020-06-18 16:18:27 +00:00
|
|
|
-t $LOCAL_IMAGE
|
2020-06-10 11:39:32 +00:00
|
|
|
$CONTEXT_DIR
|
|
|
|
|
|
|
|
- buildah login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
2018-11-05 18:52:37 +00:00
|
|
|
|
2018-11-12 13:22:18 +00:00
|
|
|
|
2020-06-18 16:18:27 +00:00
|
|
|
# Sanity check
|
2018-11-12 13:22:18 +00:00
|
|
|
- |
|
2020-06-18 16:18:27 +00:00
|
|
|
if [ "$CI_PROJECT_PATH" = "gstreamer/gst-ci" ]; then
|
|
|
|
if [ "$LOCAL_IMAGE" != "$GST_UPSTREAM_IMAGE" ]; then
|
|
|
|
echo "ERROR!!! AAAAA! THE IMAGE URI DOES NOT MATCH THE EXPECTED UPSTREAM ONE"
|
|
|
|
echo $LOCAL_IMAGE
|
|
|
|
echo $GST_UPSTRAM_IMAGE
|
|
|
|
exit 1
|
|
|
|
fi
|
2018-11-05 18:52:37 +00:00
|
|
|
fi
|
|
|
|
|
2020-06-18 16:18:27 +00:00
|
|
|
- buildah push $LOCAL_IMAGE
|
|
|
|
|
2018-11-11 02:49:57 +00:00
|
|
|
alpine amd64 manifest builder docker:
|
2018-11-26 13:43:59 +00:00
|
|
|
stage: "build docker"
|
2018-11-11 02:49:57 +00:00
|
|
|
variables:
|
2018-11-26 13:43:59 +00:00
|
|
|
TAG: "build-manifest"
|
|
|
|
CONTEXT_DIR: "docker/build_manifest/"
|
|
|
|
DOCKERFILE: "docker/build_manifest/Dockerfile"
|
2018-11-11 02:49:57 +00:00
|
|
|
extends: .base
|
2018-11-05 18:52:37 +00:00
|
|
|
|
2018-11-30 18:43:39 +00:00
|
|
|
test manifest amd64 docker:
|
|
|
|
stage: "build docker"
|
|
|
|
variables:
|
2018-12-01 11:17:46 +00:00
|
|
|
TAG: "test-manifest"
|
2018-11-30 18:43:39 +00:00
|
|
|
CONTEXT_DIR: "docker/test_manifest/"
|
|
|
|
DOCKERFILE: "docker/test_manifest/Dockerfile"
|
|
|
|
extends: .base
|
|
|
|
|
2018-11-30 17:57:13 +00:00
|
|
|
gst-indent amd64 docker:
|
|
|
|
stage: "build docker"
|
|
|
|
variables:
|
|
|
|
TAG: "gst-indent"
|
|
|
|
CONTEXT_DIR: "docker/indent/"
|
|
|
|
DOCKERFILE: "docker/indent/Dockerfile"
|
|
|
|
extends: .base
|
|
|
|
|
2018-11-25 00:03:29 +00:00
|
|
|
fedora amd64 docker:
|
|
|
|
stage: "build docker"
|
2018-11-05 18:52:37 +00:00
|
|
|
variables:
|
2020-06-18 16:18:27 +00:00
|
|
|
REPO_SUFFIX: "amd64/fedora"
|
|
|
|
TAG: "2020-06-18.0-$GST_UPSTREAM_BRANCH"
|
|
|
|
|
2018-11-25 00:03:29 +00:00
|
|
|
CONTEXT_DIR: "docker/fedora/"
|
|
|
|
DOCKERFILE: "docker/fedora/Dockerfile"
|
2018-11-05 18:52:37 +00:00
|
|
|
extends: .base
|
|
|
|
|
2018-11-14 01:13:13 +00:00
|
|
|
cerbero fedora amd64 docker:
|
|
|
|
stage: "build docker"
|
|
|
|
variables:
|
|
|
|
TAG: "cerbero-fedora"
|
|
|
|
CONTEXT_DIR: "docker/cerbero/"
|
|
|
|
DOCKERFILE: "docker/cerbero/Dockerfile-fedora"
|
|
|
|
extends: .base
|
|
|
|
|
2019-03-24 10:41:31 +00:00
|
|
|
android docker:
|
|
|
|
stage: "build docker"
|
|
|
|
variables:
|
|
|
|
TAG: "android"
|
|
|
|
CONTEXT_DIR: "docker/android/"
|
|
|
|
DOCKERFILE: "docker/android/Dockerfile"
|
|
|
|
extends: .base
|