Skip to content

Commit aef91e0

Browse files
committed
ci: Alpine migration for pinning/updating all dependencies
1 parent 55efcea commit aef91e0

File tree

4 files changed

+67
-23
lines changed

4 files changed

+67
-23
lines changed

Earthfile

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,36 @@ COPY_METADATA:
1212
COPY --dir ".git/" "./"
1313

1414

15-
rust-base:
16-
FROM rust:1.70.0
15+
alpine-base:
16+
FROM alpine:3.20.3@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a
17+
# renovate: datasource=repology depName=alpine_3_20/bash versioning=loose
18+
ENV BASH_VERSION="5.2.26-r0"
19+
RUN apk add --no-cache bash=$BASH_VERSION
1720
WORKDIR "/monkey_interpreter"
1821

1922

23+
rust-base:
24+
FROM +alpine-base
25+
# renovate: datasource=repology depName=alpine_3_20/rust versioning=loose
26+
ENV RUST_VERSION="1.78.0-r0"
27+
RUN apk add --no-cache cargo=$RUST_VERSION
28+
29+
2030
check-clean-git-history:
2131
FROM +rust-base
22-
RUN cargo install clean_git_history --version 0.1.2 --locked
32+
# renovate: datasource=github-releases depName=DeveloperC286/clean_git_history
33+
ENV CLEAN_GIT_HISTORY_VERSION="v0.2.0"
34+
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
2335
DO +COPY_METADATA
2436
ARG from_reference="origin/HEAD"
2537
RUN ./ci/check-clean-git-history.sh --from-reference "${from_reference}"
2638

2739

2840
check-conventional-commits-linting:
2941
FROM +rust-base
30-
RUN cargo install conventional_commits_linter --version 0.12.3 --locked
42+
# renovate: datasource=github-releases depName=DeveloperC286/conventional_commits_linter
43+
ENV CONVENTIONAL_COMMITS_LINTER_VERSION="v0.13.0"
44+
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
3145
DO +COPY_METADATA
3246
ARG from_reference="origin/HEAD"
3347
RUN ./ci/check-conventional-commits-linting.sh --from-reference "${from_reference}"
@@ -36,12 +50,13 @@ check-conventional-commits-linting:
3650
COPY_SOURCECODE:
3751
COMMAND
3852
DO +COPY_CI_DATA
39-
COPY --dir "Cargo.lock" "Cargo.toml" "src/" "./"
53+
COPY --if-exists "Cargo.lock" "./"
54+
COPY --dir "Cargo.toml" "src/" "./"
4055

4156

4257
rust-formatting-base:
4358
FROM +rust-base
44-
RUN rustup component add rustfmt
59+
RUN apk add --no-cache rustfmt=$RUST_VERSION
4560
DO +COPY_SOURCECODE
4661

4762

@@ -51,13 +66,15 @@ check-rust-formatting:
5166

5267

5368
golang-base:
54-
FROM golang:1.20.13
69+
FROM golang:1.22.1
5570
WORKDIR "/monkey_interpreter"
5671

5772

5873
shell-formatting-base:
5974
FROM +golang-base
60-
RUN go install mvdan.cc/sh/v3/cmd/[email protected]
75+
# renovate: datasource=github-releases depName=mvdan/sh
76+
ENV SHFMT_VERSION="v3.7.0"
77+
RUN go install mvdan.cc/sh/v3/cmd/shfmt@$SHFMT_VERSION
6178
DO +COPY_CI_DATA
6279

6380

@@ -68,7 +85,9 @@ check-shell-formatting:
6885

6986
yaml-formatting-base:
7087
FROM +golang-base
71-
RUN go install github.com/google/yamlfmt/cmd/[email protected]
88+
# renovate: datasource=github-releases depName=google/yamlfmt
89+
ENV YAMLFMT_VERSION="v0.10.0"
90+
RUN go install github.com/google/yamlfmt/cmd/yamlfmt@$YAMLFMT_VERSION
7291
COPY ".yamlfmt" "./"
7392
DO +COPY_CI_DATA
7493

@@ -110,28 +129,25 @@ fix-formatting:
110129

111130
check-rust-linting:
112131
FROM +rust-base
113-
RUN rustup component add clippy
132+
RUN apk add --no-cache rust-clippy=$RUST_VERSION
114133
DO +COPY_SOURCECODE
115134
RUN ./ci/check-rust-linting.sh
116135

117136

118-
ubuntu-base:
119-
FROM ubuntu:22.04
120-
# https://askubuntu.com/questions/462690/what-does-apt-get-fix-missing-do-and-when-is-it-useful
121-
RUN apt-get update --fix-missing
122-
WORKDIR "/monkey_interpreter"
123-
124-
125137
check-shell-linting:
126-
FROM +ubuntu-base
127-
RUN apt-get install shellcheck -y
138+
FROM +alpine-base
139+
# renovate: datasource=repology depName=alpine_3_20/shellcheck versioning=loose
140+
ENV SHELLCHECK_VERSION="0.10.0-r1"
141+
RUN apk add --no-cache shellcheck=$SHELLCHECK_VERSION
128142
DO +COPY_CI_DATA
129143
RUN ./ci/check-shell-linting.sh
130144

131145

132146
check-github-actions-workflows-linting:
133147
FROM +golang-base
134-
RUN go install github.com/rhysd/actionlint/cmd/[email protected]
148+
# renovate: datasource=github-releases depName=rhysd/actionlint
149+
ENV ACTIONLINT_VERSION="v1.6.26"
150+
RUN go install github.com/rhysd/actionlint/cmd/actionlint@$ACTIONLINT_VERSION
135151
DO +COPY_CI_DATA
136152
RUN ./ci/check-github-actions-workflows-linting.sh
137153

ci/check-clean-git-history.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ parse_commandline "$@"
5757
set -o errexit
5858
set -o xtrace
5959

60-
"${CARGO_HOME}/bin/clean_git_history" --from-reference "${_arg_from_reference}"
60+
clean_git_history --from-reference "${_arg_from_reference}"
6161
# ] <-- needed because of Argbash

ci/check-conventional-commits-linting.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ parse_commandline "$@"
5757
set -o errexit
5858
set -o xtrace
5959

60-
"${CARGO_HOME}/bin/conventional_commits_linter" --from-reference "${_arg_from_reference}" --allow-angular-type-only
60+
conventional_commits_linter --from-reference "${_arg_from_reference}" --allow-angular-type-only
6161
# ] <-- needed because of Argbash

renovate.json

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,34 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": [
4-
"config:recommended"
4+
"config:best-practices"
5+
],
6+
"dockerfile": {
7+
"fileMatch": [
8+
"(^|/)Earthfile$",
9+
"(^|/|\\.)Dockerfile$",
10+
"(^|/)Dockerfile[^/]*$"
11+
]
12+
},
13+
"customManagers": [
14+
{
15+
"customType": "regex",
16+
"fileMatch": ["^Earthfile$"],
17+
"matchStrings": [
18+
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s.+_VERSION=\"(?<currentValue>.*?)\"\\s"
19+
]
20+
},
21+
{
22+
"customType": "regex",
23+
"fileMatch": ["^Earthfile$"],
24+
"matchStrings": [
25+
"# renovate: datasource=repology packageName=alpine_(?<currentValue>\\d+[._]\\d+)"
26+
],
27+
"currentValueTemplate": "{{{ replace '_' '.' currentValue }}}",
28+
"datasourceTemplate": "docker",
29+
"depNameTemplate": "alpine",
30+
"versioningTemplate": "regex:^(?<major>\\d+)[._](?<minor>\\d+)$",
31+
"autoReplaceStringTemplate": "# renovate: datasource=repology packageName=alpine_{{{newMajor}}}_{{{newMinor}}}"
32+
}
533
]
634
}

0 commit comments

Comments
 (0)