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

feat: use new renovate image for renovate and asdf jobs

parent 7fd6a4e6
No related branches found
No related tags found
No related merge requests found
Pipeline #13651736 passed
validate_asdf_tool_versions:
stage: validate
image: "ubuntu:21.04"
image:
name: registry.gitlab.com/gitlab-com/gl-infra/common-ci-tasks/renovate:v1.21.1
entrypoint: [""]
needs: []
variables:
ASDF_DIR: /asdf
script:
# Some dependencies from https://github.com/pyenv/pyenv/wiki#suggested-build-environment
- apt-get update && apt-get install -y
jq curl git bash build-essential libssl-dev zlib1g-dev
libbz2-dev libreadline-dev libsqlite3-dev wget unzip
ca-certificates openssh-client
# Handle the VALIDATE_ASDF_TOOL_VERSIONS_DEPLOY_KEY_FILE token if it exists...
- if [[ -n "${VALIDATE_ASDF_TOOL_VERSIONS_DEPLOY_KEY_FILE}" ]]; then
eval $(ssh-agent -s);
Loading
Loading
@@ -20,7 +17,6 @@ validate_asdf_tool_versions:
ssh-keyscan gitlab.com >> ~/.ssh/known_hosts;
fi
- if [[ -n "${GL_ASDF_LEGACY_VERSIONS_FILE}" ]]; then echo "legacy_version_file = yes" >> ~/.asdfrc; fi
- git clone https://github.com/asdf-vm/asdf.git "${ASDF_DIR}"
- source "${ASDF_DIR}/asdf.sh"
- ./scripts/install-asdf-plugins.sh
- ./scripts/update-asdf-version-variables.sh
Loading
Loading
 
renovate_bot:
image: node:16-alpine
image:
name: registry.gitlab.com/gitlab-com/gl-infra/common-ci-tasks/renovate:v1.21.1
entrypoint: [""]
stage: renovate_bot
variables:
RENOVATE_ENDPOINT: "${CI_API_V4_URL}"
Loading
Loading
@@ -9,9 +11,6 @@ renovate_bot:
GIT_STRATEGY: none # renovate will run it's own clone
LOG_LEVEL: debug
needs: []
before_script:
- apk add --no-cache git go
- npm install -g renovate
script:
- renovate --token "${RENOVATE_GITLAB_TOKEN}"
--platform gitlab
Loading
Loading
@@ -20,9 +19,17 @@ renovate_bot:
${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}
rules:
# Run after changes to the main branch in case dependencies have changed
# In the case that RENOVATE_IGNORE_SCHEDULE, add some flags
- if: '($RENOVATE_SCHEDULED || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH) && $RENOVATE_IGNORE_SCHEDULE'
exists:
- renovate.json
variables:
EXTRA_RENOVATE_FLAGS: '--update-not-scheduled true --schedule "any time"'
- if: '$RENOVATE_SCHEDULED || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
exists:
- renovate.json
cache:
key: renovate-cache
paths:
Loading
Loading
Loading
Loading
@@ -27,37 +27,7 @@ install_plugin() {
asdf shell "${plugin}" "$(asdf current "${plugin}" | awk '{print $2}')"
}
 
check_global_golang_install() {
(
pushd /
asdf current golang
popd
) >/dev/null 2>/dev/null
}
# Install golang first as some of the other plugins require it
install_plugin golang
if [[ -z ${CI:-} ]]; then
# The go-jsonnet plugin requires a global golang version to be configured
# and will otherwise fail to install
#
# This check is not neccessary in CI
GOLANG_VERSION=$(asdf current golang | awk '{print $2}')
if ! check_global_golang_install; then
cat <<-EOF
---------------------------------------------------------------------------------------
The go-jsonnet plugin requires a global golang version to be configured.$
Suggestion: run this command to set this up: 'asdf global golang ${GOLANG_VERSION}'
Then rerun this command.
Note: you can undo this change after running this command by editing ~/.tool-versions
---------------------------------------------------------------------------------------
EOF
exit 1
fi
fi
install_plugin shellcheck
install_plugin shfmt
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