Merge pull request #778 from ajeddeloh/prod-default

*: make prod images default
This commit is contained in:
Andrew Jeddeloh 2018-01-05 12:50:39 -08:00 committed by GitHub
commit 5dfe3897b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 15 deletions

View File

@ -82,7 +82,7 @@ DEFINE_string version "" \
# Parse command line. # Parse command line.
FLAGS "$@" || exit 1 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, # 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. # so will die prematurely if 'switch_to_strict_mode' is specified before now.
@ -234,11 +234,11 @@ EOF
# Print out the images we generated. # Print out the images we generated.
if [[ "${PROD_IMAGE}" -eq 1 ]]; then if [[ "${PROD_IMAGE}" -eq 1 ]]; then
echo "CoreOS Production image created as ${COREOS_PRODUCTION_IMAGE_NAME}" echo "CoreOS Production image created as ${COREOS_PRODUCTION_IMAGE_NAME}"
print_image_to_vm "prod" print_image_to_vm
fi fi
if [[ "${DEV_IMAGE}" -eq 1 ]]; then if [[ "${DEV_IMAGE}" -eq 1 ]]; then
echo "Developer image created as ${COREOS_DEVELOPER_IMAGE_NAME}" echo "Developer image created as ${COREOS_DEVELOPER_IMAGE_NAME}"
print_image_to_vm print_image_to_vm dev
fi fi
command_completed command_completed

View File

@ -95,7 +95,7 @@ finish_modify_image() {
info "Done. Updated image is in ${BUILD_DIR}" info "Done. Updated image is in ${BUILD_DIR}"
cat << EOF cat << EOF
To convert it to a virtual machine image, use: To convert it to a virtual machine image, use:
./image_to_vm.sh --from=${OUTSIDE_OUTPUT_DIR} --board=${BOARD} --prod_image ./image_to_vm.sh --from=${OUTSIDE_OUTPUT_DIR} --board=${BOARD}
The default type is qemu, see ./image_to_vm.sh --help for other options. The default type is qemu, see ./image_to_vm.sh --help for other options.
EOF EOF

View File

@ -36,8 +36,8 @@ DEFINE_string disk_layout "" \
"The disk layout type to use for this image." "The disk layout type to use for this image."
DEFINE_integer mem "${DEFAULT_MEM}" \ DEFINE_integer mem "${DEFAULT_MEM}" \
"Memory size for the vm config in MBs." "Memory size for the vm config in MBs."
DEFINE_boolean prod_image "${FLAGS_FALSE}" \ DEFINE_boolean dev_image "${FLAGS_FALSE}" \
"Use the production image instead of the default developer image." "Use the development image instead of the default production image."
DEFINE_string to "" \ DEFINE_string to "" \
"Destination folder for VM output file(s)" "Destination folder for VM output file(s)"
DEFINE_string oem_pkg "" \ DEFINE_string oem_pkg "" \
@ -107,11 +107,13 @@ if [ -f "${FLAGS_from}/version.txt" ]; then
COREOS_VERSION_STRING="${COREOS_VERSION}" COREOS_VERSION_STRING="${COREOS_VERSION}"
fi fi
if [ ${FLAGS_prod_image} -eq ${FLAGS_TRUE} ]; then if [ ${FLAGS_dev_image} -eq ${FLAGS_TRUE} ]; then
set_vm_paths "${FLAGS_from}" "${FLAGS_to}" "${COREOS_PRODUCTION_IMAGE_NAME}"
else
# Use the standard image
set_vm_paths "${FLAGS_from}" "${FLAGS_to}" "${COREOS_DEVELOPER_IMAGE_NAME}" 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 fi
# Make sure things are cleaned up on failure # Make sure things are cleaned up on failure
@ -119,10 +121,6 @@ trap vm_cleanup EXIT
fix_mtab 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 new (raw) image, possibly resizing filesystems
setup_disk_image "${FLAGS_disk_layout}" setup_disk_image "${FLAGS_disk_layout}"

View File

@ -45,7 +45,6 @@ enter lbunzip2 -k -f "/mnt/host/source/${img}.bz2"
script image_to_vm.sh \ script image_to_vm.sh \
--board="${BOARD}" \ --board="${BOARD}" \
--format="${FORMAT}" \ --format="${FORMAT}" \
--prod_image \
--getbinpkg \ --getbinpkg \
--getbinpkgver="${COREOS_VERSION}" \ --getbinpkgver="${COREOS_VERSION}" \
--from=/mnt/host/source/src \ --from=/mnt/host/source/src \