-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(workflows): move polaris action in repo and fix for v4
- Loading branch information
1 parent
bb0b08d
commit a1b9c39
Showing
4 changed files
with
56 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM alpine:3.14 | ||
|
||
RUN apk add --no-cache \ | ||
bash \ | ||
ca-certificates \ | ||
curl \ | ||
wget \ | ||
tar \ | ||
jq | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: 'Install polaris' | ||
description: 'Download a specific polaris version' | ||
|
||
inputs: | ||
version: | ||
description: 'version of polaris' | ||
required: true | ||
default: 'latest' | ||
|
||
runs: | ||
using: 'docker' | ||
image: './Dockerfile' | ||
args: | ||
- ${{ inputs.version }} | ||
|
||
outputs: | ||
version: | ||
description: 'Version of polaris installed' | ||
|
||
branding: | ||
icon: 'download-cloud' | ||
color: 'gray-dark' |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
if [[ -z "$INPUT_VERSION" ]]; then | ||
echo "Missing polaris version information" | ||
exit 1 | ||
fi | ||
polaris version | grep "$INPUT_VERSION" &> /dev/null | ||
if [ $? == 0 ]; then | ||
echo "Polaris $INPUT_VERSION is already installed! Exiting gracefully." | ||
exit 0 | ||
else | ||
echo "Installing polaris to path." | ||
fi | ||
TARGET_FILE="polaris.tar.gz" | ||
curl -LJ -vvv -o $TARGET_FILE 'https://github.com/FairwindsOps/polaris/releases/download/'"$INPUT_VERSION"'/polaris_linux_amd64.tar.gz' | ||
mkdir polaris | ||
tar -xzf $TARGET_FILE -C polaris | ||
rm $TARGET_FILE | ||
echo "polaris" >> $GITHUB_PATH | ||
echo "::set-output name=version::$INPUT_VERSION" |
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