Skip to content

Commit

Permalink
chore: set proper feature name for cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rafasdc committed Jun 24, 2024
1 parent a321b95 commit a772e9b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/clean-feature-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ jobs:
./lib/feature_envs/delete_feature_db.sh ccbc ${{ env.FEATURE_NAME }} ${{ secrets.OPENSHIFT_APP_NAMESPACE }}
- name: Uninstall feature Helm release
run: |
FEATURE_NAME_LOWER=$(echo "${{ env.FEATURE_NAME }}" | tr '[:upper:]' '[:lower:]')
FEATURE_NAME_LOWER=$(echo $FEATURE_NAME | tr '[:upper:]' '[:lower:]' | sed 's/-*$//')
FEATURE_NAME_LOWER_SHORT=$(echo $FEATURE_NAME_LOWER | cut -c -30 | sed 's/-*$//')
NAMESPACE="${{ secrets.OPENSHIFT_APP_NAMESPACE }}"
# Check if the release exists
if helm list -n "$NAMESPACE" | grep -q "^$FEATURE_NAME_LOWER\s"; then
if helm list -n "$NAMESPACE" | grep -q "^$FEATURE_NAME_LOWER_SHORT\s"; then
# Release exists, uninstall it
helm uninstall "$FEATURE_NAME_LOWER" -n "$NAMESPACE"
helm uninstall "$FEATURE_NAME_LOWER_SHORT" -n "$NAMESPACE"
else
echo "Helm release $FEATURE_NAME_LOWER not found, nothing to do"
echo "Helm release $FEATURE_NAME_LOWER_SHORT not found, nothing to do"
fi

0 comments on commit a772e9b

Please sign in to comment.