Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: add-disk.sh

Issue 29448564: Issue 5277 - Prepare Vagrant files for CI (Closed)
Patch Set: see the changes in commit message https://github.com/4ntoine/libadblockplus-android-ci/commit/d44b6f71a6efb02d46fb594e823c6e810ba79a4f Created May 25, 2017, 1:50 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Vagrantfile ('k') | vagrant-build.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: add-disk.sh
diff --git a/add-disk.sh b/add-disk.sh
new file mode 100755
index 0000000000000000000000000000000000000000..c69e606a6d2d387d8bd193b2703bbb5049b76e90
--- /dev/null
+++ b/add-disk.sh
@@ -0,0 +1,44 @@
+# const
+VMS="$HOME/VirtualBox VMs"
+DISK2="box-disk2.vdi"
+DISK2_SIZE_GB=8
+
+# find paths
+VM=`ls "$VMS" | grep libadblockplus-android-ci-vm`
+VM_PATH="$VMS/$VM"
+echo "Found VM in $VM_PATH"
+
+DISK2_PATH="$VM_PATH/$DISK2"
+if [ -f "$DISK2_PATH" ]
+then
+ echo "Disk already added, exiting"
+ exit 0
+fi
+
+# stop VM
+echo "Stopping VM..."
+vagrant halt
+
+# create disk 2
+echo "Creating $DISK2 ..."
+DISK2_SIZE_MB=$(( $DISK2_SIZE_GB * 1024 ))
+
+VBoxManage createhd --filename "$DISK2_PATH" --size "$DISK2_SIZE_MB" || exit 1;
+echo "Done"
+
+# attach disk 2 to VN
+echo "Attaching disk 2..."
+VBoxManage storageattach "$VM" --storagectl "SATA Controller" --port 1 --device 0 --type hdd --medium "$DISK2_PATH" || exit 1;
+echo "Done"
+
+# vboxmanage list hdds
+# vboxmanage closemedium disk <uuid> --delete
+
+# start VM and mount disk 2
+echo "Starting VM..."
+vagrant up
+
+echo "Adding partition..."
+vagrant ssh -- /vagrant/vagrant-mount-disk.sh
+
+echo "Done"
« no previous file with comments | « Vagrantfile ('k') | vagrant-build.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld