forked from hswaw/hscloud
gerrit: add ref-updated hook to poke forgejo
This has been deployed already. Technically depends on I26531818a395de2a8bb6054d2583881fd1d5b806 as this has been deployed on top of that. Change-Id: I1b8d453d04f3a9a5435ae0dd6575f82d9ca10db7 Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1681 Reviewed-by: informatic <informatic@hackerspace.pl>master
parent
c68343caad
commit
7f5f2099c5
|
@ -18,6 +18,8 @@ rm -f /var/gerrit/etc/secure.config
|
||||||
cp /var/gerrit-secure/secure.config /var/gerrit/etc/secure.config
|
cp /var/gerrit-secure/secure.config /var/gerrit/etc/secure.config
|
||||||
|
|
||||||
cp /var/gerrit-plugins/* /var/gerrit/plugins/
|
cp /var/gerrit-plugins/* /var/gerrit/plugins/
|
||||||
|
mkdir -p /var/gerrit/hooks/
|
||||||
|
cp /var/gerrit-hooks/* /var/gerrit/hooks/
|
||||||
|
|
||||||
mkdir -p /var/gerrit/static
|
mkdir -p /var/gerrit/static
|
||||||
cp -r /var/gerrit-theme/*png /var/gerrit/static/
|
cp -r /var/gerrit-theme/*png /var/gerrit/static/
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# This will be ran by Gerrit any time a new Git commit is pushed, and will make
|
||||||
|
# Forgejo pull our changes.
|
||||||
|
|
||||||
|
if [ -z "$FORGEJO_TOKEN" ]; then
|
||||||
|
echo "FORGEJO_TOKEN must be set" > /dev/stderr
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# The gerrit image has no curl. But where we're going, we don't need curl.
|
||||||
|
auth="$(echo -ne "gerrit:$FORGEJO_TOKEN" | base64)"
|
||||||
|
openssl s_client -quiet -crlf -connect git.hackerspace.pl:443 <<EOF
|
||||||
|
POST /api/v1/repos/hswaw/hscloud/mirror-sync HTTP/1.1
|
||||||
|
Host: git.hackerspace.pl
|
||||||
|
Authorization: Basic $auth
|
||||||
|
Content-length: 0
|
||||||
|
Connection: Close
|
||||||
|
|
||||||
|
EOF
|
|
@ -38,7 +38,7 @@ local kube = import "../../../kube/kube.libsonnet";
|
||||||
address: "gerrit@hackerspace.pl",
|
address: "gerrit@hackerspace.pl",
|
||||||
},
|
},
|
||||||
|
|
||||||
tag: "3.3.2-r4",
|
tag: "3.7.5-r7",
|
||||||
image: "registry.k0.hswaw.net/q3k/gerrit:" + cfg.tag,
|
image: "registry.k0.hswaw.net/q3k/gerrit:" + cfg.tag,
|
||||||
resources: {
|
resources: {
|
||||||
requests: {
|
requests: {
|
||||||
|
@ -159,6 +159,12 @@ local kube = import "../../../kube/kube.libsonnet";
|
||||||
// SecureSecret gets mounted here
|
// SecureSecret gets mounted here
|
||||||
secure: { mountPath: "/var/gerrit-secure" },
|
secure: { mountPath: "/var/gerrit-secure" },
|
||||||
},
|
},
|
||||||
|
keys: kube.Secret(gerrit.name("keys")) {
|
||||||
|
metadata+: gerrit.metadata("deployment"),
|
||||||
|
//data_: {
|
||||||
|
// FORGEJO_TOKEN: "fill me when deploying, TODO(q3k): god damn secrets",
|
||||||
|
//},
|
||||||
|
},
|
||||||
deployment: kube.Deployment(gerrit.name("gerrit")) {
|
deployment: kube.Deployment(gerrit.name("gerrit")) {
|
||||||
metadata+: gerrit.metadata("deployment"),
|
metadata+: gerrit.metadata("deployment"),
|
||||||
spec+: {
|
spec+: {
|
||||||
|
@ -182,6 +188,9 @@ local kube = import "../../../kube/kube.libsonnet";
|
||||||
http: { containerPort: 8080 },
|
http: { containerPort: 8080 },
|
||||||
ssh: { containerPort: 29418 },
|
ssh: { containerPort: 29418 },
|
||||||
},
|
},
|
||||||
|
env_: {
|
||||||
|
FORGEJO_TOKEN: { secretKeyRef: { name: gerrit.keys.metadata.name, key: "FORGEJO_TOKEN" }},
|
||||||
|
},
|
||||||
resources: cfg.resources,
|
resources: cfg.resources,
|
||||||
volumeMounts_: volumeMounts,
|
volumeMounts_: volumeMounts,
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue