Skip to content
Snippets Groups Projects
Verified Commit b015fb2e authored by Sheogorath's avatar Sheogorath :european_castle:
Browse files

Switch to earthly

parent f84e2eae
Branches ci/earthly
No related tags found
No related merge requests found
Pipeline #18111 passed
include:
- project: 'container-library/build-ah-engine'
ref: 2.1.4
file: '/gitlab-ci-template.yml'
- project: 'shivering-isles/infrastructure-gitops'
ref: main
file: '/images/.utils/gitlab-earthly.yaml'
variables:
CI_CONTAINER_BUILD_ARCHS: "amd64"
container-tagging:
before_script:
- podman login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- export BUILD_DATE="$(date --rfc-3339 ns)"
- export CI_REGISTRY_IMAGE_VERSION=$(grep 'ARG DNSPROXY_VERSION=' Dockerfile | sed -e 's/^ARG DNSPROXY_VERSION=v//g')
build:
extends: .earthly
script:
- |
if [ -n "$CI_OCI_CACHE" ]; then
export ARGS="${ARGS} --remote-cache=$CI_OCI_CACHE"
fi
- |
if [ $CI_COMMIT_BRANCH = $CI_DEFAULT_BRANCH ]; then
export BUILD_ARGS="${BUILD_ARGS} --latest=true"
else
export BUILD_ARGS="${BUILD_ARGS} --tag=$CI_COMMIT_REF_SLUG --latest=false"
fi
- earthly --ci --allow-privileged --push ${ARGS} +container --registry=${CI_REGISTRY_IMAGE} ${BUILD_ARGS}
FROM docker.io/library/golang:1.21.0 as build-env
# renovate: datasource=git-tags depName=https://git.shivering-isles.com/github-mirror/AdguardTeam/dnsproxy.git
ARG DNSPROXY_VERSION=v0.54.0
ENV DNSPROXY_VERSION=${DNSPROXY_VERSION}
ENV CGO_ENABLED=0
RUN true \
&& git clone https://git.shivering-isles.com/github-mirror/AdguardTeam/dnsproxy.git --depth 1 -b "$DNSPROXY_VERSION" \
&& cd dnsproxy \
&& go build -mod=vendor
FROM gcr.io/distroless/static
COPY --from=build-env /go/dnsproxy/dnsproxy /
CMD ["/dnsproxy"]
VERSION 0.7
# build creates a binary release of dnsproxy
build:
FROM git.shivering-isles.com/shivering-isles/infrastructure-gitops/images/mirror+golang
WORKDIR /go-workdir
ARG DNSPROXY_VERSION
ENV CGO_ENABLED=0
GIT CLONE --keep-ts --branch "${DNSPROXY_VERSION}" https://git.shivering-isles.com/github-mirror/AdguardTeam/dnsproxy.git ./
RUN go build -mod=vendor
SAVE ARTIFACT ./dnsproxy AS LOCAL local-output/dnsproxy
container-internal:
FROM git.shivering-isles.com/shivering-isles/infrastructure-gitops/images/mirror+distroless-static
# renovate: datasource=git-tags depName=https://git.shivering-isles.com/github-mirror/AdguardTeam/dnsproxy.git
ARG DNSPROXY_VERSION
ENV DNSPROXY_VERSION=${DNSPROXY_VERSION}
COPY (+build/dnsproxy --DNSPROXY_VERSION=${DNSPROXY_VERSION}) /dnsproxy
CMD ["/dnsproxy"]
# container builds the dnsproxy container
container:
FROM git.shivering-isles.com/shivering-isles/infrastructure-gitops/images/mirror+golang
# renovate: datasource=git-tags depName=https://git.shivering-isles.com/github-mirror/AdguardTeam/dnsproxy.git
ARG DNSPROXY_VERSION=v0.54.0
ARG registry=quay.io/shivering-isles/dnsproxy
ARG tag=${DNSPROXY_VERSION}
ARG latest=false
IF [ $latest = "true" ]
FROM +container-internal --DNSPROXY_VERSION=${DNSPROXY_VERSION}
SAVE IMAGE --push ${registry}:latest
END
FROM +container-internal --DNSPROXY_VERSION=${DNSPROXY_VERSION}
SAVE IMAGE --push ${registry}:${tag}
{
"extends": [
"config:base",
"regexManagers:dockerfileVersions"
"config:base"
],
"regexManager": [
{
"fileMatch": ["Dockerfile$","Earthfile$"],
"matchStrings": [
"#\\s*renovate:\\s*datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\sENV .*?_VERSION=\"(?<currentValue>.*)\"\\s"
],
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
}
],
"prConcurrentLimit": 5,
"automerge": true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment