vauxite-build/.gitlab-ci.yml

55 lines
2.2 KiB
YAML
Raw Normal View History

2024-03-04 02:31:29 +01:00
stages:
- compose
- build
2024-03-04 19:00:50 +01:00
compose-job:
2024-03-04 02:31:29 +01:00
stage: compose
tags:
- podman-exec
variables:
RELVER: "39"
SOURCE_URL: "https://pagure.io/workstation-ostree-config"
CACHE_DIR: "/cache"
BUILD_REPO: "/build-repo"
SOURCE_REPO: "/source-repo"
before_script:
2024-03-05 14:10:19 +01:00
- podman login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
2024-03-04 02:31:29 +01:00
script:
- mkdir -p "$(pwd)/.tmp"
- |
if [ ! -d "${BUILD_REPO}/objects" ]; then
echo "Previous build repo not found. Initialize new build repo in archive mode."
ostree --repo="${BUILD_REPO}" init --mode=archive
fi
2024-03-04 02:36:32 +01:00
- |
if [ ! -d "${SOURCE_REPO}/.git" ]; then
echo "Source repo not found. Clone from upstream."
git clone -b "f${RELVER}" "${SOURCE_URL}" "${SOURCE_REPO}"
2024-03-04 02:31:29 +01:00
fi
- rsync -aAX "${SOURCE_REPO}"/ "$(pwd)/.tmp"
- rsync -aAX "$(pwd)/src/" "$(pwd)/.tmp"
- rpm-ostree compose image --cachedir "${CACHE_DIR}" --initialize-mode=if-not-exists --format=registry "$(pwd)/.tmp/vauxite.json" "${CI_REGISTRY_IMAGE}/vauxite:${RELVER}"
2024-03-04 02:31:29 +01:00
2024-03-04 19:00:50 +01:00
nonfree-build-job:
2024-03-04 02:31:29 +01:00
stage: build
tags:
2024-03-06 14:28:52 +01:00
- buildah-exec
2024-03-06 03:55:46 +01:00
image: git.hyperreal.coffee:5050/fedora-atomic/containers/buildah:latest
2024-03-04 02:31:29 +01:00
variables:
2024-03-06 18:41:32 +01:00
STORAGE_DRIVER: overlay
2024-03-06 03:55:46 +01:00
BUILDAH_FORMAT: docker
BUILDAH_ISOLATION: chroot
FQ_IMAGE_NAME: "$CI_REGISTRY_IMAGE/vauxite-nonfree:39"
2024-03-04 02:31:29 +01:00
before_script:
2024-03-06 17:30:37 +01:00
- buildah prune -f
2024-03-06 03:55:46 +01:00
- buildah login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
2024-03-04 02:31:29 +01:00
script:
2024-03-06 03:55:46 +01:00
- container=$(buildah from git.hyperreal.coffee:5050/fedora-atomic/vauxite-build/vauxite:39)
2024-03-06 18:41:32 +01:00
- buildah containers
2024-03-06 03:55:46 +01:00
- buildah run $container -- rpm-ostree install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-39.noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-39.noarch.rpm
- buildah run $container -- rpm-ostree override remove libavcodec-free libavfilter-free libavformat-free libavutil-free libpostproc-free libswresample-free libswscale-free --install ffmpeg-libs
- buildah run $container -- ostree container commit
2024-03-06 18:41:32 +01:00
- buildah containers
2024-03-06 10:38:02 +01:00
- buildah commit --squash --rm $container "$FQ_IMAGE_NAME"
- buildah push "$FQ_IMAGE_NAME"