Skip to content

Commit efe2265

Browse files
committed
Add golang-1.26-linux BOSH package and declare it as health_monitor dependency
Copies the vendored golang-1.26-linux package (from cloudfoundry/bosh-package-golang-release) which was already present on experiment-golang-bosh-nats-sync. Without this package packages/health_monitor/spec had no golang dependency, so BOSH would not guarantee the Go toolchain was compiled before health_monitor during a release build. The packages/health_monitor/packaging script already loops for golang-* packages; the spec declaration ensures the compilation ordering is explicit. ai-assisted=yes [TNZ-113909] Convert BOSH health monitor job to Golang
1 parent 3c5d78b commit efe2265

5 files changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
set -e -x -u
2+
3+
mkdir "${BOSH_INSTALL_TARGET}/bosh"
4+
5+
PACKAGE_NAME="$(basename "${BOSH_INSTALL_TARGET}")"
6+
sed "s#\${PACKAGE_NAME}#${PACKAGE_NAME}#" golang-1.26-linux/compile.env.unix > "${BOSH_INSTALL_TARGET}/bosh/compile.env"
7+
sed "s#\${PACKAGE_NAME}#${PACKAGE_NAME}#" golang-1.26-linux/runtime.env.unix > "${BOSH_INSTALL_TARGET}/bosh/runtime.env"

packages/golang-1.26-linux/spec

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: golang-1.26-linux
3+
4+
dependencies: []
5+
6+
files:
7+
- golang-1.26-linux/compile.env.unix
8+
- golang-1.26-linux/runtime.env.unix

packages/health_monitor/spec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
name: health_monitor
33

4+
dependencies:
5+
- golang-1.26-linux
6+
47
files:
58
- bosh-monitor/**/*
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
if [ -z "${BOSH_PACKAGES_DIR:-}" ]; then
2+
export GOROOT=$(readlink -nf /var/vcap/packages/${PACKAGE_NAME})
3+
else
4+
export GOROOT=$BOSH_PACKAGES_DIR/${PACKAGE_NAME}
5+
fi
6+
7+
export GOPATH=$PWD
8+
export GOCACHE=/var/vcap/data/${PACKAGE_NAME}/cache
9+
export GOTOOLCHAIN=local
10+
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export GOROOT=$(readlink -nf /var/vcap/packages/${PACKAGE_NAME})
2+
export GOCACHE=/var/vcap/data/${PACKAGE_NAME}/cache
3+
export GOPATH="${PWD}"
4+
export PATH="${GOROOT}/bin:${GOPATH}/bin:${PATH}"

0 commit comments

Comments
 (0)