-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvm
executable file
·46 lines (37 loc) · 1.08 KB
/
vm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# Call example: ./vm
function clone_project {
project=$1
branch=$2
giturl=https://github.com/projectestac/$project.git
clone_project_git "$project" "$giturl" "$branch"
}
function clone_project_git {
project=$1
giturl=$2
branch=$3
homedir=$(pwd)
if [ ! -d "$homedir/../$project" ]; then
echo "Project $project not found, cloning..."
git clone "$giturl" "$homedir/../$project"
if [[ "$branch" != "master" ]]; then
pushd "$homedir/../$project" || return
git checkout -b "$branch" "origin/$branch"
popd || return
fi
pushd "$homedir/../$project" || return
git submodule update --recursive --init
popd || return
fi
}
git pull origin agora-ubuntu-php81
if ! vagrant plugin list | grep -q vagrant-hosts; then
vagrant plugin install vagrant-hosts
fi
if ! vagrant plugin list | grep -q vagrant-disksize; then
vagrant plugin install vagrant-disksize
fi
clone_project agora master
vagrant box update
echo "Starting the VM"
vagrant up --provider virtualbox