Skip to content

Commit

Permalink
cleanup_all script added, all "helper scripts" moved to tools directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap committed Mar 8, 2019
1 parent a6fa77a commit 73f53ac
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash -eux

REMOTE_IP="172.16.241.102,172.16.246.17"
REMOTE_IP="172.16.245.253,172.16.246.17"
REMOTE_USER="ubuntu"
GITLAB_REGISTRATION_TOKEN=${GITLAB_REGISTRATION_TOKEN:-}

# Prepare remote machine for build
if [ -n "$GITLAB_REGISTRATION_TOKEN" ]; then
ansible-playbook -i "$REMOTE_IP," -e GITLAB_REGISTRATION_TOKEN="$GITLAB_REGISTRATION_TOKEN" -e ansible_python_interpreter=python3 --user $REMOTE_USER ansible/build_remote_ssh_ubuntu.yml
ansible-playbook -i "$REMOTE_IP," -e GITLAB_REGISTRATION_TOKEN="$GITLAB_REGISTRATION_TOKEN" -e ansible_python_interpreter=python3 --user $REMOTE_USER ../ansible/build_remote_ssh_ubuntu.yml
else
ansible-playbook -i "$REMOTE_IP," -e ansible_python_interpreter=python3 --user $REMOTE_USER ansible/build_remote_ssh_ubuntu.yml
ansible-playbook -i "$REMOTE_IP," -e ansible_python_interpreter=python3 --user $REMOTE_USER ../ansible/build_remote_ssh_ubuntu.yml
fi
14 changes: 14 additions & 0 deletions tools/cleanup_all-vagrant_init_destroy_boxes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash -eux

set -o pipefail

TMPDIR=${TMPDIR:-/var/tmp/vagrant_init_destroy_boxes}

for DIR in `find /var/tmp -maxdepth 1 -mindepth 1 -type d`; do
VAGRANT_BOX_NAME=$(basename $DIR)
echo "*** $DIR"
cd $DIR
vagrant destroy -f
virsh --connect=qemu:///system vol-delete --pool default --vol ${VAGRANT_BOX_NAME}_vagrant_box_image_0.img
rm -rf $DIR
done

0 comments on commit 73f53ac

Please sign in to comment.