diff --git a/Earthfile b/Earthfile index adf42d7..8fa0cce 100644 --- a/Earthfile +++ b/Earthfile @@ -12,19 +12,34 @@ COPY_METADATA: COPY --dir ".git/" "./" -rust-base: - FROM rust:1.70.0 +alpine-base: + FROM alpine:3.20.3@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a + # renovate: datasource=repology depName=alpine_3_20/bash versioning=loose + ENV BASH_VERSION="5.2.26-r0" + RUN apk add --no-cache bash=$BASH_VERSION WORKDIR "/zsh-simple-abbreviations" check-clean-git-history: - FROM +rust-base - RUN cargo install clean_git_history --version 0.1.2 --locked + FROM +alpine-base + # renovate: datasource=github-releases depName=DeveloperC286/clean_git_history + ENV CLEAN_GIT_HISTORY_VERSION="v0.2.0" + RUN wget -O - "https://github.com/DeveloperC286/clean_git_history/releases/download/${CLEAN_GIT_HISTORY_VERSION}/x86_64-unknown-linux-musl.gz" | gzip -d > /usr/bin/clean_git_history && chmod 755 /usr/bin/clean_git_history DO +COPY_METADATA ARG from_reference="origin/HEAD" RUN ./ci/check-clean-git-history.sh --from-reference "${from_reference}" +check-conventional-commits-linting: + FROM +alpine-base + # renovate: datasource=github-releases depName=DeveloperC286/conventional_commits_linter + ENV CONVENTIONAL_COMMITS_LINTER_VERSION="v0.13.0" + RUN wget -O - "https://github.com/DeveloperC286/conventional_commits_linter/releases/download/${CONVENTIONAL_COMMITS_LINTER_VERSION}/x86_64-unknown-linux-musl.gz" | gzip -d > /usr/bin/conventional_commits_linter && chmod 755 /usr/bin/conventional_commits_linter + DO +COPY_METADATA + ARG from_reference="origin/HEAD" + RUN ./ci/check-conventional-commits-linting.sh --from-reference "${from_reference}" + + COPY_SOURCECODE: COMMAND DO +COPY_CI_DATA @@ -32,18 +47,16 @@ COPY_SOURCECODE: golang-base: - FROM golang:1.20.13 - ENV GOPROXY=direct - ENV CGO_ENABLED=0 - ENV GOOS=linux - ENV GOARCH=amd64 - WORKDIR "/zsh-simple-abbreviations" + FROM golang:1.22.1 + WORKDIR "/consistent_whitespace" shell-formatting-base: FROM +golang-base - RUN go install mvdan.cc/sh/v3/cmd/shfmt@v3.7.0 - DO +COPY_SOURCECODE + # renovate: datasource=github-releases depName=mvdan/sh + ENV SHFMT_VERSION="v3.7.0" + RUN go install mvdan.cc/sh/v3/cmd/shfmt@$SHFMT_VERSION + DO +COPY_CI_DATA check-shell-formatting: @@ -53,7 +66,9 @@ check-shell-formatting: yaml-formatting-base: FROM +golang-base - RUN go install github.com/google/yamlfmt/cmd/yamlfmt@v0.10.0 + # renovate: datasource=github-releases depName=google/yamlfmt + ENV YAMLFMT_VERSION="v0.10.0" + RUN go install github.com/google/yamlfmt/cmd/yamlfmt@$YAMLFMT_VERSION COPY ".yamlfmt" "./" DO +COPY_CI_DATA @@ -88,30 +103,29 @@ fix-formatting: check-shell-linting: - FROM ubuntu:22.04 - # https://askubuntu.com/questions/462690/what-does-apt-get-fix-missing-do-and-when-is-it-useful - RUN apt-get update --fix-missing - RUN apt-get install shellcheck -y - WORKDIR "/zsh-simple-abbreviations" - DO +COPY_SOURCECODE + FROM +alpine-base + # renovate: datasource=repology depName=alpine_3_20/shellcheck versioning=loose + ENV SHELLCHECK_VERSION="0.10.0-r1" + RUN apk add --no-cache shellcheck=$SHELLCHECK_VERSION + DO +COPY_CI_DATA RUN ./ci/check-shell-linting.sh -check-conventional-commits-linting: - FROM +rust-base - RUN cargo install conventional_commits_linter --version 0.12.3 --locked - DO +COPY_METADATA - ARG from_reference="origin/HEAD" - RUN ./ci/check-conventional-commits-linting.sh --from-reference "${from_reference}" - - check-github-actions-workflows-linting: FROM +golang-base - RUN go install github.com/rhysd/actionlint/cmd/actionlint@v1.6.26 + # renovate: datasource=github-releases depName=rhysd/actionlint + ENV ACTIONLINT_VERSION="v1.6.26" + RUN go install github.com/rhysd/actionlint/cmd/actionlint@$ACTIONLINT_VERSION DO +COPY_CI_DATA RUN ./ci/check-github-actions-workflows-linting.sh +check-linting: + BUILD +check-shell-linting + BUILD +check-github-actions-workflows-linting + + + e2e-test: BUILD +abbreviation-finding-ignores-arguments-e2e-test BUILD +abbreviation-finding-ignores-environment-variables-e2e-test diff --git a/ci/check-clean-git-history.sh b/ci/check-clean-git-history.sh index 4ca75fb..a30f0ba 100755 --- a/ci/check-clean-git-history.sh +++ b/ci/check-clean-git-history.sh @@ -57,5 +57,5 @@ parse_commandline "$@" set -o errexit set -o xtrace -"${CARGO_HOME}/bin/clean_git_history" --from-reference "${_arg_from_reference}" +clean_git_history --from-reference "${_arg_from_reference}" # ] <-- needed because of Argbash diff --git a/ci/check-conventional-commits-linting.sh b/ci/check-conventional-commits-linting.sh index c028a35..ea292ed 100755 --- a/ci/check-conventional-commits-linting.sh +++ b/ci/check-conventional-commits-linting.sh @@ -57,5 +57,5 @@ parse_commandline "$@" set -o errexit set -o xtrace -"${CARGO_HOME}/bin/conventional_commits_linter" --from-reference "${_arg_from_reference}" --allow-angular-type-only +conventional_commits_linter --from-reference "${_arg_from_reference}" --allow-angular-type-only # ] <-- needed because of Argbash diff --git a/renovate.json b/renovate.json index 5db72dd..6ba7a6d 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,34 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ - "config:recommended" + "config:best-practices" + ], + "dockerfile": { + "fileMatch": [ + "(^|/)Earthfile$", + "(^|/|\\.)Dockerfile$", + "(^|/)Dockerfile[^/]*$" + ] + }, + "customManagers": [ + { + "customType": "regex", + "fileMatch": ["^Earthfile$"], + "matchStrings": [ + "# renovate: datasource=(?.*?) depName=(?.*?)( versioning=(?.*?))?\\s.+_VERSION=\"(?.*?)\"\\s" + ] + }, + { + "customType": "regex", + "fileMatch": ["^Earthfile$"], + "matchStrings": [ + "# renovate: datasource=repology packageName=alpine_(?\\d+[._]\\d+)" + ], + "currentValueTemplate": "{{{ replace '_' '.' currentValue }}}", + "datasourceTemplate": "docker", + "depNameTemplate": "alpine", + "versioningTemplate": "regex:^(?\\d+)[._](?\\d+)$", + "autoReplaceStringTemplate": "# renovate: datasource=repology packageName=alpine_{{{newMajor}}}_{{{newMinor}}}" + } ] }