2024-03-04 02:31:29 +01:00
|
|
|
stages:
|
|
|
|
- compose
|
|
|
|
- build
|
|
|
|
|
|
|
|
vauxite-compose-job:
|
|
|
|
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:
|
|
|
|
- podman login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
|
|
|
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"
|
2024-03-04 14:44:38 +01:00
|
|
|
- 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
|
|
|
|
|
|
|
vauxite-nonfree-job:
|
|
|
|
stage: build
|
|
|
|
tags:
|
2024-03-04 14:44:38 +01:00
|
|
|
- podman-in-podman
|
2024-03-04 02:31:29 +01:00
|
|
|
variables:
|
2024-03-04 04:49:36 +01:00
|
|
|
PODMAN_IMAGE_NAME: "${CI_REGISTRY_IMAGE}-nonfree:${CI_COMMIT_REF_SLUG}"
|
2024-03-04 02:31:29 +01:00
|
|
|
before_script:
|
2024-03-04 14:44:38 +01:00
|
|
|
- podman login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
2024-03-04 02:31:29 +01:00
|
|
|
script:
|
|
|
|
- cd oci/nonfree
|
2024-03-04 14:44:38 +01:00
|
|
|
- podman build -t "$PODMAN_IMAGE_NAME" .
|
|
|
|
- podman push "$PODMAN_IMAGE_NAME"
|
2024-03-04 02:31:29 +01:00
|
|
|
- |
|
|
|
|
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
|
2024-03-04 14:44:38 +01:00
|
|
|
podman tag "$PODMAN_IMAGE_NAME" "$CI_REGISTRY_IMAGE:latest"
|
|
|
|
podman push "$CI_REGISTRY_IMAGE:latest"
|
2024-03-04 02:31:29 +01:00
|
|
|
fi
|