Skip to content
Snippets Groups Projects
Commit 10775da4 authored by Eesaan Atluri's avatar Eesaan Atluri
Browse files

Merge branch 'fix-regex-image-deletion' into 'master'

Use correct regex to match ISO8601 date format

Closes #34

See merge request !29
parents 0a21c751 309df038
No related branches found
No related tags found
1 merge request!29Use correct regex to match ISO8601 date format
......@@ -63,7 +63,7 @@ clean_up: # This job removes older built images
name: $TARGET_ENV
script:
- |
IMAGE_TO_BE_DELETE=($(openstack image list --sort-column Name --sort-descending -f value -c Name -c ID | grep -P " xdmod-$TARGET_ENV-\d{14}$" | sed -n $(($NUM_IMAGE_TO_KEEP+1))',$p' | awk '{print $1}'))
IMAGE_TO_BE_DELETE=($(openstack image list --sort-column Name --sort-descending -f value -c Name -c ID | grep -P " xdmod-$TARGET_ENV-\d{4}-\d{2}-\d{2}T\d{6}$" | sed -n $(($NUM_IMAGE_TO_KEEP+1))',$p' | awk '{print $1}'))
echo "Images deleted:\n"
for img in ${IMAGE_TO_BE_DELETE[@]}; do
echo ${img}
......
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