Compare commits

...

3 Commits

Author SHA1 Message Date
Tom Alexander
3f2bdda8cb
Add support for new fields in payload. 2025-02-08 21:11:23 -05:00
Tom Alexander
e7eeeefa53
Add back in docker targets. 2024-10-20 23:12:52 -04:00
Tom Alexander
a17f6502c0
Use linked copy. 2024-10-20 23:03:40 -04:00
8 changed files with 17 additions and 3 deletions

@ -146,6 +146,8 @@ spec:
value: $(params.path-to-dockerfile) value: $(params.path-to-dockerfile)
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- "--opt"
- "target=$(params.target-name)"
- --import-cache - --import-cache
- "type=registry,ref=$(params.image-name):buildcache" - "type=registry,ref=$(params.image-name):buildcache"
- --export-cache - --export-cache

@ -114,6 +114,8 @@ spec:
value: $(params.path-to-dockerfile) value: $(params.path-to-dockerfile)
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- "--opt"
- "target=$(params.target-name)"
- --import-cache - --import-cache
- "type=registry,ref=$(params.image-name):buildcache" - "type=registry,ref=$(params.image-name):buildcache"
- --export-cache - --export-cache

@ -114,6 +114,8 @@ spec:
value: $(params.path-to-dockerfile) value: $(params.path-to-dockerfile)
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- "--opt"
- "target=$(params.target-name)"
- --import-cache - --import-cache
- "type=registry,ref=$(params.image-name):buildcache" - "type=registry,ref=$(params.image-name):buildcache"
- --export-cache - --export-cache

@ -114,6 +114,8 @@ spec:
value: $(params.path-to-dockerfile) value: $(params.path-to-dockerfile)
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- "--opt"
- "target=$(params.target-name)"
- --import-cache - --import-cache
- "type=registry,ref=$(params.image-name):buildcache" - "type=registry,ref=$(params.image-name):buildcache"
- --export-cache - --export-cache

@ -7,12 +7,12 @@ RUN apk add --no-cache musl-dev pkgconfig libressl-dev
RUN mkdir /source RUN mkdir /source
WORKDIR /source WORKDIR /source
COPY . . COPY --link . .
# TODO: Add static build, which currently errors due to proc_macro. RUSTFLAGS="-C target-feature=+crt-static" # TODO: Add static build, which currently errors due to proc_macro. RUSTFLAGS="-C target-feature=+crt-static"
RUN --mount=type=tmpfs,target=/tmp --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked CARGO_TARGET_DIR=/target cargo build --profile release-lto --bin webhook_bridge RUN --mount=type=tmpfs,target=/tmp --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked CARGO_TARGET_DIR=/target cargo build --profile release-lto --bin webhook_bridge
FROM alpine:$ALPINE_VERSION AS runner FROM alpine:$ALPINE_VERSION AS runner
COPY --from=builder /target/release-lto/webhook_bridge /usr/bin/ COPY --link --from=builder /target/release-lto/webhook_bridge /usr/bin/
ENTRYPOINT ["/usr/bin/webhook_bridge"] ENTRYPOINT ["/usr/bin/webhook_bridge"]

@ -4,4 +4,4 @@ set -euo pipefail
IFS=$'\n\t' IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
RUST_LOG=webhook_bridge=DEBUG WEBHOOK_BRIDGE_API_ROOT="https://code.fizz.buzz/api" WEBHOOK_BRIDGE_HMAC_SECRET=$(cat /bridge/git/mrmanager/k8s/webhook-bridge/secrets/webhook-bridge/webhook-bridge/HMAC_TOKEN) WEBHOOK_BRIDGE_OAUTH_TOKEN=$(cat /bridge/git/mrmanager/k8s/webhook-bridge/secrets/webhook-bridge/webhook-bridge/OAUTH_TOKEN) cargo run RUST_LOG=webhook_bridge=DEBUG WEBHOOK_BRIDGE_API_ROOT="https://code.fizz.buzz/api" WEBHOOK_BRIDGE_HMAC_SECRET=$(cat /bridge/git/mrmanager/k8s/webhook_bridge/secrets/webhook-bridge/webhook-bridge/HMAC_TOKEN) WEBHOOK_BRIDGE_OAUTH_TOKEN=$(cat /bridge/git/mrmanager/k8s/webhook_bridge/secrets/webhook-bridge/webhook-bridge/OAUTH_TOKEN) WEBHOOK_BRIDGE_REPO_WHITELIST="talexander/webhook_bridge,talexander/homepage,talexander/natter,talexander/poudboot,talexander/ta_waybar_pipewire,talexander/organic" cargo run

4
rust-toolchain.toml Normal file

@ -0,0 +1,4 @@
[toolchain]
channel = "nightly"
profile = "default"
components = ["clippy", "rustfmt"]

@ -113,6 +113,8 @@ pub(crate) struct HookRepository {
object_format_name: String, object_format_name: String,
mirror_updated: String, // TODO: parse to datetime mirror_updated: String, // TODO: parse to datetime
repo_transfer: Value, // Was null in test hook repo_transfer: Value, // Was null in test hook
topics: Value, // Was null in test hook
licenses: Value, // Was null in test hook
} }
#[allow(dead_code)] #[allow(dead_code)]