aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mkimage.sh
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2016-11-11 06:45:15 -0800
committerNatanael Copa <ncopa@alpinelinux.org>2016-11-14 20:10:39 +0000
commit06d3a7fb5aa1527ba397127759f0cce358f82eb0 (patch)
treec343588abb596b5cf4256b4f391a9b6e7b79dd18 /scripts/mkimage.sh
parent4f0364e66ce5361cf43bd4002c3fe3d4ab6986bd (diff)
downloadaports-06d3a7fb5aa1527ba397127759f0cce358f82eb0.tar.bz2
aports-06d3a7fb5aa1527ba397127759f0cce358f82eb0.tar.xz
scripts/mkimage.sh: generate yaml
Diffstat (limited to 'scripts/mkimage.sh')
-rw-r--r--scripts/mkimage.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/mkimage.sh b/scripts/mkimage.sh
index 806247213b..6ad9200434 100644
--- a/scripts/mkimage.sh
+++ b/scripts/mkimage.sh
@@ -53,6 +53,7 @@ usage() {
$0 [--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]
[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]
+ [--yaml FILE]
$0 --help
options:
@@ -64,6 +65,7 @@ options:
--simulate Don't execute commands
--tag Build images for tag RELEASE
--workdir Specify temporary working directory (cache)
+--yaml
known profiles: $(echo $all_profiles | sort -u)
@@ -172,6 +174,11 @@ build_profile() {
${_c}sum "$output_file" > "${output_file}.${_c}"
done
fi
+
+ if [ -n "$_yaml_out" ]; then
+ $mkimage_yaml --release $RELEASE \
+ "$output_file" >> "$_yaml_out"
+ fi
fi
}
@@ -179,6 +186,8 @@ build_profile() {
load_plugins "$(dirname $0)"
[ -z "$HOME" ] || load_plugins "$HOME/.mkimage"
+mkimage_yaml="$(dirname $0)"/mkimage-yaml.sh
+
# parse parameters
while [ $# -gt 0 ]; do
opt="$1"
@@ -193,6 +202,7 @@ while [ $# -gt 0 ]; do
--hostkeys) _hostkeys="--hostkeys";;
--simulate) _simulate="yes";;
--checksum) _checksum="yes";;
+ --yaml) _yaml="yes";;
--) break ;;
-*) usage; exit 1;;
esac
@@ -233,6 +243,10 @@ for ARCH in $req_arch; do
fi
abuild-apk update --root "$APKROOT"
+ if [ "$_yaml" = "yes" ]; then
+ _yaml_out=${OUTDIR:-.}/latest-release.yaml
+ echo "---" > "$_yaml_out"
+ fi
for PROFILE in $req_profiles; do
(build_profile) || exit 1
done