This commit is contained in:
parent
8b58681c35
commit
6e635c32e4
3 changed files with 22 additions and 5 deletions
|
|
@ -40,6 +40,13 @@ jobs:
|
||||||
echo "missing git/kubectl and no supported package manager found" >&2
|
echo "missing git/kubectl and no supported package manager found" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
|
- name: Prepare workspace
|
||||||
|
run: |
|
||||||
|
workspace_root="${RUNNER_TEMP:-/tmp}"
|
||||||
|
workspace_dir="$(mktemp -d "${workspace_root%/}/unrip-deploy-XXXXXX")"
|
||||||
|
echo "WORKSPACE_DIR=$workspace_dir" >> "$GITHUB_ENV"
|
||||||
|
echo "runner workspace: $workspace_dir"
|
||||||
|
|
||||||
- name: Load kubeconfig
|
- name: Load kubeconfig
|
||||||
run: |
|
run: |
|
||||||
mkdir -p "$HOME/.kube"
|
mkdir -p "$HOME/.kube"
|
||||||
|
|
@ -50,10 +57,16 @@ jobs:
|
||||||
env:
|
env:
|
||||||
REPO_TOKEN: ${{ github.token }}
|
REPO_TOKEN: ${{ github.token }}
|
||||||
run: |
|
run: |
|
||||||
git -c credential.username=oauth2 -c http.extraHeader="Authorization: Bearer ${REPO_TOKEN}" clone --depth=1 "${REPO_CLONE_URL}" /workspace
|
git -c credential.username=oauth2 -c http.extraHeader="Authorization: Bearer ${REPO_TOKEN}" clone --depth=1 "${REPO_CLONE_URL}" "$WORKSPACE_DIR"
|
||||||
cd /workspace
|
cd "$WORKSPACE_DIR"
|
||||||
git -c credential.username=oauth2 -c http.extraHeader="Authorization: Bearer ${REPO_TOKEN}" fetch --depth=1 origin "${GITHUB_SHA}"
|
current_sha="$(git rev-parse HEAD)"
|
||||||
git checkout --detach "${GITHUB_SHA}"
|
if [ "$current_sha" != "$GITHUB_SHA" ]; then
|
||||||
|
git -c credential.username=oauth2 -c http.extraHeader="Authorization: Bearer ${REPO_TOKEN}" fetch --depth=1 origin "${GITHUB_SHA}"
|
||||||
|
git checkout --detach "${GITHUB_SHA}"
|
||||||
|
else
|
||||||
|
git checkout --detach "$current_sha"
|
||||||
|
fi
|
||||||
|
git rev-parse HEAD
|
||||||
|
|
||||||
- name: Resolve deployment settings
|
- name: Resolve deployment settings
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -66,7 +79,7 @@ jobs:
|
||||||
|
|
||||||
- name: Apply manifests
|
- name: Apply manifests
|
||||||
run: |
|
run: |
|
||||||
kubectl apply -k /workspace/deploy/k8s/base
|
kubectl apply -k "$WORKSPACE_DIR/deploy/k8s/base"
|
||||||
|
|
||||||
- name: Build and push image in-cluster
|
- name: Build and push image in-cluster
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,8 @@ git push forgejo main
|
||||||
- builds the image from this repo root inside the cluster with Kaniko
|
- builds the image from this repo root inside the cluster with Kaniko
|
||||||
- pushes it to the shared registry
|
- pushes it to the shared registry
|
||||||
- rolls the `unrip` deployments
|
- rolls the `unrip` deployments
|
||||||
|
- uses a fresh temporary runner workspace on each run, so reruns do not require
|
||||||
|
manual cleanup on the Forgejo runner
|
||||||
|
|
||||||
### Observe rollout
|
### Observe rollout
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import { Kafka, logLevel } from 'kafkajs';
|
import { Kafka, logLevel } from 'kafkajs';
|
||||||
import { serializeError } from '../../core/log.mjs';
|
import { serializeError } from '../../core/log.mjs';
|
||||||
|
|
||||||
|
process.env.KAFKAJS_NO_PARTITIONER_WARNING ??= '1';
|
||||||
|
|
||||||
function createKafka({ brokers = ['127.0.0.1:9092'], clientId = 'unrip' } = {}) {
|
function createKafka({ brokers = ['127.0.0.1:9092'], clientId = 'unrip' } = {}) {
|
||||||
return new Kafka({
|
return new Kafka({
|
||||||
clientId,
|
clientId,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue