File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed
Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -38,12 +38,14 @@ if [[ ! -v BRANCH_NAME ]]; then
3838 "
3939else
4040 # Running in Jenkins
41- excluded_directories=" $( pwd) /test,$( pwd) /third_party/go-mssqldb"
41+ # For some reason the third_party directory is not being excluded properly on main branch builds. It appears in two forms:
42+ # /home/jenkins/agent/workspace/secretless-broker-main-full_main/third_party/go-mssqldb
43+ # /home/jenkins/agent/workspace/secretless-broker-main-full_main/secretless-broker-main-full_main/third_party/go-mssqldb
44+ # To accomodate the second case, we duplicate the name of the working directory to build the full path
45+ third_party_import_dir=" $( pwd) /$( basename " $( pwd) " ) /third_party/go-mssqldb"
46+ excluded_directories=" $( pwd) /test,$( pwd) /third_party/go-mssqldb,$third_party_import_dir "
4247 echo " Excluding directories: ${excluded_directories} "
43- # TODO: Somehow this still fails to exclude them.
44- # Excluding directories: /home/jenkins/agent/workspace/secretless-broker-main-full_main/test,/home/jenkins/agent/workspace/secretless-broker-main-full_main/third_party/go-mssqldb
45- # later...
46- # Import directory: /home/jenkins/agent/workspace/secretless-broker-main-full_main/secretless-broker-main-full_main/third_party/go-mssqldb/examples/tsql
48+
4749 go install github.com/securego/gosec/v2/cmd/gosec@latest
4850 git config --global --add safe.directory " ${WORKSPACE} "
4951 ./bin/run_gosec -c " ${confidence} " -s " ${severity} " -b " ${current_branch} " -e " ${excluded_directories} "
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ goreleaser_assets() {
5757 * .deb
5858 secretless-broker-linux_amd64_v1
5959 secretless-broker-darwin_amd64_v1
60- secretless-broker-darwin_arm64
60+ secretless-broker-darwin_arm64_v8.0
6161 )
6262 local complete_assets
6363
@@ -96,6 +96,9 @@ function main() {
9696# Goreleaser's release section would remove _v1 from packages
9797# during a release but is disabled in favor of the automated
9898# release process.
99+ #
100+ # A similar process should be done for the arm64 packages now, as it appends
101+ # the suffix `v8.0` to the filename. See: https://pkg.go.dev/cmd/go#hdr-Environment_variables
99102# ##################################
100103function rename_assets() {
101104 # Find all assets ending with _v1
@@ -104,6 +107,13 @@ function rename_assets() {
104107 echo " RENAMING ${file} to ${file/ _v1/ } "
105108 mv " $file " " ${file/ _v1/ } "
106109 done
110+
111+ # Find all assets ending with v8.0
112+ for file in " ${asset_dir} " /* _v8.0; do
113+ # Rename file, removing v8.0 from asset
114+ echo " RENAMING ${file} to ${file/ _v8.0/ } "
115+ mv " $file " " ${file/ _v8.0/ } "
116+ done
107117}
108118
109119main
You can’t perform that action at this time.
0 commit comments