diff options
| author | Xe Iaso <me@xeiaso.net> | 2025-01-19 12:56:59 -0500 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2025-01-19 12:56:59 -0500 |
| commit | 55045aedfe14c25c67136dbb58b64726806799fd (patch) | |
| tree | e64e4ce51c1e8a2d46c817d04ff5ea0a40d3ca91 | |
| parent | 090ef2fdad7032b09b02e4ffcaeeb4b64d174411 (diff) | |
| download | x-55045aedfe14c25c67136dbb58b64726806799fd.tar.xz x-55045aedfe14c25c67136dbb58b64726806799fd.zip | |
Earthfile: embed the version in CI
Signed-off-by: Xe Iaso <me@xeiaso.net>
| -rw-r--r-- | .github/workflows/earthly.yml | 4 | ||||
| -rw-r--r-- | Earthfile | 44 | ||||
| -rw-r--r-- | cmd/anubis/main.go | 3 |
3 files changed, 27 insertions, 24 deletions
diff --git a/.github/workflows/earthly.yml b/.github/workflows/earthly.yml index 5ca54d8..2768fbd 100644 --- a/.github/workflows/earthly.yml +++ b/.github/workflows/earthly.yml @@ -40,9 +40,9 @@ jobs: if: github.event_name != 'pull_request' id: build-and-push run: | - earthly --org me-2625 --sat alpha --ci --push +all + earthly --org me-2625 --sat alpha --ci --push +all --VERSION=$(git describe --tags) - name: Build Docker image if: github.event_name == 'pull_request' id: build run: | - earthly --org me-2625 --sat alpha --ci +all
\ No newline at end of file + earthly --org me-2625 --sat alpha --ci +all --VERSION=$(git describe --tags)
\ No newline at end of file @@ -26,9 +26,11 @@ deps: everything: FROM +deps + ARG VERSION=no-version-error + COPY . . RUN mkdir -p bin - RUN --mount=type=cache,target=/root/.cache sh -c 'GOBIN=$(pwd)/bin go install -ldflags="-X within.website/x.Version=$(git describe --tags)" ./...' + RUN --mount=type=cache,target=/root/.cache GOBIN=$(pwd)/bin go install -ldflags="-X within.website/x.Version=${VERSION}" ./... SAVE ARTIFACT bin @@ -259,23 +261,23 @@ xedn: SAVE IMAGE --push registry.fly.io/xedn:latest all: - BUILD --platform=linux/amd64 +aerial - BUILD --platform=linux/amd64 +amano - BUILD --platform=linux/amd64 +anubis - BUILD --platform=linux/amd64 +aura - BUILD --platform=linux/amd64 +future-sight - BUILD --platform=linux/amd64 +hdrwtch - BUILD --platform=linux/amd64 +hlang - BUILD --platform=linux/amd64 +mi - BUILD --platform=linux/amd64 +mimi - BUILD --platform=linux/amd64 +relayd - BUILD --platform=linux/amd64 +sapientwindex - BUILD --platform=linux/amd64 +stealthmountain - BUILD --platform=linux/amd64 +stickers - BUILD --platform=linux/amd64 +todayinmarch2020 - BUILD --platform=linux/amd64 +uncle-ted - BUILD --platform=linux/amd64 +within-website - BUILD --platform=linux/amd64 +xedn - - BUILD --platform=linux/amd64 ./kube/alrest/staticsites/caddy1+all - BUILD --platform=linux/amd64 ./migroserbices/falin+run
\ No newline at end of file + BUILD --pass-args --platform=linux/amd64 +aerial + BUILD --pass-args --platform=linux/amd64 +amano + BUILD --pass-args --platform=linux/amd64 +anubis + BUILD --pass-args --platform=linux/amd64 +aura + BUILD --pass-args --platform=linux/amd64 +future-sight + BUILD --pass-args --platform=linux/amd64 +hdrwtch + BUILD --pass-args --platform=linux/amd64 +hlang + BUILD --pass-args --platform=linux/amd64 +mi + BUILD --pass-args --platform=linux/amd64 +mimi + BUILD --pass-args --platform=linux/amd64 +relayd + BUILD --pass-args --platform=linux/amd64 +sapientwindex + BUILD --pass-args --platform=linux/amd64 +stealthmountain + BUILD --pass-args --platform=linux/amd64 +stickers + BUILD --pass-args --platform=linux/amd64 +todayinmarch2020 + BUILD --pass-args --platform=linux/amd64 +uncle-ted + BUILD --pass-args --platform=linux/amd64 +within-website + BUILD --pass-args --platform=linux/amd64 +xedn + + BUILD --pass-args --platform=linux/amd64 ./kube/alrest/staticsites/caddy1+all + BUILD --pass-args --platform=linux/amd64 ./migroserbices/falin+run
\ No newline at end of file diff --git a/cmd/anubis/main.go b/cmd/anubis/main.go index 7d58e07..bda4892 100644 --- a/cmd/anubis/main.go +++ b/cmd/anubis/main.go @@ -26,6 +26,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promhttp" + "within.website/x" "within.website/x/internal" "within.website/x/xess" ) @@ -107,7 +108,7 @@ func main() { mux.HandleFunc("/", s.maybeReverseProxy) - slog.Info("listening", "url", "http://localhost"+*bind, "difficulty", *challengeDifficulty, "serveRobotsTXT", *robotsTxt, "target", *target) + slog.Info("listening", "url", "http://localhost"+*bind, "difficulty", *challengeDifficulty, "serveRobotsTXT", *robotsTxt, "target", *target, "version", x.Version) log.Fatal(http.ListenAndServe(*bind, mux)) } |
