Initial commit
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.idea
|
||||
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
||||
FROM public.ecr.aws/docker/library/node:22-alpine3.20
|
||||
|
||||
# Install git for gitea actions and ansible
|
||||
RUN apk add --no-cache git kubectl bash
|
||||
|
||||
WORKDIR /usr/src
|
||||
|
||||
COPY entrypoint.sh .
|
||||
|
||||
RUN chmod +x /usr/src/entrypoint.sh
|
||||
ENTRYPOINT ["bash","-c","/usr/src/entrypoint.sh"]
|
||||
13
action.yml
Normal file
13
action.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
name: Restart kube apps
|
||||
description: Permits restarting a deployed kube-app when an update is pushed
|
||||
author: Skydust
|
||||
|
||||
# Define your inputs here.
|
||||
inputs:
|
||||
deploymentName:
|
||||
description: The deployment name
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: docker
|
||||
image: Dockerfile
|
||||
20
entrypoint.sh
Normal file
20
entrypoint.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
INPUT_DEPLOYMENT_NAME=$deploymentName
|
||||
|
||||
set -e
|
||||
|
||||
echo "Searching kubectl rights in env: KUBERNETES_BASE64_CONF"
|
||||
if [[ -z "$KUBERNETES_BASE64_CONF" ]]; then
|
||||
echo "No kubernetes config found."
|
||||
echo "Encode it in base64 and place it in gitea secrets"
|
||||
fi
|
||||
echo "$KUBERNETES_BASE64_CONF" | base64 -d > "/root/.kube/config"
|
||||
|
||||
KUBECTL_OPTIONS+=("rollout" "restart" "deployment/${INPUT_DEPLOYMENT_NAME}")
|
||||
|
||||
# shellcheck disable=SC2145
|
||||
echo "Running kubectl with options: ${KUBECTL_OPTIONS[@]}"
|
||||
kubectl ${KUBECTL_OPTIONS[@]}
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user