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

feat: run mise to validate .tool-versions

Part of https://gitlab.com/gitlab-com/runbooks/-/issues/134, start
validating .tool-versions against mise.
parent 02d3f50f
No related branches found
No related tags found
No related merge requests found
 
# [`asdf-tool-versions`](./asdf-tool-versions.yml)
 
Checks that the `.tool-versions` file is synced with .gitlab-ci-asdf-versions.yml, that all the plugins are declared in `./scripts/install-asdf-plugins.sh` and that ASDF is generally working.
Checks that the `.tool-versions` file is synced with .gitlab-ci-asdf-versions.yml, that all the plugins are declared in `./scripts/install-asdf-plugins.sh` and that ASDF and Mise are generally working.
 
* Default Stages: `validate`
 
Loading
Loading
@@ -21,9 +21,12 @@ include:
 
# Checks that the `.tool-versions` file is synced with .gitlab-ci-asdf-versions.yml,
# that all the plugins are declared in `./scripts/install-asdf-plugins.sh`
# and that ASDF is generally working
# and that asdf and mise are generally working
# see https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/asdf-tool-versions.md
- project: 'gitlab-com/gl-infra/common-ci-tasks'
ref: v2.13.0 # renovate:managed
file: asdf-tool-versions.yml
```
Note that during the [Infrastructure group migration from asdf to mise](https://gitlab.com/gitlab-com/runbooks/-/issues/134), two jobs are executed,
one for `asdf`: `validate_asdf_tool_versions` and a second job for `mise`: `validate_mise_tool_versions`.
Loading
Loading
@@ -53,3 +53,49 @@ validate_asdf_tool_versions:
max: 2
when:
- runner_system_failure
validate_mise_tool_versions:
stage: $[[ inputs.stage ]]
image:
name: registry.gitlab.com/gitlab-com/gl-infra/common-ci-tasks/mise:v2.13.0
entrypoint: [""]
needs: []
script:
# Handle the VALIDATE_ASDF_TOOL_VERSIONS_DEPLOY_KEY_FILE token if it exists...
# Note: This script is identical to the one in renovate-bot.yml
- if [[ -n "${VALIDATE_ASDF_TOOL_VERSIONS_DEPLOY_KEY_FILE}" ]]; then
eval $(ssh-agent -s);
chmod 0600 "$VALIDATE_ASDF_TOOL_VERSIONS_DEPLOY_KEY_FILE";
ssh-add "$VALIDATE_ASDF_TOOL_VERSIONS_DEPLOY_KEY_FILE";
mkdir -p ~/.ssh;
chmod 700 ~/.ssh;
ssh-keyscan gitlab.com >> ~/.ssh/known_hosts;
ssh -T git@gitlab.com || true;
fi
- ./scripts/install-asdf-plugins.sh
- ./scripts/update-asdf-version-variables.sh
- git diff --exit-code
after_script: |
cat <<-EOD
----------------------------------------------------------
Need help? Documentation on the validate_mise_tool_versions CI job can be found at:
https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/asdf-tool-versions.md
EOD
rules:
# This script can be quite slow (mostly due to the ruby install)
# so we only run it when there have been changes
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "schedule")'
changes:
- scripts/install-asdf-plugins.sh
- scripts/update-asdf-version-variables.sh
- go.mod
- .tool-versions
- .ruby-version
- .gitlab-ci-asdf-versions.yml
- .mise.toml
# Automatically retry on any system blips
retry:
max: 2
when:
- runner_system_failure
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