Skip to content

Commit

Permalink
Add CI for individual submodules of QWT - R4.2 variant
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Feb 15, 2023
1 parent 143d6e6 commit bc58527
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
4 changes: 2 additions & 2 deletions r4.2/gitlab-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ stages:
- mv ~/qubes-continuous-integration/scripts/combine-and-sign-repo ~/qubes-builder/
- mv ~/qubes-continuous-integration/scripts/gitlab-builderv2.yml ~/qubes-builder/builder.yml
script:
- ~/qubes-builder/gitlab-preparev2 "$CI_PROJECT_DIR"
- ~/qubes-builder/gitlab-preparev2 "$CI_PROJECT_DIR" $SUBMODULE_OF
- tar cJf $CI_PROJECT_DIR/qubes-builder.tar.xz --strip-components=1 -C ~/ qubes-builder
after_script:
- sudo rm -rf $CI_PROJECT_DIR/artifacts
Expand All @@ -67,7 +67,7 @@ stages:
# Extract from prepare stage qubes-builder directory
- tar xf $CI_PROJECT_DIR/qubes-builder.tar.xz -C ~/
script:
- ~/qubes-builder/gitlab-buildv2 "$CI_PROJECT_DIR" "${CI_JOB_NAME#r4.2:build:}"
- ~/qubes-builder/gitlab-buildv2 "${COMPONENT-$CI_PROJECT_DIR}" "${DIST-${CI_JOB_NAME#r4.2:build:}}"
after_script:
- sudo rm -rf $CI_PROJECT_DIR/artifacts
- mv ~/qubes-builder/artifacts $CI_PROJECT_DIR/
Expand Down
14 changes: 14 additions & 0 deletions r4.2/gitlab-host-qwt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
variables:
SUBMODULE_OF: qubes-windows-tools-cross

r4.2:build:host-qwt:
extends: .r4.2_components_build
needs:
- r4.2:prep:sources
# - project: QubesOS/qubes-builder-rpm
# ref: master
# job: chroot:dom0-fc32
# artifacts: true
variables:
DIST: "host-fc37"
COMPONENT: qubes-windows-tools-cross
28 changes: 24 additions & 4 deletions scripts/gitlab-preparev2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ builder_dir="$(dirname "$0")"

# Component directory is passed as argument
component_dir="$1"
component_name="$(basename "$component_dir")"

# if submodule=true, treat $component_dir as submodule of $component_name
submodule=false
if [ -n "${2-}" ]; then
component_name="$2"
submodule=true
else
component_name="$(basename "$component_dir")"
fi

if [ -z "$component_dir" ]; then
echo "Please provide component directory!"
Expand All @@ -24,9 +32,21 @@ component_name=${component_name#qubes-}
# Go to builder root directory
cd "$builder_dir"

# Place Gitlab CI downloaded sources in artifacts/sources
mkdir -p artifacts/sources
cp -a "$component_dir" "artifacts/sources/$component_name"
if ! $submodule; then
# Place Gitlab CI downloaded sources in artifacts/sources
mkdir -p artifacts/sources
cp -a "$component_dir" "artifacts/sources/$component_name"
fi

# Run fetch stage
./qb -c "$component_name" package fetch

if $submodule; then
submodule_name=$(basename "$component_dir")
if ! [ -d "artifacts/sources/$component_name/$submodule_name" ]; then
echo "$submodule_name is not within $component_name component"
exit 1
fi
rm -rf "artifacts/sources/$component_name/$submodule_name"
cp -a "$component_dir" "artifacts/sources/$component_name/$submodule_name"
fi

0 comments on commit bc58527

Please sign in to comment.