Skip to content

Commit

Permalink
chore: rename --update-image
Browse files Browse the repository at this point in the history
- the new command is now called `--overwrite-cache`
- a new debug flag `--force-cache` overrides `--overwrite-cache` and can
  be used to force alpha / trunk builds to be reused.
  • Loading branch information
theseion committed Dec 29, 2023
1 parent e9b2469 commit 7a4e978
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 38 deletions.
2 changes: 1 addition & 1 deletion gtoolkit/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ gtoolkit::prepare_gt() {
download_name="$(basename "${gtoolkit_image_url}")"
target="${SMALLTALK_CI_CACHE}/${download_name}"

if "${config_update_image}" && is_dir "${target}"; then
if "${config_overwrite_cache}" && is_dir "${target}"; then
print_info "Removing cached image resources for ${smalltalk_name} (update forced)"
rm -r "${target}"
fi
Expand Down
52 changes: 27 additions & 25 deletions helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,39 +63,41 @@ print_help() {
This program prepares Smalltalk images/vms, loads projects, and runs tests.
OPTIONS:
--clean Clear cache and delete builds.
-d | --debug Enable debug mode.
-h | --help Show this help text.
--headful Open vm in headful mode and do not close image.
--image Custom image for build (Squeak/Pharo).
--install Install symlink to this smalltalkCI instance.
--print-env Print all environment variables used by smalltalkCI
--no-color Disable colored output
--no-tracking Disable collection of anonymous build metrics (Travis CI & AppVeyor only).
-s | --smalltalk Overwrite Smalltalk image selection.
--uninstall Remove symlink to any smalltalkCI instance.
-v | --verbose Enable 'set -x'.
--vm Custom VM for build (Squeak/Pharo).
--clean Clear cache and delete builds.
-d | --debug Enable debug mode.
--force-cache Force use of the cache for all images (overrides '--overrwrite-cache').
-h | --help Show this help text.
--headful Open vm in headful mode and do not close image.
--image Custom image for build (Squeak/Pharo).
--install Install symlink to this smalltalkCI instance.
-o |--overwrite-cache Download the newest image and cache it.
--print-env Print all environment variables used by smalltalkCI
--no-color Disable colored output
--no-tracking Disable collection of anonymous build metrics (Travis CI & AppVeyor only).
-s | --smalltalk Overwrite Smalltalk image selection.
--uninstall Remove symlink to any smalltalkCI instance.
-v | --verbose Enable 'set -x'.
--vm Custom VM for build (Squeak/Pharo).
GEMSTONE OPTIONS:
--gs-DEBUG Enable remote debugging of GsDevKit_stones .solo scripts
via topaz DEBUGGEM command.
--gs-DEBUG Enable remote debugging of GsDevKit_stones .solo scripts
via topaz DEBUGGEM command.
--gs-PRODUCTS=<gemstone-product-directory>
Specify directory containing GemStone product downloads
to be used instead of downloading products from
https://ftp.gemtalksystems.com for each run.
Specify directory containing GemStone product downloads
to be used instead of downloading products from
https://ftp.gemtalksystems.com for each run.
--gs-REPOS=<gemstone-server-git-projects>
Specify directory containing existing server projects to be
used instead of cloning projects from GitHub for each run.
Specify directory containing existing server projects to be
used instead of cloning projects from GitHub for each run.
--gs-STONE_DIR=<gemstone-stone-directory>
Specify directory of an existing stone. A symbolic link named
product is expected to exist in the <gemstone-stone-directory>
and point to the GEMSTONE product tree for the stone. The name
stone is expected to be managed independently of the run.sh
script.
Specify directory of an existing stone. A symbolic link named
product is expected to exist in the <gemstone-stone-directory>
and point to the GEMSTONE product tree for the stone. The name
stone is expected to be managed independently of the run.sh
script.
EXAMPLE:
$(basename -- $0) -s "Squeak64-trunk" --headfull /path/to/project/.smalltalk.ston
Expand Down
2 changes: 1 addition & 1 deletion pharo/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ pharo::prepare_image() {
local target="${SMALLTALK_CI_CACHE}/${smalltalk_name}"
local pharo_zeroconf="${target}/zeroconfig"

if "${config_update_image}" && is_dir "${target}"; then
if "${config_overwrite_cache}" && is_dir "${target}"; then
print_info "Removing cached image resources for ${smalltalk_name} (update forced)"
rm -r "${target}"
fi
Expand Down
31 changes: 21 additions & 10 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,16 @@ validate_configuration() {
# performed so far.
################################################################################
set_context_options() {
if [ "${config_force_cache}" = "true" ]; then
print_info "Forcing cache use"
config_overwrite_cache="false"
return
fi

case "${config_smalltalk}" in
*-alpha | *-trunk)
print_info "Forcing image update for in-development version"
config_update_image="true"
config_overwrite_cache="true"
;;
*)
;;
Expand All @@ -301,8 +307,8 @@ set_context_options() {
# config_clean
# config_debug
# config_headless
# config_overwrite_cache
# config_smalltalk
# config_update_image
# config_verbose
# Arguments:
# All positional parameters
Expand Down Expand Up @@ -340,6 +346,10 @@ parse_options() {
fi
shift 2
;;
--force-cache)
config_force_cache="true"
shift
;;
--no-color)
config_colorful="false"
shift
Expand All @@ -348,6 +358,10 @@ parse_options() {
config_tracking="false"
shift
;;
-o | --overwrite-cache)
config_overwrite_cache="true"
shift
;;
--print-env)
print_env
exit 0
Expand All @@ -360,10 +374,6 @@ parse_options() {
fi
shift 2
;;
-u | --update-image)
config_update_image="true"
shift
;;
-v | --verbose)
config_verbose="true"
shift
Expand Down Expand Up @@ -544,16 +554,17 @@ run() {
# All positional parameters
################################################################################
main() {
export config_smalltalk=""
local config_ston=""
local config_clean="false"
local config_colorful="true"
local config_debug="false"
local config_first_arg_or_empty=""
local config_force_cache="false"
export config_headless="true"
local config_image=""
local config_colorful="true"
export config_overwrite_cache="false"
export config_smalltalk=""
local config_ston=""
export config_tracking="true"
export config_update_image="false"
local config_verbose="false"
local config_vm=""
local config_vm_dir
Expand Down
2 changes: 1 addition & 1 deletion squeak/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ squeak::download_prepared_image() {
local git_tag=$2
local target="${SMALLTALK_CI_CACHE}/${download_name}"

if "${config_update_image}" && is_file "${target}"; then
if "${config_overwrite_cache}" && is_file "${target}"; then
print_info "Removing cached image resources for ${smalltalk_name} (update forced)"
rm "${target}"
fi
Expand Down

0 comments on commit 7a4e978

Please sign in to comment.