kiwi-build, tmt: Require setting the kiwi filename for the build
In preparation for having multiple top-level kiwi description files, expose the ability to define which file to read. Additionally, tests are updated to use this new flag.
This commit is contained in:
parent
40e3039216
commit
c4d19f7f8e
@ -19,7 +19,7 @@ Set up your development environment and run the image build (substitute `<image_
|
|||||||
# Install kiwi
|
# Install kiwi
|
||||||
[]$ sudo dnf --assumeyes install kiwi
|
[]$ sudo dnf --assumeyes install kiwi
|
||||||
# Run the image build
|
# Run the image build
|
||||||
[]$ sudo ./kiwi-build --image-type=<image_type> --image-profile=<image_profile> --output-dir ./outdir
|
[]$ sudo ./kiwi-build --kiwi-file=Fedora.kiwi --image-type=<image_type> --image-profile=<image_profile> --output-dir ./outdir
|
||||||
```
|
```
|
||||||
|
|
||||||
## CI information
|
## CI information
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
## Image variants
|
## Image variants
|
||||||
|
|
||||||
|
### For the `Fedora.kiwi` kiwi file
|
||||||
|
|
||||||
| Name | Image type | Image profiles |
|
| Name | Image type | Image profiles |
|
||||||
|--------------------------------|------------|----------------------------------|
|
|--------------------------------|------------|----------------------------------|
|
||||||
| Base Cloud Edition for clouds | `oem` | `Cloud-Base-Generic` |
|
| Base Cloud Edition for clouds | `oem` | `Cloud-Base-Generic` |
|
||||||
|
19
kiwi-build
19
kiwi-build
@ -8,28 +8,31 @@ set -eu -o pipefail
|
|||||||
kiwibuildsh="$(basename "$0")"
|
kiwibuildsh="$(basename "$0")"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo >&2 "usage: $kiwibuildsh [--kiwi-description-dir=DIR] [--isolated] --output-dir=DIR --image-type=TYPE --image-profile=PROFILE [--debug]"
|
echo >&2 "usage: $kiwibuildsh [--kiwi-description-dir=DIR] [--kiwi-file=FILE] [--isolated] --output-dir=DIR --image-type=TYPE --image-profile=PROFILE [--debug]"
|
||||||
echo >&2 " eg: $kiwibuildsh --kiwi-description-dir=/var/tmp/desc --output-dir=/var/tmp/work --image-type=oem --image-profile=Cloud-Base-Generic --debug"
|
echo >&2 " eg: $kiwibuildsh --kiwi-description-dir=/var/tmp/desc --kiwi-file=config.kiwi --output-dir=/var/tmp/work --image-type=oem --image-profile=Cloud-Base-Generic --debug"
|
||||||
echo >&2 " eg: $kiwibuildsh --output-dir=/var/tmp/work --image-type=oem --image-profile=Cloud-Base-Generic"
|
echo >&2 " eg: $kiwibuildsh --output-dir=/var/tmp/work --image-type=oem --image-profile=Cloud-Base-Generic"
|
||||||
echo >&2 " eg: $kiwibuildsh --isolated --output-dir=/var/tmp/work --image-type=oem --image-profile=Cloud-Base-Generic"
|
echo >&2 " eg: $kiwibuildsh --isolated --output-dir=/var/tmp/work --image-type=oem --image-profile=Cloud-Base-Generic"
|
||||||
exit 255
|
exit 255
|
||||||
}
|
}
|
||||||
|
|
||||||
optTemp=$(getopt --options '+k:,i,o:,t:,p:,d,h' --longoptions 'isolated,kiwi-description-dir:,output-dir:,image-type:,image-profile:,debug,help' --name "$kiwibuildsh" -- "$@")
|
optTemp=$(getopt --options '+k:,f:,i,o:,t:,p:,d,h' --longoptions 'kiwi-description-dir:,kiwi-file:,isolated,output-dir:,image-type:,image-profile:,debug,help' --name "$kiwibuildsh" -- "$@")
|
||||||
eval set -- "$optTemp"
|
eval set -- "$optTemp"
|
||||||
unset optTemp
|
unset optTemp
|
||||||
|
|
||||||
kiwi_isolated=
|
|
||||||
kiwi_description_dir="./"
|
|
||||||
output_dir=
|
output_dir=
|
||||||
image_type=
|
image_type=
|
||||||
image_profile=
|
image_profile=
|
||||||
debug=
|
debug=
|
||||||
|
kiwi_isolated=
|
||||||
|
# For compatibility with older scripts where these did not exist
|
||||||
|
kiwi_description_dir="./"
|
||||||
|
kiwi_file="Fedora.kiwi"
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-i|--isolated) kiwi_isolated=1; shift ;;
|
-i|--isolated) kiwi_isolated=1; shift ;;
|
||||||
-k|--kiwi-description-dir) kiwi_description_dir="$2" ; shift 2 ;;
|
-k|--kiwi-description-dir) kiwi_description_dir="$2" ; shift 2 ;;
|
||||||
|
-f|--kiwi-file) kiwi_file="$2" ; shift 2 ;;
|
||||||
-o|--output-dir) output_dir="$2" ; shift 2 ;;
|
-o|--output-dir) output_dir="$2" ; shift 2 ;;
|
||||||
-t|--image-type) image_type="$2" ; shift 2 ;;
|
-t|--image-type) image_type="$2" ; shift 2 ;;
|
||||||
-p|--image-profile) image_profile="$2" ; shift 2 ;;
|
-p|--image-profile) image_profile="$2" ; shift 2 ;;
|
||||||
@ -39,7 +42,7 @@ while true; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -z "$output_dir" ] || [ -z "$image_type" ] || [ -z "$image_profile" ]; then
|
if [ -z "$output_dir" ] || [ -z "$image_type" ] || [ -z "$image_profile" ] || [ -z "$kiwi_file" ]; then
|
||||||
echo "Options not set!"
|
echo "Options not set!"
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
@ -54,9 +57,9 @@ fi
|
|||||||
|
|
||||||
set +e
|
set +e
|
||||||
if [ ! ${kiwi_isolated} ]; then
|
if [ ! ${kiwi_isolated} ]; then
|
||||||
kiwi-ng ${debug} --type="${image_type}" --profile="${image_profile}" --color-output system build --description "${kiwi_description_dir}" --target-dir "${output_dir}"
|
kiwi-ng ${debug} --type="${image_type}" --profile="${image_profile}" --kiwi-file="${kiwi_file}" --color-output system build --description "${kiwi_description_dir}" --target-dir "${output_dir}"
|
||||||
else
|
else
|
||||||
kiwi-ng ${debug} --type="${image_type}" --profile="${image_profile}" --color-output system boxbuild --box universal --sshfs-sharing -- --description "${kiwi_description_dir}" --target-dir "${output_dir}"
|
kiwi-ng ${debug} --type="${image_type}" --profile="${image_profile}" --kiwi-file="${kiwi_file}" --color-output system boxbuild --box universal --sshfs-sharing -- --description "${kiwi_description_dir}" --target-dir "${output_dir}"
|
||||||
fi
|
fi
|
||||||
kiwi_status=$?
|
kiwi_status=$?
|
||||||
set -e
|
set -e
|
||||||
|
@ -4,5 +4,6 @@ discover:
|
|||||||
environment:
|
environment:
|
||||||
image_type: oem
|
image_type: oem
|
||||||
image_profile: Cloud-Base-AmazonEC2
|
image_profile: Cloud-Base-AmazonEC2
|
||||||
|
kiwi_file: Fedora.kiwi
|
||||||
execute:
|
execute:
|
||||||
how: tmt
|
how: tmt
|
||||||
|
@ -4,5 +4,6 @@ discover:
|
|||||||
environment:
|
environment:
|
||||||
image_type: oem
|
image_type: oem
|
||||||
image_profile: Cloud-Base-Azure
|
image_profile: Cloud-Base-Azure
|
||||||
|
kiwi_file: Fedora.kiwi
|
||||||
execute:
|
execute:
|
||||||
how: tmt
|
how: tmt
|
||||||
|
@ -4,5 +4,6 @@ discover:
|
|||||||
environment:
|
environment:
|
||||||
image_type: oem
|
image_type: oem
|
||||||
image_profile: Cloud-Base-GCE
|
image_profile: Cloud-Base-GCE
|
||||||
|
kiwi_file: Fedora.kiwi
|
||||||
execute:
|
execute:
|
||||||
how: tmt
|
how: tmt
|
||||||
|
@ -4,5 +4,6 @@ discover:
|
|||||||
environment:
|
environment:
|
||||||
image_type: oem
|
image_type: oem
|
||||||
image_profile: Cloud-Base-Generic
|
image_profile: Cloud-Base-Generic
|
||||||
|
kiwi_file: Fedora.kiwi
|
||||||
execute:
|
execute:
|
||||||
how: tmt
|
how: tmt
|
||||||
|
@ -4,5 +4,6 @@ discover:
|
|||||||
environment:
|
environment:
|
||||||
image_type: oem
|
image_type: oem
|
||||||
image_profile: Cloud-Base-UEFI-UKI
|
image_profile: Cloud-Base-UEFI-UKI
|
||||||
|
kiwi_file: Fedora.kiwi
|
||||||
execute:
|
execute:
|
||||||
how: tmt
|
how: tmt
|
||||||
|
@ -4,5 +4,6 @@ discover:
|
|||||||
environment:
|
environment:
|
||||||
image_type: oci
|
image_type: oci
|
||||||
image_profile: Container-Base-Generic-Init
|
image_profile: Container-Base-Generic-Init
|
||||||
|
kiwi_file: Fedora.kiwi
|
||||||
execute:
|
execute:
|
||||||
how: tmt
|
how: tmt
|
||||||
|
@ -4,5 +4,6 @@ discover:
|
|||||||
environment:
|
environment:
|
||||||
image_type: oci
|
image_type: oci
|
||||||
image_profile: Container-Base-Generic-Minimal
|
image_profile: Container-Base-Generic-Minimal
|
||||||
|
kiwi_file: Fedora.kiwi
|
||||||
execute:
|
execute:
|
||||||
how: tmt
|
how: tmt
|
||||||
|
@ -4,5 +4,6 @@ discover:
|
|||||||
environment:
|
environment:
|
||||||
image_type: oci
|
image_type: oci
|
||||||
image_profile: Container-Base-Generic
|
image_profile: Container-Base-Generic
|
||||||
|
kiwi_file: Fedora.kiwi
|
||||||
execute:
|
execute:
|
||||||
how: tmt
|
how: tmt
|
||||||
|
@ -4,5 +4,6 @@ discover:
|
|||||||
environment:
|
environment:
|
||||||
image_type: oci
|
image_type: oci
|
||||||
image_profile: Container-Toolbox
|
image_profile: Container-Toolbox
|
||||||
|
kiwi_file: Fedora.kiwi
|
||||||
execute:
|
execute:
|
||||||
how: tmt
|
how: tmt
|
||||||
|
@ -4,5 +4,6 @@ discover:
|
|||||||
environment:
|
environment:
|
||||||
image_type: oem
|
image_type: oem
|
||||||
image_profile: KDE-Desktop-Disk
|
image_profile: KDE-Desktop-Disk
|
||||||
|
kiwi_file: Fedora.kiwi
|
||||||
execute:
|
execute:
|
||||||
how: tmt
|
how: tmt
|
||||||
|
@ -4,5 +4,6 @@ discover:
|
|||||||
environment:
|
environment:
|
||||||
image_type: iso
|
image_type: iso
|
||||||
image_profile: KDE-Desktop-Live
|
image_profile: KDE-Desktop-Live
|
||||||
|
kiwi_file: Fedora.kiwi
|
||||||
execute:
|
execute:
|
||||||
how: tmt
|
how: tmt
|
||||||
|
@ -4,5 +4,6 @@ discover:
|
|||||||
environment:
|
environment:
|
||||||
image_type: oem
|
image_type: oem
|
||||||
image_profile: Cloud-Base-Vagrant-libvirt
|
image_profile: Cloud-Base-Vagrant-libvirt
|
||||||
|
kiwi_file: Fedora.kiwi
|
||||||
execute:
|
execute:
|
||||||
how: tmt
|
how: tmt
|
||||||
|
@ -7,5 +7,6 @@ adjust:
|
|||||||
environment:
|
environment:
|
||||||
image_type: oem
|
image_type: oem
|
||||||
image_profile: Cloud-Base-Vagrant-VirtualBox
|
image_profile: Cloud-Base-Vagrant-VirtualBox
|
||||||
|
kiwi_file: Fedora.kiwi
|
||||||
execute:
|
execute:
|
||||||
how: tmt
|
how: tmt
|
||||||
|
@ -9,6 +9,6 @@ require:
|
|||||||
framework: shell
|
framework: shell
|
||||||
path: /
|
path: /
|
||||||
test: |
|
test: |
|
||||||
./kiwi-build --debug --image-type="$image_type" --image-profile="$image_profile" --kiwi-description-dir="${TMT_TREE}" --output-dir="${TMT_TEST_DATA}"
|
./kiwi-build --debug --image-type="$image_type" --image-profile="$image_profile" --kiwi-description-dir="${TMT_TREE}" --kiwi-file="$kiwi_file" --output-dir="${TMT_TEST_DATA}"
|
||||||
rm -rf "${TMT_TEST_DATA}/build/image-root"
|
rm -rf "${TMT_TEST_DATA}/build/image-root"
|
||||||
duration: 60m
|
duration: 60m
|
||||||
|
Loading…
Reference in New Issue
Block a user