Skip to content
Snippets Groups Projects
Commit c80cb8e9 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Reformat the line for readability

parent 188d0d71
No related branches found
No related tags found
No related merge requests found
...@@ -385,12 +385,20 @@ cleanup: ...@@ -385,12 +385,20 @@ cleanup:
tags: tags:
- build - build
script: script:
- >
SERVER_TO_BE_DELETE=($(openstack server list --name $OOD_INSTANCE_NAME --sort-column Image --sort-descending -f value -c ID
| awk -v NSTK=$NUM_SERVER_TO_KEEP '{count++}
{if (count>NSTK) print}'))
- >
IMAGE_TO_BE_DELETE=($(openstack image list --sort-column Name --sort-descending -f value -c Name -c ID
| awk -v NITK=$NUM_IMAGE_TO_KEEP -v REGEX=ood-$TIMESTAMP_REGEX
'{if ($0 ~ REGEX) result[count++] = $1}
END {for(i=NITK;i<count;i++) print result[i]}'))
- | - |
SERVER_TO_BE_DELETE=($(openstack server list --name $OOD_INSTANCE_NAME --sort-column Image --sort-descending -f value -c ID | awk -v NSTK=$NUM_SERVER_TO_KEEP '{count++} {if (count>NSTK) print}'))
IMAGE_TO_BE_DELETE=($(openstack image list --sort-column Name --sort-descending -f value -c Name -c ID | awk -v NITK=$NUM_IMAGE_TO_KEEP -v REGEX=ood-$TIMESTAMP_REGEX '{if ($0 ~ REGEX) result[count++] = $1} END {for(i=NITK;i<count;i++) print result[i]}'))
for svr in ${SERVER_TO_BE_DELETE[@]}; do for svr in ${SERVER_TO_BE_DELETE[@]}; do
openstack server delete ${svr} openstack server delete ${svr}
done done
- |
for img in ${IMAGE_TO_BE_DELETE[@]}; do for img in ${IMAGE_TO_BE_DELETE[@]}; do
openstack image delete ${img} openstack image delete ${img}
done done
......
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