Skip to content

Commit 0766748

Browse files
ci: Alpine migration for pinning/updating all dependencies (#26)
1 parent de5d2e3 commit 0766748

File tree

4 files changed

+58
-15
lines changed

4 files changed

+58
-15
lines changed

Earthfile

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,51 @@ 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 "/nasm-x86-shellcode-generator"
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}"
3448

3549

3650
golang-base:
37-
FROM golang:1.20.13
38-
ENV GOPROXY=direct
39-
ENV CGO_ENABLED=0
40-
ENV GOOS=linux
41-
ENV GOARCH=amd64
51+
FROM golang:1.22.1
52+
WORKDIR "/nasm-x86-shellcode-generator"
4253

4354

4455
yaml-formatting-base:
4556
FROM +golang-base
46-
RUN go install github.com/google/yamlfmt/cmd/yamlfmt@v0.10.0
57+
# renovate: datasource=github-releases depName=google/yamlfmt
58+
ENV YAMLFMT_VERSION="v0.10.0"
59+
RUN go install github.com/google/yamlfmt/cmd/yamlfmt@$YAMLFMT_VERSION
4760
COPY ".yamlfmt" "./"
4861
DO +COPY_CI_DATA
4962

@@ -61,7 +74,9 @@ fix-yaml-formatting:
6174

6275
check-github-actions-workflows-linting:
6376
FROM +golang-base
64-
RUN go install github.com/rhysd/actionlint/cmd/actionlint@v1.6.26
77+
# renovate: datasource=github-releases depName=rhysd/actionlint
78+
ENV ACTIONLINT_VERSION="v1.6.26"
79+
RUN go install github.com/rhysd/actionlint/cmd/actionlint@$ACTIONLINT_VERSION
6580
DO +COPY_CI_DATA
6681
RUN ./ci/check-github-actions-workflows-linting.sh
6782

@@ -73,6 +88,6 @@ COPY_SOURCECODE:
7388

7489

7590
compile:
76-
FROM gcc:13.2.0
91+
FROM +rust-base
7792
DO +COPY_SOURCECODE
7893
RUN ./ci/compile.sh

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)