We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 54d78fb commit a783e75Copy full SHA for a783e75
.circleci/config.yml
@@ -90,8 +90,11 @@ references:
90
# Match jobs whose age matches patterns like '1h' or '1d', i.e. any job
91
# that has been around longer than 1hr. First print all columns for
92
# matches, then execute the delete.
93
- kubectl get job | awk 'match($4,/[0-9]+[dh]/) {print $0}'
94
- kubectl delete job $(kubectl get job | awk 'match($4,/[0-9]+[dh]/) {print $1}')
+ jobs_to_delete=$(kubectl get job | awk 'match($4,/[0-9]+[dh]/) {print $0}')
+ echo $jobs_to_delete
95
+ if [ ${#jobs_to_delete} -gt 1 ];
96
+ then kubectl delete job $(kubectl get job | awk 'match($4,/[0-9]+[dh]/) {print $1}');
97
+ fi
98
99
jobs:
100
0 commit comments