Skip to content

Commit

Permalink
Merge pull request #172 from opcr-io/update_build_script
Browse files Browse the repository at this point in the history
Update build script to allow setting rego version
  • Loading branch information
carabasdaniel authored Mar 25, 2024
2 parents fdc43d5 + caea045 commit 595ad9a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[ -z "${INPUT_REVISION}" ] && INPUT_REVISION=${GITHUB_SHA}
[ -z "${INPUT_VERBOSITY}" ] && INPUT_VERBOSITY="error"
[ -z "${INPUT_SOURCE_URL}" ] && INPUT_SOURCE_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
[ -z "${INPUT_REGO_VERSION}"] && INPUT_REGO_VERSION="default"

# validate if values are set
[ -z "${INPUT_SRC}" ] && echo "INPUT_SRC is not set exiting" && exit 2
Expand Down Expand Up @@ -50,6 +51,7 @@ echo "INPUT_TAG ${INPUT_TAG}"
echo "INPUT_REVISION ${INPUT_REVISION}"
echo "INPUT_VERBOSITY ${INPUT_VERBOSITY} (${VERBOSITY})"
echo "INPUT_SOURCE_URL ${INPUT_SOURCE_URL}"
echo "INPUT_REGO_VERSION ${INPUT_REGO_VERSION}"
echo "SRC_PATH ${SRC_PATH}"
printf "\n"

Expand All @@ -59,7 +61,7 @@ printf "\n"
e_code=0

# construct commandline arguments
CMD="/app/policy build ${SRC_PATH} --tag ${INPUT_TAG} --verbosity=${VERBOSITY} --annotations=org.opencontainers.image.source=${INPUT_SOURCE_URL}"
CMD="/app/policy build ${SRC_PATH} --tag ${INPUT_TAG} --rego-version=${INPUT_REGO_VERSION} --verbosity=${VERBOSITY} --annotations=org.opencontainers.image.source=${INPUT_SOURCE_URL}"

# execute command
eval "$CMD" || e_code=1
Expand Down

0 comments on commit 595ad9a

Please sign in to comment.