-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·31 lines (24 loc) · 925 Bytes
/
bootstrap.sh
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
#!/bin/sh
### param 1 - path to bitbucket pass file
### param 2 - git branch
DEVOPS_REPO_NAME="devops"
if [ ! -d "$DEVOPS_REPO_NAME" ]; then
echo -e "\n###\nupdate system, install git and ansible\n###\n"
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-add-repository ppa:ansible/ansible -y
sudo apt-get update
sudo apt-get install software-properties-common git ansible -y
echo -e "\n###\nconfigure git\n###\n"
git config --global user.email "[email protected]"
git config --global user.name "Valentin Mihaylov"
echo -e "\n###\nget repo from bitbucket\n###\n"
git clone https://mihaylov-software:$(cat $1)@bitbucket.org/mihaylov-software/$DEVOPS_REPO_NAME.git
cd $DEVOPS_REPO_NAME
git checkout -b $2 origin/$2
else
cd $DEVOPS_REPO_NAME
git stash && git checkout $2 && git pull
fi
echo -e "\n###\nstart provisioning\n###\n"
./install-laptop.sh