Skip to content

Commit

Permalink
r4.2: support for building template
Browse files Browse the repository at this point in the history
  • Loading branch information
fepitre committed Jul 9, 2023
1 parent d0dc380 commit 69ce965
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 5 deletions.
20 changes: 20 additions & 0 deletions r4.2/gitlab-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,26 @@ stages:
- sudo rm -rf $CI_PROJECT_DIR/artifacts
- mv ~/qubes-builder/artifacts $CI_PROJECT_DIR/

.r4.2_templates_build:
artifacts:
expire_in: 1 day
when: always
paths:
- artifacts/repository
- artifacts/logs
stage: build
before_script:
# Pull docker image for using (qubes-builder) docker executor
- docker pull fepitre/qubes-builder-fedora:latest
- docker tag fepitre/qubes-builder-fedora:latest qubes-builder-fedora:latest
# Extract from prepare stage qubes-builder directory
- tar xf $CI_PROJECT_DIR/qubes-builder.tar.xz -C ~/
script:
- ~/qubes-builder/gitlab-template-buildv2 "${CI_JOB_NAME#r4.2:build:}"
after_script:
- sudo rm -rf $CI_PROJECT_DIR/artifacts
- mv ~/qubes-builder/artifacts $CI_PROJECT_DIR/

###

r4.2:prep:sources:
Expand Down
9 changes: 9 additions & 0 deletions r4.2/gitlab-vm-debian-build-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
r4.2:build:debian-12:
extends: .r4.2_templates_build
needs:
- r4.2:prep:sources

r4.2:build:debian-12-minimal:
extends: .r4.2_templates_build
needs:
- r4.2:prep:sources
21 changes: 16 additions & 5 deletions scripts/gitlab-builderv2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,22 @@ distributions:
- vm-focal
- vm-jammy

#executor:
# type: local
# options:
# user: "gitlab-runner"
# group: "gitlab-runner"
+templates:
- fedora-38:
dist: fc38
options:
- selinux
- fedora-38-minimal:
dist: fc38
flavor: minimal
- debian-12:
dist: bookworm
options:
- standard
- firmware
- debian-12-minimal:
dist: bookworm
flavor: minimal

executor:
type: docker
Expand Down
22 changes: 22 additions & 0 deletions scripts/gitlab-template-buildv2
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

set -ex

# Script is assumed in qubes-builderv2 root directory
builder_dir="$(dirname "$0")"

template="$1"

if [ -z "$template" ]; then
echo "Please provide template (e.g. fedora-42)."
exit 1
fi

# Go to builder root directory
cd "$builder_dir"

# Run all stages
./qb -t "${template}" template all

mkdir -p artifacts/repository
find artifacts/repository -type f -ls -exec sha1sum {} +

1 comment on commit 69ce965

@fepitre
Copy link
Member Author

@fepitre fepitre commented on 69ce965 Jul 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.