Skip to content

Commit caa9752

Browse files
committed
Fix bosh create-release to work for integration tests
- Replace golang-1.26-linux spec.lock (vendored, no GCS blob yet) with a proper spec+packaging that can be built from source. The CI pipeline's bump-golang-package job will convert this back to the vendor-package approach once the blob is uploaded to GCS. - Fix packages/nats/spec: BOSH prepends src/ automatically, so the file pattern should be bosh-nats-sync/**/* not src/bosh-nats-sync/**/* - Fix packages/nats/packaging: BOSH strips src/ when extracting package files, so the compile target is bosh-nats-sync/ not src/bosh-nats-sync/ - Add src/golang-1.26-linux/compile.env.unix and runtime.env.unix from bosh-package-golang-release for the packaging script
1 parent 8d773dc commit caa9752

7 files changed

Lines changed: 31 additions & 4 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/golang-1.26-linux/spec.lock

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/nats/packaging

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ source /var/vcap/packages/golang-1.26-linux/bosh/compile.env
1010
unset GOPATH
1111
export GO111MODULE=on
1212

13-
cd src/bosh-nats-sync
13+
cd bosh-nats-sync
1414
CGO_ENABLED=0 go build -mod=vendor -o "${BOSH_INSTALL_TARGET}/bin/bosh-nats-sync" ./cmd/bosh-nats-sync

packages/nats/spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ dependencies:
66

77
files:
88
- nats/nats-server-v*-linux-amd64.tar.gz
9-
- src/bosh-nats-sync/**/*
9+
- bosh-nats-sync/**/*
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)