Skip to content

Commit 475f0d8

Browse files
committed
Optionally consume Leeway from git
1 parent aa59db2 commit 475f0d8

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.werft/build.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@ pod:
241241
echo "done" \
242242
) | werft log slice "chowning /workspace and $GOCACHE"
243243
244+
{{ if .Annotations.leewayfromgit }}
245+
scripts/install-leeway-from-git.sh "{{ .Annotations.leewayfromgit }}" | werft log slice "Building fresh Leeway binary from source"
246+
{{ end }}
247+
244248
( \
245249
mkdir -p /workspace/.ssh && \
246250
cp /mnt/secrets/harvester-vm-ssh-keys/id_rsa /workspace/.ssh/id_rsa_harvester_vm && \

scripts/install-leeway-from-git.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# This script clones the leeway repo, builds leeway, and replaces the "leeway" binary in this workspace with the newly build binary.
4+
5+
set -Eeuo pipefail
6+
7+
BRANCH=$1
8+
BIN=$(whereis leeway | sed "s/leeway: //")
9+
10+
DIR=$(mktemp -d)
11+
echo "Cloning Leeway into $DIR"
12+
cd "$DIR"
13+
git clone https://github.com/gitpod-io/leeway.git --branch "$BRANCH"
14+
15+
cd leeway
16+
go build
17+
echo ""
18+
echo "Replacing $BIN with the newly build binary".
19+
sudo cp leeway "$BIN"

0 commit comments

Comments
 (0)