add error handling for missing input
This commit is contained in:
parent
e79d57928a
commit
6a94eb6279
@ -11,6 +11,16 @@ cat "$GITHUB_OUTPUT"
|
|||||||
|
|
||||||
KUST_CONFIG=$1
|
KUST_CONFIG=$1
|
||||||
|
|
||||||
|
if [ -z "$KUST_CONFIG" ]; then
|
||||||
|
echo "KUST_CONFIG not defined, pass it in a 'with:' clause to the action" && exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "$K3S_YAML" ]; then
|
||||||
|
echo "K3S_YAML not defined, pass it in the environment with an 'env:' clause to the action" && exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "$GITHUB_SHA" ]; then
|
||||||
|
echo "GITHUB_SHA not defined, pass it in the environment with an 'env:' clause to the action" && exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Going to apply kustomization configuration at ${KUST_CONFIG}"
|
echo "Going to apply kustomization configuration at ${KUST_CONFIG}"
|
||||||
echo "K3S_YAML:"
|
echo "K3S_YAML:"
|
||||||
echo "$K3S_YAML"
|
echo "$K3S_YAML"
|
||||||
@ -20,7 +30,7 @@ ls -lth /tmp/
|
|||||||
echo "K3S_YAML, deserialized:"
|
echo "K3S_YAML, deserialized:"
|
||||||
cat /tmp/k3s.yaml
|
cat /tmp/k3s.yaml
|
||||||
cp -r ./kustomize /tmp/ # TODO: we expect the kustomize folder to be present in the root of the repository
|
cp -r ./kustomize /tmp/ # TODO: we expect the kustomize folder to be present in the root of the repository
|
||||||
find /tmp/kustomize -type f -print0 | xargs -0 sed -i "s/GIT_VERSION/${CI_COMMIT_SHA}/"
|
find /tmp/kustomize -type f -print0 | xargs -0 sed -i "s/GIT_VERSION/${GITHUB_SHA}/"
|
||||||
echo "try and get nodes and version... (debugging)"
|
echo "try and get nodes and version... (debugging)"
|
||||||
kubectl --kubeconfig /tmp/k3s.yaml get all
|
kubectl --kubeconfig /tmp/k3s.yaml get all
|
||||||
kubectl --kubeconfig /tmp/k3s.yaml version
|
kubectl --kubeconfig /tmp/k3s.yaml version
|
||||||
|
Loading…
Reference in New Issue
Block a user