mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-05 04:06:33 +02:00
*: make prod images default
Make prod images default instead of dev images. Additionally, clean up some of the flag logic around the --dev_image flag in image_to_vm.sh
This commit is contained in:
parent
7ab2b63f09
commit
370b7d9fdc
@ -82,7 +82,7 @@ DEFINE_string version "" \
|
||||
# Parse command line.
|
||||
FLAGS "$@" || exit 1
|
||||
|
||||
eval set -- "${FLAGS_ARGV:-dev}"
|
||||
eval set -- "${FLAGS_ARGV:-prod}"
|
||||
|
||||
# Only now can we die on error. shflags functions leak non-zero error codes,
|
||||
# so will die prematurely if 'switch_to_strict_mode' is specified before now.
|
||||
@ -234,11 +234,11 @@ EOF
|
||||
# Print out the images we generated.
|
||||
if [[ "${PROD_IMAGE}" -eq 1 ]]; then
|
||||
echo "CoreOS Production image created as ${COREOS_PRODUCTION_IMAGE_NAME}"
|
||||
print_image_to_vm "prod"
|
||||
print_image_to_vm
|
||||
fi
|
||||
if [[ "${DEV_IMAGE}" -eq 1 ]]; then
|
||||
echo "Developer image created as ${COREOS_DEVELOPER_IMAGE_NAME}"
|
||||
print_image_to_vm
|
||||
print_image_to_vm dev
|
||||
fi
|
||||
|
||||
command_completed
|
||||
|
||||
@ -36,8 +36,8 @@ DEFINE_string disk_layout "" \
|
||||
"The disk layout type to use for this image."
|
||||
DEFINE_integer mem "${DEFAULT_MEM}" \
|
||||
"Memory size for the vm config in MBs."
|
||||
DEFINE_boolean prod_image "${FLAGS_FALSE}" \
|
||||
"Use the production image instead of the default developer image."
|
||||
DEFINE_boolean dev_image "${FLAGS_FALSE}" \
|
||||
"Use the development image instead of the default production image."
|
||||
DEFINE_string to "" \
|
||||
"Destination folder for VM output file(s)"
|
||||
DEFINE_string oem_pkg "" \
|
||||
@ -107,11 +107,13 @@ if [ -f "${FLAGS_from}/version.txt" ]; then
|
||||
COREOS_VERSION_STRING="${COREOS_VERSION}"
|
||||
fi
|
||||
|
||||
if [ ${FLAGS_prod_image} -eq ${FLAGS_TRUE} ]; then
|
||||
set_vm_paths "${FLAGS_from}" "${FLAGS_to}" "${COREOS_PRODUCTION_IMAGE_NAME}"
|
||||
else
|
||||
# Use the standard image
|
||||
if [ ${FLAGS_dev_image} -eq ${FLAGS_TRUE} ]; then
|
||||
set_vm_paths "${FLAGS_from}" "${FLAGS_to}" "${COREOS_DEVELOPER_IMAGE_NAME}"
|
||||
if [[ "${FLAGS_disk_layout}" == "" ]]; then
|
||||
FLAGS_disk_layout=devel
|
||||
fi
|
||||
else
|
||||
set_vm_paths "${FLAGS_from}" "${FLAGS_to}" "${COREOS_PRODUCTION_IMAGE_NAME}"
|
||||
fi
|
||||
|
||||
# Make sure things are cleaned up on failure
|
||||
@ -119,10 +121,6 @@ trap vm_cleanup EXIT
|
||||
|
||||
fix_mtab
|
||||
|
||||
if [[ "${FLAGS_prod_image}" -eq "${FLAGS_FALSE}" && "${FLAGS_disk_layout}" == "" ]]; then
|
||||
FLAGS_disk_layout=devel
|
||||
fi
|
||||
|
||||
# Setup new (raw) image, possibly resizing filesystems
|
||||
setup_disk_image "${FLAGS_disk_layout}"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user