Skip to content
Snippets Groups Projects
Unverified Commit 3996b18a authored by Andrew Newdigate's avatar Andrew Newdigate
Browse files

chore: update copier template

Updated to latest copier template to avoid pitfalls.
parent dc8e43a0
No related branches found
No related tags found
No related merge requests found
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.13.0
_commit: v1.14.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.13.0 # datasource=gitlab-releases depName=gitlab-com/gl-infra/common-template-copier
v1.14.0 # datasource=gitlab-releases depName=gitlab-com/gl-infra/common-template-copier
#!/usr/bin/env bash
# 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
 
Loading
Loading
@@ -59,8 +61,20 @@ setup_mise() {
trap 'do_mise_install' EXIT
 
do_mise_install() {
cat "$temp_MISE_SHORTHANDS_FILE"
MISE_SHORTHANDS_FILE=$temp_MISE_SHORTHANDS_FILE $MISE_COMMAND 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"
}
 
Loading
Loading
@@ -91,6 +105,23 @@ setup_mise() {
}
}
 
# 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
Loading
Loading
#!/usr/bin/env bash
# Vendored from https://gitlab.com/gitlab-com/gl-infra/common-template-copier
# Consider contributing upstream when updating this file
 
set -euo pipefail
 
Loading
Loading
#!/usr/bin/env bash
# Vendored from https://gitlab.com/gitlab-com/gl-infra/common-template-copier
# Consider contributing upstream when updating this file
 
# See the README.md for details of how this script works
 
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