mirror of
https://git.sr.ht/~ashkeel/sourcehut-mirror-bridge
synced 2024-12-19 22:32:19 +00:00
This commit is contained in:
parent
7058bf90b2
commit
02fc03878d
4 changed files with 72 additions and 0 deletions
4
.dockerignore
Normal file
4
.dockerignore
Normal file
|
@ -0,0 +1,4 @@
|
|||
target
|
||||
LICENSE
|
||||
README.md
|
||||
.env
|
43
.drone.yml
Normal file
43
.drone.yml
Normal file
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: publish sha
|
||||
image: banzaicloud/drone-kaniko
|
||||
settings:
|
||||
registry: registry.fromouter.space
|
||||
repo: uchumoe/sourcehut-mirror-bridge
|
||||
cache: true
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
tags:
|
||||
- latest
|
||||
- ${DRONE_COMMIT_SHA}
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
|
||||
- name: publish tag
|
||||
image: banzaicloud/drone-kaniko
|
||||
settings:
|
||||
registry: registry.fromouter.space
|
||||
repo: uchumoe/sourcehut-mirror-bridge
|
||||
cache: true
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
tags:
|
||||
- ${DRONE_COMMIT_BRANCH}
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
---
|
||||
kind: signature
|
||||
hmac: 925643c1816fd7df3823079bc98a79836e34e4641b8328ae0bc3eae37923ff84
|
||||
|
||||
...
|
20
Dockerfile
Normal file
20
Dockerfile
Normal file
|
@ -0,0 +1,20 @@
|
|||
FROM public.ecr.aws/docker/library/rust:1-alpine as builder
|
||||
|
||||
RUN rustup default stable
|
||||
RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static pkgconf git
|
||||
|
||||
# Set `SYSROOT` to a dummy path (default is /usr) because pkg-config-rs *always*
|
||||
# links those located in that path dynamically but we want static linking, c.f.
|
||||
# https://github.com/rust-lang/pkg-config-rs/blob/54325785816695df031cef3b26b6a9a203bbc01b/src/lib.rs#L613
|
||||
ENV SYSROOT=/dummy
|
||||
|
||||
WORKDIR /wd
|
||||
COPY . /wd
|
||||
RUN cargo build --release --target=x86_64-unknown-linux-musl
|
||||
|
||||
FROM public.ecr.aws/docker/library/alpine
|
||||
ARG version=unknown
|
||||
ARG release=unreleased
|
||||
|
||||
COPY --from=builder /wd/target/x86_64-unknown-linux-musl/release/sourcehut-mirror-bridge /usr/local/bin/
|
||||
CMD ["sourcehut-mirror-bridge"]
|
5
README.md
Normal file
5
README.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
# sourcehut-mirror-bridge
|
||||
|
||||
SourceHut to Gitea active mirror bridge. Uses Soucehut GQL APIs to set up a webhook and manually sync a downstream Gitea/Forgejo repository set as a mirror.
|
||||
|
||||
Use case: You're running Drone CI or others linked to a Gitea instance and you want them to run as soon as possible.
|
Loading…
Reference in a new issue