@@ -8,7 +8,7 @@ dn=$(dirname "$0")
8
8
print_help () {
9
9
cat 1>&2 << 'EOF '
10
10
Usage: coreos-assembler build --help
11
- coreos-assembler build [--force] [--force-image] [--skip-prune] [--tag TAG] [--version VERSION] [TARGET...]
11
+ coreos-assembler build [--force] [--force-image] [--skip-prune] [--strict] [-- tag TAG] [--version VERSION] [TARGET...]
12
12
13
13
Build OSTree and image base artifacts from previously fetched packages.
14
14
Accepted TARGET arguments:
@@ -30,8 +30,9 @@ SKIP_PRUNE=0
30
30
VERSION=
31
31
PARENT=
32
32
TAG=
33
+ STRICT=
33
34
rc=0
34
- options=$( getopt --options hft: --longoptions tag:,help,force,version:,parent:,force-nocache,force-image,skip-prune -- " $@ " ) || rc=$?
35
+ options=$( getopt --options hft: --longoptions tag:,help,force,version:,parent:,force-nocache,force-image,skip-prune,strict -- " $@ " ) || rc=$?
35
36
[ $rc -eq 0 ] || {
36
37
print_help
37
38
exit 1
@@ -52,6 +53,9 @@ while true; do
52
53
--skip-prune)
53
54
SKIP_PRUNE=1
54
55
;;
56
+ --strict)
57
+ STRICT=1
58
+ ;;
55
59
--version)
56
60
shift
57
61
VERSION=$1
@@ -194,23 +198,23 @@ EOF
194
198
195
199
prepare_git_artifacts " ${configdir_gitrepo} " " ${PWD} /coreos-assembler-config.tar.gz" " ${PWD} /coreos-assembler-config-git.json"
196
200
197
- lock_arg=
201
+ extra_compose_args=()
202
+
198
203
for lock in " ${manifest_lock} " " ${manifest_lock_overrides} " ; do
199
204
if [ -f " ${lock} " ]; then
200
- lock_arg+=" --ex-lockfile=${lock} "
201
- echo " Building from lockfile: ${lock} "
205
+ extra_compose_args+=(" --ex-lockfile=${lock} " )
202
206
fi
203
207
done
204
- if [ -n " ${lock_arg} " ]; then
205
- sleep 1
208
+
209
+ if [ -n " ${STRICT} " ]; then
210
+ extra_compose_args+=(" --ex-lockfile-strict" )
206
211
fi
207
212
208
213
# We'll pass this directly to rpm-ostree instead of through
209
214
# commitmeta_input_json since that one also gets injected into meta.json, where
210
215
# there's already ostree-version.
211
- version_arg=
212
216
if [ -n " ${VERSION} " ]; then
213
- version_arg= " --add-metadata-string=version=${VERSION} "
217
+ extra_compose_args+=( " --add-metadata-string=version=${VERSION} " )
214
218
fi
215
219
216
220
# Builds are independent of each other. Higher-level pipelines may want to force
@@ -220,6 +224,7 @@ parent_arg=--no-parent
220
224
if [ -n " ${PARENT} " ]; then
221
225
parent_arg=" --parent=${PARENT} "
222
226
fi
227
+ extra_compose_args+=(" $parent_arg " )
223
228
224
229
# These need to be absolute paths right now for rpm-ostree
225
230
composejson=${PWD} /tmp/compose.json
@@ -231,7 +236,7 @@ prepare_compose_overlays
231
236
runcompose --cache-only ${FORCE} --add-metadata-from-json " ${commitmeta_input_json} " \
232
237
--write-composejson-to " ${composejson} " \
233
238
--ex-write-lockfile-to " ${lockfile_out} " .tmp \
234
- ${lock_arg} ${version_arg} ${parent_arg}
239
+ " ${extra_compose_args[@]} "
235
240
strip_out_lockfile_digests " $lockfile_out " .tmp
236
241
/usr/lib/coreos-assembler/finalize-artifact " ${lockfile_out} " {.tmp,}
237
242
# Very special handling for --write-composejson-to as rpm-ostree doesn't
0 commit comments