Skip to content

Commit a8c642c

Browse files
authored
chore: Modernize packaging scripts (#468)
- Adds shebang directive for the default shell (used when the directive is missing). - Uses `set -euxo pipefail` to enable important shell options. - Ignore shellcheck warnings related to missing `compile.env` source files. - Removes unnecessary GOPATH export. - Removes `-mod=vendor` flag from `go build` command, as that flag is on by default in recent versions of Go.
1 parent a017c5e commit a8c642c

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
set -ex
1+
#!/bin/bash
22

3+
set -e -u -x -o pipefail
4+
5+
# shellcheck source=/dev/null
36
source /var/vcap/packages/golang-1.22-linux/bosh/compile.env
4-
export GOPATH=/var/vcap
57

6-
go build -mod=vendor -o ${BOSH_INSTALL_TARGET}/log-cache-cf-auth-proxy ./cmd/cf-auth-proxy
8+
go build -o "${BOSH_INSTALL_TARGET}/log-cache-cf-auth-proxy" ./cmd/cf-auth-proxy
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
set -ex
1+
#!/bin/bash
22

3+
set -e -u -x -o pipefail
4+
5+
# shellcheck source=/dev/null
36
source /var/vcap/packages/golang-1.22-linux/bosh/compile.env
4-
export GOPATH=/var/vcap
57

68
VERSION=$(cat version)
7-
go build -mod=vendor \
8-
-o ${BOSH_INSTALL_TARGET}/log-cache-gateway \
9+
go build \
10+
-o "${BOSH_INSTALL_TARGET}/log-cache-gateway" \
911
-ldflags "-X main.buildVersion=${VERSION}" \
1012
./cmd/gateway
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
set -ex
1+
#!/bin/bash
22

3+
set -e -u -x -o pipefail
4+
5+
# shellcheck source=/dev/null
36
source /var/vcap/packages/golang-1.22-linux/bosh/compile.env
4-
export GOPATH=/var/vcap
57

6-
go build -mod=vendor -o ${BOSH_INSTALL_TARGET}/log-cache-syslog-server ./cmd/syslog-server
8+
go build -o "${BOSH_INSTALL_TARGET}/log-cache-syslog-server" ./cmd/syslog-server

packages/log-cache/packaging

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
set -ex
1+
#!/bin/bash
22

3+
set -e -u -x -o pipefail
4+
5+
# shellcheck source=/dev/null
36
source /var/vcap/packages/golang-1.22-linux/bosh/compile.env
4-
export GOPATH=/var/vcap
57

6-
go build -mod=vendor -o ${BOSH_INSTALL_TARGET}/log-cache ./cmd/log-cache
8+
go build -o "${BOSH_INSTALL_TARGET}/log-cache" ./cmd/log-cache

0 commit comments

Comments
 (0)