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

chore: apply copier template v1.3.0

parent c6a1049f
No related branches found
No related tags found
No related merge requests found
# This project was initially generated with
# https://gitlab.com/gitlab-com/gl-infra/common-template-copier
# See the project for instructions on how to update the project
#
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: v1.3.0
_src_path: https://gitlab.com/gitlab-com/gl-infra/common-template-copier.git
golang: false
initial_codeowners: '@andrewn'
project_name: common-ci-tasks
# This file is used to track the version of copier uses
v1.3.0 # datasource=gitlab-releases depName=gitlab-com/gl-infra/common-template-copier
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
 
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
indent_style = space
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
insert_final_newline = true
trim_trailing_whitespace = true
 
[*.md]
indent_style = unset
Loading
Loading
# DO NOT MANUALLY EDIT; Run ./scripts/update-asdf-version-variables to update this
# DO NOT MANUALLY EDIT; Run ./scripts/update-asdf-version-variables.sh to update this
variables:
GL_ASDF_GOLANG_VERSION: 1.17.11
GL_ASDF_JB_VERSION: 0.4.0
Loading
Loading
# DO NOT MANUALLY EDIT; Run ./scripts/update-asdf-version-variables to update this
# DO NOT MANUALLY EDIT; Run ./scripts/update-asdf-version-variables.sh to update this
variables:
GL_COMMON_CI_TASKS_DEFAULT_ASDF_GOLANG_VERSION: 1.17.11
GL_COMMON_CI_TASKS_DEFAULT_ASDF_JB_VERSION: 0.4.0
Loading
Loading
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
---
# Use exclude to exclude specific files
# exclude: '^fixtures/'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
Loading
Loading
@@ -16,6 +20,11 @@ repos:
args: [--branch, main]
- id: pretty-format-json
args: [--autofix, --no-sort-keys]
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v1.3.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
- repo: local
hooks:
- id: shellcheck
Loading
Loading
@@ -28,3 +37,8 @@ repos:
hooks:
- id: shfmt
args: [-w, -s, -i, "2"]
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.17.0
hooks:
- id: yamllint
args: [-c=.yamllint.yaml]
# See https://yamllint.readthedocs.io/en/stable/configuration.html#extending-the-default-configuration
# for configuration documentation
extends: default
 
rules:
Loading
Loading
LICENSE 0 → 100644
Copyright (c) 2011-2022 GitLab, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
#!/usr/bin/env bash
 
# shellcheck source=/dev/null
source "$ASDF_DIR/asdf.sh"
# This script will install the ASDF plugins required for this project
 
set -euo pipefail
IFS=$'\n\t'
 
plugin_list=$(asdf plugin list || echo "")
 
# shellcheck source=/dev/null
source "$ASDF_DIR/asdf.sh"
install_plugin() {
plugin=$1
if ! echo "$plugin_list" | grep -q "${plugin}" >/dev/null; then
echo "# Installing plugin" "$@"
asdf plugin add "$@" || {
echo "Failed to perform plugin installation: " "$@"
return 1
exit 1
}
fi
 
echo "# Installing ${plugin} version"
asdf install "${plugin}" || {
echo "Failed to perform version installation: ${plugin}"
return 1
exit 1
}
 
# Use this plugin for the rest of the install-asdf-plugins.sh script...
asdf shell "${plugin}" "$(asdf current "${plugin}" | awk '{print $2}')"
}
 
Loading
Loading
#!/usr/bin/env bash
set -euo pipefail
# ---------------------------------------------------------
# This script will prepare your development environment
# while working on this project. Run it after cloning this
# project.
#
# It's recommended that you review
# https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/docs/developer-setup.md
# first.
# ---------------------------------------------------------
cd "$(dirname "${BASH_SOURCE[0]}")/.."
warn() {
echo >&2 -e "${1-}"
echo >&2 -e "Recommended reading: https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/docs/developer-setup.md"
}
# check that asdf is installed
[[ -n ${ASDF_DIR:-} ]] || {
warn "asdf not installed. "
exit 1
}
# install asdf dependencies
echo "installing asdf tooling with scripts/install-asdf-plugins.sh..."
./scripts/install-asdf-plugins.sh
# pre-commit is optional
if command -v pre-commit &>/dev/null; then
echo "running pre-commit install..."
pre-commit install
pre-commit install-hooks
else
warn "pre-commit is not installed. Skipping."
fi
Loading
Loading
@@ -5,13 +5,14 @@
set -euo pipefail
IFS=$'\n\t'
 
cd "$(dirname "${BASH_SOURCE[0]}")/.."
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
export LC_COLLATE=C
 
generate() {
sort .tool-versions |
sort "${ROOT_DIR}/.tool-versions" |
awk '
BEGIN {
print "# DO NOT MANUALLY EDIT; Run ./scripts/update-asdf-version-variables to update this";
print "# DO NOT MANUALLY EDIT; Run ./scripts/update-asdf-version-variables.sh to update this";
print "variables:"
}
{
Loading
Loading
@@ -24,10 +25,10 @@ generate() {
}
 
generate_defaults() {
sort .tool-versions |
sort "${ROOT_DIR}/.tool-versions" |
awk '
BEGIN {
print "# DO NOT MANUALLY EDIT; Run ./scripts/update-asdf-version-variables to update this";
print "# DO NOT MANUALLY EDIT; Run ./scripts/update-asdf-version-variables.sh to update this";
print "variables:"
}
{
Loading
Loading
@@ -39,5 +40,5 @@ generate_defaults() {
'
}
 
generate >".gitlab-ci-asdf-versions.yml"
generate_defaults >".gitlab-ci-default-asdf-versions.yml"
generate >"${ROOT_DIR}/.gitlab-ci-asdf-versions.yml"
generate_defaults >"${ROOT_DIR}/.gitlab-ci-default-asdf-versions.yml"
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