stages: - build default: image: registry.gitlab.com/wunker-bunker/ci-builder before_script: - | IMAGE_NAME=$(yq '.name' ./$RECIPE) IMAGE_DESCRIPTION=$(yq '.description' ./$RECIPE) FEDORA_MAJOR_VERSION=$(yq '.fedora-version' ./$RECIPE) BASE_IMAGE_URL=$(yq '.base-image' ./$RECIPE) # Generate a timestamp for creating an image version history TIMESTAMP="$(date +%Y%m%d)" COMMIT_TAGS=() BUILD_TAGS=() # Have tags for tracking builds during pull request COMMIT_TAGS+=("pr-${CI_MERGE_REQUEST_IID}-${FEDORA_MAJOR_VERSION}") COMMIT_TAGS+=("${CI_COMMIT_SHORT_SHA}-${FEDORA_MAJOR_VERSION}") BUILD_TAGS=("${FEDORA_MAJOR_VERSION}" "${FEDORA_MAJOR_VERSION}-${TIMESTAMP}") BUILD_TAGS+=("${TIMESTAMP}") BUILD_TAGS+=("latest") if [[ $CI_PIPELINE_SOURCE == "merge_request_event" ]]; then echo "Generated the following commit tags: " for TAG in "${COMMIT_TAGS[@]}"; do echo "${TAG}" done alias_tags=("${COMMIT_TAGS[@]}") else alias_tags=("${BUILD_TAGS[@]}") fi echo "Generated the following build tags: " for TAG in "${BUILD_TAGS[@]}"; do echo "${TAG}" done echo "alias_tags=${alias_tags[*]}" build: stage: build parallel: matrix: - RECIPE: - recipe-desktop.yml - recipe-framework.yml script: - buildah build . --build-arg=RECIPE=$RECIPE --build-arg=FEDORA_MAJOR_VERSION=$FEDORA_MAJOR_VERSION --build-arg BASE_IMAGE_URL=$BASE_IMAGE_URL