Skip to content
Snippets Groups Projects
Commit 5cc9fae5 authored by Ravi Tripathi's avatar Ravi Tripathi
Browse files

Merge branch 'fix-bash-array' into 'main'

Fix bash array syntax

Closes #64

See merge request rc/packer-openstack-hpc-image!42
parents 7d90341a 882ae164
No related branches found
No related tags found
1 merge request!42Fix bash array syntax
Pipeline #7629 passed with stages
in 19 minutes and 58 seconds
......@@ -165,10 +165,10 @@ deploy_knightly:
- |
SERVER_TO_BE_DELETE=($(openstack server list --name ood-knightly --sort-column Image --sort-descending -f value -c ID | sed -n $(($NUM_SERVER_TO_KEEP+1))',$p'))
IMAGE_TO_BE_DELETE=($(openstack image list --sort-column Name --sort-descending -f value -c Name | grep -P '^ood-\d{8}$' | sed -n $(($NUM_IMAGE_TO_KEEP+1))',$p'))
for svr in $SERVER_TO_BE_DELETE; do
for svr in ${SERVER_TO_BE_DELETE[@]}; do
openstack server delete ${svr}
done
for img in $IMAGE_TO_BE_DELETE; do
for img in ${IMAGE_TO_BE_DELETE[@]}; do
openstack image delete ${img}
done
only:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment