Skip to content
Snippets Groups Projects
Verified Commit 94e2339f authored by David Runge's avatar David Runge :chipmunk:
Browse files

Merge branch 'test_build'

* test_build:
  Add gitlab CI integration
  Add test build script
parents addcd182 a1285728
No related branches found
No related tags found
1 merge request!1Add test build script
Pipeline #9778 passed
---
default:
image: "archlinux:latest"
stages:
- build
- prepare
- publish
build:
after_script:
- mv -- output/metrics.txt .
artifacts:
name: "output"
paths:
- "output/*"
expire_in: 2d
reports:
metrics: metrics.txt
before_script:
- pacman -Syu --needed --noconfirm git
script:
- |
if [[ -n "$CI_COMMIT_TAG" ]]; then
./test_build.sh "$CI_COMMIT_TAG"
else
./test_build.sh "$(git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g')"
fi
stage: build
prepare_release:
artifacts:
reports:
dotenv: variables.env
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_PATH == "dvzrv/test" && $SCHEDULED_PUBLISH == "TRUE"'
script:
- printf "TAG=%(%Y.%m.%d)T.%s\n" -1 "${CI_JOB_ID}" > variables.env
- printf "VERSION=%(%Y.%m.%d)T\n" -1 >> variables.env
stage: prepare
create_release:
before_script:
- pacman -Syu --needed --noconfirm release-cli
needs:
- job: prepare_release
artifacts: true
release:
name: 'Release ${TAG}'
description: 'Auto-created release ${TAG} (version ${VERSION}).'
tag_name: '$TAG'
ref: '$CI_COMMIT_SHA'
assets:
links:
- name: 'Build artifacts'
url: '${CI_PROJECT_URL}/-/jobs/artifacts/${TAG}/browse/output?job=build'
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_PATH == "dvzrv/test" && $SCHEDULED_PUBLISH == "TRUE"'
script:
- printf "Creating release %s...\n" "${TAG}"
stage: publish
#!/usr/bin/env bash
#
# This is a dummy script to create a few files
set -euo pipefail
version="${1}"
output_dir="output/test/test-${version}"
_extension=""
mkdir -pv -- "${output_dir}"
for _extension in {efi,gz,iso,lkrn,pxe,qcow2,xz,zst}; do
printf "TEST FILE\n" > "${output_dir}/file.${_extension}"
done
printf 'foo{bar="baz"} 1\n' output/metrics.txt
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment