-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix build-tests/x86/tumbleweed to build outside of OBS. In addition I added a simple build-tests.sh script which makes use of boxbuild in container mode to build the tests from a given build-tests directory.
- Loading branch information
Showing
24 changed files
with
231 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
#!/bin/bash | ||
# git clone https://github.com/OSInside/kiwi.git | ||
# Simple build test script to build the integration test | ||
# images from a given test directory. The host to run this | ||
# command requires the following packages: | ||
# | ||
# - tree | ||
# - git | ||
# - libxml2-tools | ||
# - podman | ||
# - python311-pip | ||
# | ||
# And requires the installation of the kiwi box plugin | ||
# | ||
# $ pip3.11 install --upgrade kiwi-boxed-plugin | ||
# | ||
set -e | ||
|
||
ARGUMENT_LIST=( | ||
"test-dir:" | ||
"test-name:" | ||
"box-name:" | ||
) | ||
|
||
function usage() { | ||
echo "usage: build-tests --test-dir <dir>" | ||
echo " --test-dir <dir>" | ||
echo " Some test dir name, e.g. build-tests/x86/tumbleweed/" | ||
echo " --test-name <name>" | ||
echo " some test name, e.g. test-image-disk" | ||
echo " --box-name <name>" | ||
echo " name of the box to use for the build, default: universal" | ||
} | ||
|
||
if ! opts=$(getopt \ | ||
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \ | ||
--name "$(basename "$0")" \ | ||
--options "" \ | ||
-- "$@" | ||
); then | ||
usage | ||
exit 0 | ||
fi | ||
|
||
eval set --"${opts}" | ||
|
||
while [[ $# -gt 0 ]]; do | ||
case "$1" in | ||
--test-dir) | ||
argTestDir=$2 | ||
shift 2 | ||
;; | ||
|
||
--test-name) | ||
argTestName=$2 | ||
shift 2 | ||
;; | ||
|
||
--box-name) | ||
argBoxName=$2 | ||
shift 2 | ||
;; | ||
|
||
*) | ||
break | ||
;; | ||
esac | ||
done | ||
|
||
if [ ! "${argTestDir}" ];then | ||
usage | ||
exit 1 | ||
fi | ||
|
||
if [ ! -e "${argTestDir}"/.repos ];then | ||
echo "No .repos information for specified test dir" | ||
exit 1 | ||
fi | ||
|
||
boxname=universal | ||
if [ "${argBoxName}" ];then | ||
boxname="${argBoxName}" | ||
fi | ||
|
||
function create_repo_list() { | ||
local build_dir=$1 | ||
local repo_options="--ignore-repos" | ||
while read -r repo;do | ||
repo_options="${repo_options} --add-repo ${repo}" | ||
done < "${build_dir}"/.repos | ||
echo "${repo_options}" | ||
} | ||
|
||
function create_build_commands() { | ||
local build_dir=$1 | ||
local test_name=$2 | ||
build_commands=() | ||
for image in "${build_dir}"/*;do | ||
test -e "${image}/.skip_boxbuild_container" && continue | ||
base_image=$(basename "${image}") | ||
if [ -n "${test_name}" ] && [ ! "${test_name}" = "${base_image}" ];then | ||
continue | ||
fi | ||
build_command="kiwi-ng --debug" | ||
has_profiles=false | ||
repo_options=$(create_repo_list "${build_dir}") | ||
for profile in $( | ||
xmllint --xpath "//image/profiles/profile/@name" \ | ||
"${image}/appliance.kiwi" 2>/dev/null | cut -f2 -d\" | ||
);do | ||
has_profiles=true | ||
target_dir="build_results/${base_image}/${profile}" | ||
build_command="${build_command} --profile ${profile}" | ||
build_command="${build_command} system boxbuild" | ||
build_command="${build_command} --box ${boxname} --container --" | ||
build_command="${build_command} --description $image" | ||
build_command="${build_command} ${repo_options}" | ||
build_command="${build_command} --target-dir ${target_dir}" | ||
echo "${build_command}" \ | ||
> "build_results/${base_image}-${profile}.build" | ||
build_commands+=( "${build_command}" ) | ||
build_command="kiwi-ng --debug" | ||
done | ||
if [ "${has_profiles}" = "false" ];then | ||
target_dir="build_results/${base_image}" | ||
build_command="${build_command} system boxbuild" | ||
build_command="${build_command} --box ${boxname} --container --" | ||
build_command="${build_command} --description $image" | ||
build_command="${build_command} ${repo_options}" | ||
build_command="${build_command} --target-dir ${target_dir}" | ||
echo "${build_command}" \ | ||
> "build_results/${base_image}.build" | ||
build_commands+=( "${build_command}" ) | ||
fi | ||
done | ||
} | ||
|
||
# create results directory | ||
mkdir -p build_results | ||
|
||
# build x86/tumbleweed command list | ||
create_build_commands "${argTestDir}" "${argTestName}" | ||
|
||
# build them in a row | ||
# export PATH=$PATH:/home/ec2-user/.local/bin/kiwi-ng | ||
for build in "${build_commands[@]}";do | ||
${build} | ||
sudo rm -rf build_results/*/*/build/ | ||
sudo rm -rf build_results/*/build/ | ||
done | ||
|
||
# show result tree | ||
test -d build_results && tree -L 3 build_results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
https://download.opensuse.org/tumbleweed/repo/oss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
build-tests/x86/tumbleweed/test-image-disk-legacy/.skip_boxbuild_container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
requires legacy oemboot package which does not exist in the box |
1 change: 1 addition & 0 deletions
1
build-tests/x86/tumbleweed/test-image-disk-legacy/.skip_boxbuild_vm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
requires legacy oemboot package which does not exist in the box |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
build-tests/x86/tumbleweed/test-image-docker-derived/.skip_boxbuild_container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
building a container in a container causes issues for buildah |
1 change: 1 addition & 0 deletions
1
build-tests/x86/tumbleweed/test-image-docker/.skip_boxbuild_container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
building a container in a container causes issues for buildah |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters