Skip to content

Commit

Permalink
Merge pull request #1 from Pablommr/develop
Browse files Browse the repository at this point in the history
Add Features
  • Loading branch information
Pablommr authored Aug 29, 2022
2 parents 3eb0da0 + be15416 commit cae8c6c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,16 @@ env:
ENVSUBST: true
KUBE_ROLLOUT: true
IMAGE_TAG: 1.21.6
```
```

<br>

# Change Log

## v1.1.0

- Add otpion to KUBE_ROLLOUT follow the rollout status in Action page
- Fix metacharacter replacement in ENVSUBST

## v1.0.0
- Project started
10 changes: 8 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if [ "$ENVSUBST" = true ]; then

for ENV_VAR in $(env |cut -f 1 -d =); do
VAR_KEY=$ENV_VAR
VAR_VALUE=$(eval echo \$$ENV_VAR | sed 's/\//\\\//g')
VAR_VALUE=$(eval echo \$$ENV_VAR | sed -e 's/\//\\&/g;s/\&/\\&/g;')
sed -i "s/\$$VAR_KEY/$VAR_VALUE/g" $KUBE_YAML
done

Expand All @@ -65,10 +65,16 @@ KUBE_APPLY=$(kubectl apply -f $KUBE_YAML)
echo $KUBE_APPLY

#Verify and execute rollout
if [ "$KUBE_ROLLOUT" = true ] && [ "$(echo $KUBE_APPLY |sed 's/.* //')" = unchanged ]; then
if [ "$KUBE_ROLLOUT" == true ] && [ "$(echo $KUBE_APPLY |sed 's/.* //')" == "unchanged" ]; then
echo ""
echo "Applying rollout:"
kubectl rollout restart --filename $KUBE_YAML
echo ""
echo "Checking rollout status:"
kubectl rollout status --filename $KUBE_YAML
elif [ "$KUBE_ROLLOUT" = true ] && ([ "$(echo $KUBE_APPLY |sed 's/.* //')" == "configured" ] || [ "$(echo $KUBE_APPLY |sed 's/.* //')" == "created" ]); then
echo ""
echo "Checking rollout status:"
kubectl rollout status --filename $KUBE_YAML
fi

Expand Down

0 comments on commit cae8c6c

Please sign in to comment.