Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ac3c23e65a | ||
![]() |
3f2bdda8cb | ||
![]() |
e7eeeefa53 | ||
![]() |
a17f6502c0 |
@ -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
|
||||||
@ -233,7 +235,7 @@ spec:
|
|||||||
- name: git-source
|
- name: git-source
|
||||||
volumeClaimTemplate:
|
volumeClaimTemplate:
|
||||||
spec:
|
spec:
|
||||||
storageClassName: "nfs-client"
|
storageClassName: "local-path"
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
resources:
|
resources:
|
||||||
|
@ -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
|
||||||
@ -308,7 +310,7 @@ spec:
|
|||||||
- name: git-source
|
- name: git-source
|
||||||
volumeClaimTemplate:
|
volumeClaimTemplate:
|
||||||
spec:
|
spec:
|
||||||
storageClassName: "nfs-client"
|
storageClassName: "local-path"
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
resources:
|
resources:
|
||||||
|
@ -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
|
||||||
@ -287,7 +289,7 @@ spec:
|
|||||||
- name: git-source
|
- name: git-source
|
||||||
volumeClaimTemplate:
|
volumeClaimTemplate:
|
||||||
spec:
|
spec:
|
||||||
storageClassName: "nfs-client"
|
storageClassName: "local-path"
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
resources:
|
resources:
|
||||||
|
@ -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
|
||||||
@ -277,7 +279,7 @@ spec:
|
|||||||
- name: git-source
|
- name: git-source
|
||||||
volumeClaimTemplate:
|
volumeClaimTemplate:
|
||||||
spec:
|
spec:
|
||||||
storageClassName: "nfs-client"
|
storageClassName: "local-path"
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
resources:
|
resources:
|
||||||
|
@ -177,7 +177,7 @@ spec:
|
|||||||
- name: git-source
|
- name: git-source
|
||||||
volumeClaimTemplate:
|
volumeClaimTemplate:
|
||||||
spec:
|
spec:
|
||||||
storageClassName: "nfs-client"
|
storageClassName: "local-path"
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
resources:
|
resources:
|
||||||
|
@ -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"]
|
||||||
|
@ -1,42 +1,14 @@
|
|||||||
{
|
{
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/tags/v0.0.19",
|
||||||
"before": "f3b00c46ea57d5314063ad6fbfcaf9e38712cafe",
|
"before": "0000000000000000000000000000000000000000",
|
||||||
"after": "e991b259f2bdf3f24a2cba309a93d81f32ab7f50",
|
"after": "3f2bdda8cb81fae6072c139f1f3f3123493a5b87",
|
||||||
"compare_url": "https://code.fizz.buzz/talexander/webhook_bridge/compare/f3b00c46ea57d5314063ad6fbfcaf9e38712cafe...e991b259f2bdf3f24a2cba309a93d81f32ab7f50",
|
"compare_url": "https://code.fizz.buzz/talexander/webhook_bridge/compare/0000000000000000000000000000000000000000...3f2bdda8cb81fae6072c139f1f3f3123493a5b87",
|
||||||
"commits": [
|
"commits": [],
|
||||||
{
|
"total_commits": 0,
|
||||||
"id": "e991b259f2bdf3f24a2cba309a93d81f32ab7f50",
|
|
||||||
"message": "Add source_id to HookUser.\n\nThis must be a new field that gitea added in an update.\n",
|
|
||||||
"url": "https://code.fizz.buzz/talexander/webhook_bridge/commit/e991b259f2bdf3f24a2cba309a93d81f32ab7f50",
|
|
||||||
"author": {
|
|
||||||
"name": "Tom Alexander",
|
|
||||||
"email": "tom@fizz.buzz",
|
|
||||||
"username": ""
|
|
||||||
},
|
|
||||||
"committer": {
|
|
||||||
"name": "Tom Alexander",
|
|
||||||
"email": "tom@fizz.buzz",
|
|
||||||
"username": ""
|
|
||||||
},
|
|
||||||
"verification": null,
|
|
||||||
"timestamp": "2024-10-18T19:41:56-04:00",
|
|
||||||
"added": [],
|
|
||||||
"removed": [],
|
|
||||||
"modified": [
|
|
||||||
".webhook_bridge/pipeline-build-semver.yaml",
|
|
||||||
".webhook_bridge/pipeline-format.yaml",
|
|
||||||
".webhook_bridge/pipeline-rust-clippy.yaml",
|
|
||||||
".webhook_bridge/pipeline-rust-test.yaml",
|
|
||||||
".webhook_bridge/pipeline-semver.yaml",
|
|
||||||
"src/hook_push.rs"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"total_commits": 1,
|
|
||||||
"head_commit": {
|
"head_commit": {
|
||||||
"id": "e991b259f2bdf3f24a2cba309a93d81f32ab7f50",
|
"id": "3f2bdda8cb81fae6072c139f1f3f3123493a5b87",
|
||||||
"message": "Add source_id to HookUser.\n\nThis must be a new field that gitea added in an update.\n",
|
"message": "Add support for new fields in payload.\n",
|
||||||
"url": "https://code.fizz.buzz/talexander/webhook_bridge/commit/e991b259f2bdf3f24a2cba309a93d81f32ab7f50",
|
"url": "https://code.fizz.buzz/talexander/webhook_bridge/commit/3f2bdda8cb81fae6072c139f1f3f3123493a5b87",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Tom Alexander",
|
"name": "Tom Alexander",
|
||||||
"email": "tom@fizz.buzz",
|
"email": "tom@fizz.buzz",
|
||||||
@ -48,15 +20,13 @@
|
|||||||
"username": ""
|
"username": ""
|
||||||
},
|
},
|
||||||
"verification": null,
|
"verification": null,
|
||||||
"timestamp": "2024-10-18T19:41:56-04:00",
|
"timestamp": "2025-02-08T20:58:55-05:00",
|
||||||
"added": [],
|
"added": [
|
||||||
|
"rust-toolchain.toml"
|
||||||
|
],
|
||||||
"removed": [],
|
"removed": [],
|
||||||
"modified": [
|
"modified": [
|
||||||
".webhook_bridge/pipeline-build-semver.yaml",
|
"run.bash",
|
||||||
".webhook_bridge/pipeline-format.yaml",
|
|
||||||
".webhook_bridge/pipeline-rust-clippy.yaml",
|
|
||||||
".webhook_bridge/pipeline-rust-test.yaml",
|
|
||||||
".webhook_bridge/pipeline-semver.yaml",
|
|
||||||
"src/hook_push.rs"
|
"src/hook_push.rs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -96,7 +66,7 @@
|
|||||||
"template": false,
|
"template": false,
|
||||||
"parent": null,
|
"parent": null,
|
||||||
"mirror": false,
|
"mirror": false,
|
||||||
"size": 151,
|
"size": 168,
|
||||||
"language": "",
|
"language": "",
|
||||||
"languages_url": "https://code.fizz.buzz/api/v1/repos/talexander/webhook_bridge/languages",
|
"languages_url": "https://code.fizz.buzz/api/v1/repos/talexander/webhook_bridge/languages",
|
||||||
"html_url": "https://code.fizz.buzz/talexander/webhook_bridge",
|
"html_url": "https://code.fizz.buzz/talexander/webhook_bridge",
|
||||||
@ -115,7 +85,7 @@
|
|||||||
"default_branch": "main",
|
"default_branch": "main",
|
||||||
"archived": false,
|
"archived": false,
|
||||||
"created_at": "2024-07-14T18:48:52Z",
|
"created_at": "2024-07-14T18:48:52Z",
|
||||||
"updated_at": "2024-09-30T04:41:20Z",
|
"updated_at": "2025-02-09T02:12:22Z",
|
||||||
"archived_at": "1970-01-01T00:00:00Z",
|
"archived_at": "1970-01-01T00:00:00Z",
|
||||||
"permissions": {
|
"permissions": {
|
||||||
"admin": true,
|
"admin": true,
|
||||||
@ -150,56 +120,58 @@
|
|||||||
"mirror_interval": "",
|
"mirror_interval": "",
|
||||||
"object_format_name": "sha1",
|
"object_format_name": "sha1",
|
||||||
"mirror_updated": "0001-01-01T00:00:00Z",
|
"mirror_updated": "0001-01-01T00:00:00Z",
|
||||||
"repo_transfer": null
|
"repo_transfer": null,
|
||||||
|
"topics": null,
|
||||||
|
"licenses": null
|
||||||
},
|
},
|
||||||
"pusher": {
|
"pusher": {
|
||||||
"id": 1,
|
"id": 2,
|
||||||
"login": "talexander",
|
"login": "build-bot",
|
||||||
"login_name": "",
|
"login_name": "",
|
||||||
"source_id": 0,
|
"source_id": 0,
|
||||||
"full_name": "",
|
"full_name": "",
|
||||||
"email": "talexander@noreply.code.fizz.buzz",
|
"email": "build-bot@noreply.code.fizz.buzz",
|
||||||
"avatar_url": "https://code.fizz.buzz/avatars/9d402a89b5a0786f83c1b8c5486fc7ff3d083a54fe20e55c0a776a1932c30289",
|
"avatar_url": "https://code.fizz.buzz/avatars/e39ef2faba8a3dfb3dcb4d8275a532d4",
|
||||||
"html_url": "https://code.fizz.buzz/talexander",
|
"html_url": "https://code.fizz.buzz/build-bot",
|
||||||
"language": "",
|
"language": "",
|
||||||
"is_admin": false,
|
"is_admin": false,
|
||||||
"last_login": "0001-01-01T00:00:00Z",
|
"last_login": "0001-01-01T00:00:00Z",
|
||||||
"created": "2023-07-05T22:03:28Z",
|
"created": "2023-07-09T04:25:44Z",
|
||||||
"restricted": false,
|
"restricted": false,
|
||||||
"active": false,
|
"active": false,
|
||||||
"prohibit_login": false,
|
"prohibit_login": false,
|
||||||
"location": "",
|
"location": "",
|
||||||
"website": "",
|
"website": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
"visibility": "public",
|
"visibility": "private",
|
||||||
"followers_count": 0,
|
"followers_count": 0,
|
||||||
"following_count": 0,
|
"following_count": 0,
|
||||||
"starred_repos_count": 0,
|
"starred_repos_count": 0,
|
||||||
"username": "talexander"
|
"username": "build-bot"
|
||||||
},
|
},
|
||||||
"sender": {
|
"sender": {
|
||||||
"id": 1,
|
"id": 2,
|
||||||
"login": "talexander",
|
"login": "build-bot",
|
||||||
"login_name": "",
|
"login_name": "",
|
||||||
"source_id": 0,
|
"source_id": 0,
|
||||||
"full_name": "",
|
"full_name": "",
|
||||||
"email": "talexander@noreply.code.fizz.buzz",
|
"email": "build-bot@noreply.code.fizz.buzz",
|
||||||
"avatar_url": "https://code.fizz.buzz/avatars/9d402a89b5a0786f83c1b8c5486fc7ff3d083a54fe20e55c0a776a1932c30289",
|
"avatar_url": "https://code.fizz.buzz/avatars/e39ef2faba8a3dfb3dcb4d8275a532d4",
|
||||||
"html_url": "https://code.fizz.buzz/talexander",
|
"html_url": "https://code.fizz.buzz/build-bot",
|
||||||
"language": "",
|
"language": "",
|
||||||
"is_admin": false,
|
"is_admin": false,
|
||||||
"last_login": "0001-01-01T00:00:00Z",
|
"last_login": "0001-01-01T00:00:00Z",
|
||||||
"created": "2023-07-05T22:03:28Z",
|
"created": "2023-07-09T04:25:44Z",
|
||||||
"restricted": false,
|
"restricted": false,
|
||||||
"active": false,
|
"active": false,
|
||||||
"prohibit_login": false,
|
"prohibit_login": false,
|
||||||
"location": "",
|
"location": "",
|
||||||
"website": "",
|
"website": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
"visibility": "public",
|
"visibility": "private",
|
||||||
"followers_count": 0,
|
"followers_count": 0,
|
||||||
"following_count": 0,
|
"following_count": 0,
|
||||||
"starred_repos_count": 0,
|
"starred_repos_count": 0,
|
||||||
"username": "talexander"
|
"username": "build-bot"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
run.bash
2
run.bash
@ -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
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)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user