Skip to content
Snippets Groups Projects
Commit c7759c8d authored by GitLab Renovate Bot's avatar GitLab Renovate Bot
Browse files

chore(deps): update dependency...

chore(deps): update dependency https://gitlab.com/gitlab-com/gl-infra/common-template-copier.git to v1.20.2
parent d5413bb3
No related branches found
No related tags found
No related merge requests found
Pipeline #23136081 passed
Loading
Loading
@@ -3,9 +3,11 @@
# See the project for instructions on how to update the project
#
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: v1.14.0
_commit: v1.20.2
_src_path: https://gitlab.com/gitlab-com/gl-infra/common-template-copier.git
ee_licensed: false
golang: false
initial_codeowners: '@andrewn'
jsonnet: false
project_name: common-ci-tasks
terraform: false
# This file is used to track the version of copier uses
v1.14.0 # datasource=gitlab-releases depName=gitlab-com/gl-infra/common-template-copier
Loading
Loading
@@ -13,6 +13,10 @@ insert_final_newline = true
insert_final_newline = true
trim_trailing_whitespace = true
 
[.copier-*.yml]
insert_final_newline = unset
indent_size = unset
[*.md]
indent_style = unset
indent_size = unset
[settings]
legacy_version_file = false
# [tools]
# Please continue to use `.tool-versions` to specify tools, rather than adding them directly here.
[plugins]
# Use this section to configure the source of any custom mise/asdf plugin
Loading
Loading
@@ -2,6 +2,9 @@
# for configuration documentation
extends: default
 
ignore: |
.copier-*.yml
rules:
document-start: disable
line-length: disable
Loading
Loading
Loading
Loading
@@ -4,7 +4,8 @@
"gitlab>gitlab-com/gl-infra/common-ci-tasks:renovate-common",
"gitlab>gitlab-com/gl-infra/common-ci-tasks:renovate-automerge",
"gitlab>gitlab-com/gl-infra/common-ci-tasks:renovate-versions-dedicated",
"gitlab>gitlab-com/gl-infra/common-ci-tasks:renovate-versions-gitlab-com"
"gitlab>gitlab-com/gl-infra/common-ci-tasks:renovate-versions-gitlab-com",
"gitlab>gitlab-com/gl-infra/common-ci-tasks:renovate-truncated-versions"
],
"regexManagers": [
{
Loading
Loading
Loading
Loading
@@ -2,138 +2,12 @@
# Vendored from https://gitlab.com/gitlab-com/gl-infra/common-template-copier
# Consider contributing upstream when updating this file
 
# This script will install the ASDF plugins required for this project
# This file is deprecated: going forward running `mise install` should be sufficient.
 
set -euo pipefail
IFS=$'\n\t'
 
# Temporary transition over to mise from asdf
# see https://gitlab.com/gitlab-com/runbooks/-/issues/134
# for details
setup_asdf() {
# shellcheck source=/dev/null
source "$ASDF_DIR/asdf.sh"
echo >&2 -e "2024-08-07: this file is deprecated: going forward, simply run 'mise install' to install plugins."
echo >&2 -e "Recommended reading: https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/docs/developer-setup.md"
 
plugin_list=$(asdf plugin list || echo "")
install_plugin() {
local plugin=$1
if ! echo "${plugin_list}" | grep -q "${plugin}"; then
echo "# Installing plugin" "$@"
asdf plugin add "$@" || {
echo "Failed to install plugin:" "$@"
exit 1
} >&2
fi
echo "# Installing ${plugin} version"
asdf install "${plugin}" || {
echo "Failed to install plugin version: ${plugin}"
exit 1
} >&2
# Use this plugin for the rest of the install-asdf-plugins.sh script...
asdf shell "${plugin}" "$(asdf current "${plugin}" | awk '{print $2}')"
}
remove_plugin_with_source() {
local plugin=$1
local source=$2
if ! asdf plugin list --urls | grep -qF "${source}"; then
return
fi
echo "# Removing plugin ${plugin} installed from ${source}"
asdf plugin remove "${plugin}" || {
echo "Failed to remove plugin: ${plugin}"
exit 1
} >&2
# Refresh list of installed plugins.
plugin_list=$(asdf plugin list)
}
}
setup_mise() {
temp_MISE_SHORTHANDS_FILE=$(mktemp)
trap 'do_mise_install' EXIT
do_mise_install() {
export MISE_SHORTHANDS_FILE=$temp_MISE_SHORTHANDS_FILE
$MISE_COMMAND install || {
# mise installs plugins in parallel, so order may lead to breaks when some plugins require others
# the best workaround is to use `.mise.toml` with dependencies, but we can't do this until the
# migration off asdf, in https://gitlab.com/gitlab-com/runbooks/-/issues/134 is complete.
# until then, a retry without parallelism should be sufficient.
# Export tool paths so that plugins can find dependencies
eval "$(mise env --shell bash)"
echo "$MISE_COMMAND install failed. Attempting a retry as it may be a plugin dependency issue" >&2
RTX_JOBS=1 MISE_JOBS=1 $MISE_COMMAND install
}
unset MISE_SHORTHANDS_FILE
rm -f "$temp_MISE_SHORTHANDS_FILE"
}
install_plugin() {
local plugin=$1
local source=${2-}
# No source? mise defaults should suffice.
if [[ -z $source ]]; then return; fi
# 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 ! $MISE_COMMAND plugin list --urls | grep -qF "${source}"; then
return
fi
echo "# Removing plugin ${plugin} installed from ${source}"
$MISE_COMMAND plugin remove "${plugin}" || {
echo "Failed to remove plugin: ${plugin}"
exit 1
} >&2
}
}
# Do some validation to ensure that the environment is not misconfigured, as this may
# save a bunch of debugging effort down the line.
# Detect Rosetta 2
if [[ $(uname -m) == "arm64" ]] && [[ $(uname -p) == "x86_64" ]]; then
echo "This shell is running in Rosetta emulating x86_64. Please use native mode Apple Silicon." >&2
echo "For help visit https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/docs/developer-setup.md" >&2
exit 1
fi
# Detect ancient versions of bash
if ((BASH_VERSINFO[0] < 4)); then
echo "You're running bash < v4.0.0. Please upgrade to a newer version." >&2
echo "For help visit https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/docs/developer-setup.md" >&2
exit 1
fi
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
install_plugin shellcheck
install_plugin shfmt
install_plugin pre-commit
mise install
Loading
Loading
@@ -24,17 +24,36 @@ warn() {
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"
warn "⚠️ 2024-01-02: 'rtx' has changed to 'mise'; please replace 'rtx' with 'mise'"
exit 1
elif [[ -n ${ASDF_DIR-} ]]; then
warn "asdf installed, but deprecated. Consider switching over to rtx."
warn "⚠️ 2024-08-07: 'asdf' is no longer supported; please uninstall and replace with 'mise'"
exit 1
else
warn "Neither mise nor asdf is installed. "
warn "mise is not installed."
exit 1
fi
# Do some validation to ensure that the environment is not misconfigured, as this may
# save a bunch of debugging effort down the line.
# Detect Rosetta 2
if [[ $(uname -m) == "arm64" ]] && [[ $(uname -p) == "x86_64" ]]; then
echo "This shell is running in Rosetta emulating x86_64. Please use native mode Apple Silicon." >&2
echo "For help visit https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/docs/developer-setup.md" >&2
exit 1
fi
# Detect ancient versions of bash
if ((BASH_VERSINFO[0] < 4)); then
echo "You're running bash < v4.0.0. Please upgrade to a newer version." >&2
echo "For help visit https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/docs/developer-setup.md" >&2
exit 1
fi
 
# install asdf dependencies
echo "installing asdf tooling with scripts/install-asdf-plugins.sh..."
./scripts/install-asdf-plugins.sh
# install mise/asdf dependencies
echo "installing required plugins with mise install.."
mise install
 
# pre-commit is optional
if command -v pre-commit &>/dev/null; then
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