-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
4 changed files
with
21 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
set -ex | ||
#!/bin/bash | ||
|
||
set -e -u -x -o pipefail | ||
|
||
# shellcheck source=/dev/null | ||
source /var/vcap/packages/golang-1.22-linux/bosh/compile.env | ||
export GOPATH=/var/vcap | ||
|
||
go build -mod=vendor -o ${BOSH_INSTALL_TARGET}/log-cache-cf-auth-proxy ./cmd/cf-auth-proxy | ||
go build -o "${BOSH_INSTALL_TARGET}/log-cache-cf-auth-proxy" ./cmd/cf-auth-proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
set -ex | ||
#!/bin/bash | ||
|
||
set -e -u -x -o pipefail | ||
|
||
# shellcheck source=/dev/null | ||
source /var/vcap/packages/golang-1.22-linux/bosh/compile.env | ||
export GOPATH=/var/vcap | ||
|
||
VERSION=$(cat version) | ||
go build -mod=vendor \ | ||
-o ${BOSH_INSTALL_TARGET}/log-cache-gateway \ | ||
go build \ | ||
-o "${BOSH_INSTALL_TARGET}/log-cache-gateway" \ | ||
-ldflags "-X main.buildVersion=${VERSION}" \ | ||
./cmd/gateway |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
set -ex | ||
#!/bin/bash | ||
|
||
set -e -u -x -o pipefail | ||
|
||
# shellcheck source=/dev/null | ||
source /var/vcap/packages/golang-1.22-linux/bosh/compile.env | ||
export GOPATH=/var/vcap | ||
|
||
go build -mod=vendor -o ${BOSH_INSTALL_TARGET}/log-cache-syslog-server ./cmd/syslog-server | ||
go build -o "${BOSH_INSTALL_TARGET}/log-cache-syslog-server" ./cmd/syslog-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
set -ex | ||
#!/bin/bash | ||
|
||
set -e -u -x -o pipefail | ||
|
||
# shellcheck source=/dev/null | ||
source /var/vcap/packages/golang-1.22-linux/bosh/compile.env | ||
export GOPATH=/var/vcap | ||
|
||
go build -mod=vendor -o ${BOSH_INSTALL_TARGET}/log-cache ./cmd/log-cache | ||
go build -o "${BOSH_INSTALL_TARGET}/log-cache" ./cmd/log-cache |