Skip to content
Snippets Groups Projects
Commit eb5a6a77 authored by bmckitrick's avatar bmckitrick
Browse files

chore: update copier-version to v.13.0

parent f540f893
No related branches found
No related tags found
No related merge requests found
Pipeline #21080760 passed
Loading
Loading
@@ -3,7 +3,7 @@
# See the project for instructions on how to update the project
#
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: v1.12.1
_commit: v1.13.0
_src_path: https://gitlab.com/gitlab-com/gl-infra/common-template-copier.git
ee_licensed: false
golang: false
Loading
Loading
# This file is used to track the version of copier uses
v1.12.1 # datasource=gitlab-releases depName=gitlab-com/gl-infra/common-template-copier
v1.13.0 # datasource=gitlab-releases depName=gitlab-com/gl-infra/common-template-copier
Loading
Loading
@@ -5,7 +5,7 @@
set -euo pipefail
IFS=$'\n\t'
 
# Temporary transition over to rtx from asdf
# Temporary transition over to mise from asdf
# see https://gitlab.com/gitlab-com/runbooks/-/issues/134
# for details
setup_asdf() {
Loading
Loading
@@ -54,45 +54,51 @@ setup_asdf() {
}
}
 
setup_rtx() {
temp_RTX_SHORTHANDS_FILE=$(mktemp)
trap 'do_rtx_install' EXIT
setup_mise() {
temp_MISE_SHORTHANDS_FILE=$(mktemp)
trap 'do_mise_install' EXIT
 
do_rtx_install() {
cat "$temp_RTX_SHORTHANDS_FILE"
RTX_SHORTHANDS_FILE=$temp_RTX_SHORTHANDS_FILE rtx install
rm -f "$temp_RTX_SHORTHANDS_FILE"
do_mise_install() {
cat "$temp_MISE_SHORTHANDS_FILE"
MISE_SHORTHANDS_FILE=$temp_MISE_SHORTHANDS_FILE $MISE_COMMAND install
rm -f "$temp_MISE_SHORTHANDS_FILE"
}
 
install_plugin() {
local plugin=$1
local source=${2-}
 
# No source? rtx defaults should suffice.
# No source? mise defaults should suffice.
if [[ -z $source ]]; then return; fi
 
# See https://github.com/jdxcode/rtx#rtx_shorthands_fileconfigrtxshorthandstoml
echo "$plugin = \"$source\"" >>"$temp_RTX_SHORTHANDS_FILE"
# See https://mise.jdx.dev/configuration.html#mise-shorthands-file-config-mise-shorthands-toml
echo "$plugin = \"$source\"" >>"$temp_MISE_SHORTHANDS_FILE"
}
 
remove_plugin_with_source() {
local plugin=$1
local source=$2
 
if ! rtx plugin list --urls | grep -qF "${source}"; then
if ! $MISE_COMMAND plugin list --urls | grep -qF "${source}"; then
return
fi
 
echo "# Removing plugin ${plugin} installed from ${source}"
rtx plugin remove "${plugin}" || {
$MISE_COMMAND plugin remove "${plugin}" || {
echo "Failed to remove plugin: ${plugin}"
exit 1
} >&2
}
}
 
if command -v rtx >/dev/null; then
setup_rtx
if command -v mise >/dev/null; then
MISE_COMMAND=$(which mise)
export MISE_COMMAND
setup_mise
elif command -v rtx >/dev/null; then
MISE_COMMAND=$(which rtx)
export MISE_COMMAND
setup_mise
elif [[ -n ${ASDF_DIR-} ]]; then
setup_asdf
fi
Loading
Loading
Loading
Loading
@@ -19,12 +19,14 @@ warn() {
echo >&2 -e "Recommended reading: https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/docs/developer-setup.md"
}
 
if command -v rtx >/dev/null; then
echo >&2 -e "rtx installed..."
if command -v mise >/dev/null; then
echo >&2 -e "mise installed..."
elif command -v rtx >/dev/null; then
warn "⚠️ 2024-01-02: 'rtx' has changed to 'mise' ; please upgrade before rtx is deprecated"
elif [[ -n ${ASDF_DIR-} ]]; then
warn "asdf installed, but deprecated. Consider switching over to rtx."
else
warn "Neither rtx nor asdf is installed. "
warn "Neither mise nor asdf is installed. "
exit 1
fi
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment