Skip to content

Ci alpine migration for pinningupdating all dependencies #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 27 additions & 12 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,51 @@ 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 "/nasm-x86-shellcode-generator"


rust-base:
FROM +alpine-base
# renovate: datasource=repology depName=alpine_3_20/rust versioning=loose
ENV RUST_VERSION="1.78.0-r0"
RUN apk add --no-cache cargo=$RUST_VERSION


check-clean-git-history:
FROM +rust-base
RUN cargo install clean_git_history --version 0.1.2 --locked
# 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 +rust-base
RUN cargo install conventional_commits_linter --version 0.12.3 --locked
# 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}"


golang-base:
FROM golang:1.20.13
ENV GOPROXY=direct
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
FROM golang:1.22.1
WORKDIR "/nasm-x86-shellcode-generator"


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

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

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

Expand All @@ -73,6 +88,6 @@ COPY_SOURCECODE:


compile:
FROM gcc:13.2.0
FROM +rust-base
DO +COPY_SOURCECODE
RUN ./ci/compile.sh
2 changes: 1 addition & 1 deletion ci/check-clean-git-history.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion ci/check-conventional-commits-linting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 29 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
@@ -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=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s.+_VERSION=\"(?<currentValue>.*?)\"\\s"
]
},
{
"customType": "regex",
"fileMatch": ["^Earthfile$"],
"matchStrings": [
"# renovate: datasource=repology packageName=alpine_(?<currentValue>\\d+[._]\\d+)"
],
"currentValueTemplate": "{{{ replace '_' '.' currentValue }}}",
"datasourceTemplate": "docker",
"depNameTemplate": "alpine",
"versioningTemplate": "regex:^(?<major>\\d+)[._](?<minor>\\d+)$",
"autoReplaceStringTemplate": "# renovate: datasource=repology packageName=alpine_{{{newMajor}}}_{{{newMinor}}}"
}
]
}