Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use docker implementation #1

Merged
merged 3 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM alpine:latest

ARG VERSION="1.2.0"

COPY entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh && \
apk add --no-cache --update openssl curl ca-certificates && \
curl -L https://github.com/argoproj/argo-rollouts/releases/download/v$VERSION/kubectl-argo-rollouts-linux-amd64 -o /usr/local/bin/kubectl-argo-rollouts && \
chmod +x /usr/local/bin/kubectl-argo-rollouts && \
rm -rf /var/cache/apk/*

ENTRYPOINT ["/entrypoint.sh"]
CMD ["version"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To use kubectl-argo-rollouts put this step into your workflow:
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: get pods
args: get rollout
```

## Environment variables
Expand Down
12 changes: 12 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'kubectl-argo-rollouts cli'
description: 'GitHub Action for interacting with kubectl-argo-rollouts (kubectl-argo-rollouts)'
author: 'meakawa <meakawa@icloud.com>'
branding:
icon: 'terminal'
color: 'blue'
inputs:
KUBE_CONFIG:
description: 'Kubernetes configuration'
runs:
using: 'docker'
image: 'Dockerfile'
20 changes: 20 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

set -e

if [ ! -d "$HOME/.kube" ]; then
mkdir -p $HOME/.kube
fi

if [ ! -f "$HOME/.kube/config" ]; then
if [ ! -z "${KUBE_CONFIG}" ]; then
echo "$KUBE_CONFIG" | base64 -d > $HOME/.kube/config
else
echo "No authorization data found. Please provide KUBE_CONFIG variables. Exiting..."
exit 1
fi
fi

echo "/usr/local/bin/kubectl-argo-rollouts" >> $GITHUB_PATH

kubectl-argo-rollouts $*