Skip to content

Commit f0828c3

Browse files
committedFeb 20, 2024·
cmd-build: add --versionary switch
I'd like to move out the versionary script from this repo and into the FCOS source config repo. This is prep for adding a versionary script to openshift/os also and unlabeling the versionary knob in the pipeline as a hack.
1 parent e8091bc commit f0828c3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed
 

‎src/cmd-build

+12-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Usage: coreos-assembler build --help
3333
--prepare-only Do not actually build, only set things up so that `rpm-ostree compose image` works.
3434
--tag TAG Set the given tag in the build metadata
3535
--version=VERSION Use the given version instead of following the manifest's `automatic-version-prefix`.
36+
--versionary Use the versionary script from the source config to drive version.
3637
--skip-config-archive Disable creating a tar.gz archive of the config repo.
3738
--autolock=VERSION If no base lockfile used, create one from any arch build of `VERSION`.
3839
Note this is automatically enabled when adding to an existing multi-arch
@@ -54,14 +55,15 @@ FETCH=
5455
SKIP_PRUNE=0
5556
PREPARE_ONLY=0
5657
VERSION=
58+
VERSIONARY=
5759
PARENT=
5860
PARENT_BUILD=
5961
TAG=
6062
STRICT=
6163
CONFIG_ARCHIVE=1
6264
AUTOLOCK_VERSION=
6365
rc=0
64-
options=$(getopt --options hfFt: --longoptions tag:,help,fetch,force,version:,parent:,parent-build:,delay-meta-merge,force-nocache,force-image,skip-prune,prepare-only,strict,skip-config-archive,autolock: -- "$@") || rc=$?
66+
options=$(getopt --options hfFt: --longoptions tag:,help,fetch,force,version:,parent:,parent-build:,delay-meta-merge,force-nocache,force-image,skip-prune,prepare-only,strict,skip-config-archive,autolock:,versionary -- "$@") || rc=$?
6567
[ $rc -eq 0 ] || {
6668
print_help
6769
exit 1
@@ -101,6 +103,9 @@ while true; do
101103
shift
102104
VERSION=$1
103105
;;
106+
--versionary)
107+
VERSIONARY=1
108+
;;
104109
# XXX: to remove once --parent-build is plumbed through
105110
--parent)
106111
shift
@@ -143,6 +148,12 @@ if [ $# -eq 0 ]; then
143148
set -- qemu
144149
fi
145150

151+
if [ -z "${VERSION}" ] && [ -n "${VERSIONARY}" ]; then
152+
# let error out if file does not exist
153+
VERSION=$(src/config/versionary)
154+
echo "New version will be ${VERSION}"
155+
fi
156+
146157
# sanity check the targets and aggregate into a set
147158
declare -A targets=( )
148159
for target in "$@"; do

0 commit comments

Comments
 (0)
Please sign in to comment.