Skip to content

Commit

Permalink
fix(ci): install script not adjusting arch from amd64 to x64 (#3632)
Browse files Browse the repository at this point in the history
closes #3631
  • Loading branch information
rogeriopeixotocx authored Jun 14, 2021
1 parent 5415fde commit 479c709
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
13 changes: 11 additions & 2 deletions .goreleaser-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ builds:
- windows
goarch:
- amd64
- arm64
ignore:
- goos: darwin
goarch: 386
- goos: linux
goarm: 7
- goos: windows
goarm: 7
ldflags:
- -s
- -w
- -X github.com/Checkmarx/kics/internal/constants.Version={{ .Version }}-{{ .ShortCommit }}
- -X github.com/Checkmarx/kics/internal/constants.Version={{ .Version }}-{{ .ShortCommit }}-{{ .Date }}
- -X github.com/Checkmarx/kics/internal/constants.SCMCommit={{ .Commit }}
- -X github.com/Checkmarx/kics/internal/constants.SentryDSN={{ .Env.SENTRY_DSN }}
archives:
Expand All @@ -25,7 +33,8 @@ archives:
386: x32
files:
- LICENSE
- assets/queries
- assets/queries/**/metadata.json
- assets/queries/**/*.rego
- assets/libraries
release:
prerelease: true
Expand Down
19 changes: 16 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
set -e
# Code generated by godownloader on 2021-06-02T10:19:42Z. DO NOT EDIT.
# Code generated by godownloader on 2021-06-14T06:07:18Z. DO NOT EDIT.
#

usage() {
Expand Down Expand Up @@ -62,10 +62,12 @@ execute() {
}
get_binaries() {
case "$PLATFORM" in
darwin/386) BINARIES="kics" ;;
darwin/amd64) BINARIES="kics" ;;
linux/386) BINARIES="kics" ;;
darwin/arm64) BINARIES="kics" ;;
linux/amd64) BINARIES="kics" ;;
linux/arm64) BINARIES="kics" ;;
windows/amd64) BINARIES="kics" ;;
windows/arm64) BINARIES="kics" ;;
*)
log_crit "platform $PLATFORM is not supported. Make sure this script is up-to-date and file request at https://github.com/${PREFIX}/issues/new"
exit 1
Expand All @@ -89,14 +91,25 @@ tag_to_version() {
}
adjust_format() {
# change format (tar.gz or zip) based on OS
case ${OS} in
windows) FORMAT=zip ;;
esac
true
}
adjust_os() {
# adjust archive name based on OS
case ${OS} in
386) OS=x32 ;;
amd64) OS=x64 ;;
esac
true
}
adjust_arch() {
# adjust archive name based on ARCH
case ${ARCH} in
386) ARCH=x32 ;;
amd64) ARCH=x64 ;;
esac
true
}

Expand Down

0 comments on commit 479c709

Please sign in to comment.