Skip to content

Commit

Permalink
fix: Install Regal on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
sbp-bvanb committed Dec 2, 2024
1 parent b680e04 commit 9267425
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
---
version: "3"
vars:
# Variables that have to be defined first as they are used in other variables
OS_TYPE_MAC: Darwin
# Variables that are sorted alphabetically and are used in the tasks
BUILD_TAGS: component,e2e,integration
COVERPROFILE: profile.cov
GCI: "{{.GOBIN}}/gci"
Expand All @@ -13,7 +16,7 @@ vars:
GOLANGCI_LINT_VERSION: 1.61.0
GOLANG_PARALLEL_TESTS:
sh: |
if [ "$(uname -s)" = "Darwin" ]; then
if [ "$(uname -s)" = "{{.OS_TYPE_MAC}}" ]; then
sysctl -n hw.ncpu
else
nproc
Expand All @@ -26,11 +29,16 @@ vars:
MOCKERY_VERSION: "{{.MOCKERY_MAJOR_VERSION}}.46.0"
OPA_FMT: "{{.GOBIN}}/opa fmt ."
OPA_VERSION: v0.70.0
OS_COMMAND: uname
OS_COMMAND_TYPE:
sh: "{{.OS_COMMAND}} -s"
OS_COMMAND_TYPE_ARCHITECTURE:
sh: "{{.OS_COMMAND}} -m"
REGAL: "{{.GOBIN}}/regal"
REGAL_VERSION: 0.29.2
SED_INSERT_ADDITION:
sh: |
if [ "$(uname -s)" = "Darwin" ]; then
if [ "{{.OS_COMMAND}}" = "{{.OS_TYPE_MAC}}" ]; then
echo "\"\""
fi
YQ_MAJOR_VERSION: v4
Expand Down Expand Up @@ -241,7 +249,7 @@ tasks:
if ! regal version | grep -q {{.REGAL_VERSION}}; then
# regal version installed using `go install` does not include
# version, see: https://github.com/StyraInc/regal/issues/1275
curl -L -o {{.REGAL}} https://github.com/StyraInc/regal/releases/download/v{{.REGAL_VERSION}}/regal_Darwin_arm64
curl -L -o {{.REGAL}} https://github.com/StyraInc/regal/releases/download/v{{.REGAL_VERSION}}/regal_{{.OS_COMMAND_TYPE}}_{{.OS_COMMAND_TYPE_ARCHITECTURE}}
chmod +x {{.REGAL}}
fi
regal-run:
Expand Down

0 comments on commit 9267425

Please sign in to comment.