Skip to content

Commit

Permalink
cmd-build: add --versionary switch
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jlebon committed Feb 20, 2024
1 parent e8091bc commit f0828c3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/cmd-build
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Usage: coreos-assembler build --help
--prepare-only Do not actually build, only set things up so that `rpm-ostree compose image` works.
--tag TAG Set the given tag in the build metadata
--version=VERSION Use the given version instead of following the manifest's `automatic-version-prefix`.
--versionary Use the versionary script from the source config to drive version.
--skip-config-archive Disable creating a tar.gz archive of the config repo.
--autolock=VERSION If no base lockfile used, create one from any arch build of `VERSION`.
Note this is automatically enabled when adding to an existing multi-arch
Expand All @@ -54,14 +55,15 @@ FETCH=
SKIP_PRUNE=0
PREPARE_ONLY=0
VERSION=
VERSIONARY=
PARENT=
PARENT_BUILD=
TAG=
STRICT=
CONFIG_ARCHIVE=1
AUTOLOCK_VERSION=
rc=0
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=$?
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=$?
[ $rc -eq 0 ] || {
print_help
exit 1
Expand Down Expand Up @@ -101,6 +103,9 @@ while true; do
shift
VERSION=$1
;;
--versionary)
VERSIONARY=1
;;
# XXX: to remove once --parent-build is plumbed through
--parent)
shift
Expand Down Expand Up @@ -143,6 +148,12 @@ if [ $# -eq 0 ]; then
set -- qemu
fi

if [ -z "${VERSION}" ] && [ -n "${VERSIONARY}" ]; then
# let error out if file does not exist
VERSION=$(src/config/versionary)
echo "New version will be ${VERSION}"
fi

# sanity check the targets and aggregate into a set
declare -A targets=( )
for target in "$@"; do
Expand Down

0 comments on commit f0828c3

Please sign in to comment.