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

Merge branch 'feat-check-nfs-mount' into 'main'

Feat check nfs mount

Closes devops#409

See merge request rc/packer-openstack-hpc-image!56
parents 94ce1b0a a196ee01
No related branches found
No related tags found
No related merge requests found
......@@ -142,6 +142,13 @@ test:
tags:
- build
script:
- FAILED=false
- |
eval $(ssh-agent -s)
chmod 400 "$SSH_PRIV_KEY"
ssh-add "$SSH_PRIV_KEY"
mkdir ~/.ssh
chmod 700 ~/.ssh
- OLD_INSTANCE_IP=$(openstack floating ip list --floating-ip-address $CHEAHA_IP -c "Fixed IP Address" -f value)
- echo $OLD_INSTANCE_IP
- |
......@@ -179,7 +186,21 @@ test:
- openstack server add floating ip $NEW_INSTANCE_ID $FLOATING_IP
- >
curl --retry 10 --retry-delay 20 --retry-connrefused https://knightly.rc.uab.edu/Shibboleth.sso/Metadata --resolve knightly.rc.uab.edu:443:$FLOATING_IP -kf
|| (openstack server delete $NEW_INSTANCE_ID && openstack image delete $BUILT_OOD_IMAGE_ID && false)
|| FAILED=true
- |
if [ $CI_PIPELINE_SOURCE == 'merge_request_event' ]; then
ssh -o StrictHostKeyChecking=no acctsvc@$FLOATING_IP '[ $(mount | grep "type nfs" | wc -l) -eq 6 ]' || FAILED=true
elif [ $CI_PIPELINE_SOURCE == 'schedule' ]; then
cp "$SSH_KNOWN_HOSTS" ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
ssh acctsvc@$FLOATING_IP '[ $(mount | grep "type nfs" | wc -l) -eq 6 ]' || FAILED=true
fi
- |
if [ "$FAILED" = true ]; then
openstack server delete $NEW_INSTANCE_ID
openstack image delete $BUILT_OOD_IMAGE_ID
false
fi
- |
if [ $CI_PIPELINE_SOURCE = "schedule" ]; then
openstack server remove floating ip $NEW_INSTANCE_ID $FLOATING_IP
......
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