From 370b7d9fdcfa07b4a108efc15887d7ef893926c1 Mon Sep 17 00:00:00 2001 From: Andrew Jeddeloh Date: Mon, 18 Dec 2017 11:16:05 -0800 Subject: [PATCH] *: 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 --- build_image | 6 +++--- image_to_vm.sh | 18 ++++++++---------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/build_image b/build_image index b7e63861b4..285d113e3e 100755 --- a/build_image +++ b/build_image @@ -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 diff --git a/image_to_vm.sh b/image_to_vm.sh index bf32042f53..b9ea8b5f87 100755 --- a/image_to_vm.sh +++ b/image_to_vm.sh @@ -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}"