checkServerStatus.sh 965 Bytes
Newer Older
Dominik Hebeler's avatar
Bugfix    
Dominik Hebeler committed
1
path="$1"
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Klone das Repo neu, falls es noch nicht existiert
if [ ! -d ~/MetaGer ]
then 
	cd ~/
	git clone "$path" 
	cd ~/MetaGer
	composer update 
	chmod -R 777 storage/ bootstrap/cache
fi
# Falls notwendig Laravel-Framework initialisieren:

if [ ! -f ~/MetaGer/.env ]
then 
	cd ~/MetaGer
	cp .env.example .env
fi
Dominik Hebeler's avatar
Bugfix    
Dominik Hebeler committed
18
if [ $(grep "SomeRandomString" ~/MetaGer/.env) ]
19
20
21
22
then 
	cd ~/MetaGer
	php artisan key:generate
fi
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Falls notwendig Homestead Server intialisieren:
if [ ! -d ~/Homestead ]
then
	cd ~/
	# Wir brauchen unseren öffentlichen ssh Schlüssel:
	if [ ! -d .ssh ]
	then
		mkdir .ssh
		chmod 700 .ssh
	fi
	if [ ! -f .ssh/id_rsa.pub ]
	then
		cd .ssh
		ssh-keygen -t rsa -N "" -f id_rsa
		cd ~/
	fi
	vagrant box add laravel/homestead
	git clone https://github.com/laravel/homestead.git Homestead
	cd Homestead/
	bash init.sh
Dominik Hebeler's avatar
Bugfix    
Dominik Hebeler committed
43
44
	cd ~/
	cp -f "$path/deploy/Homestead.yaml" .homestead/
45
46
47
	vagrant up
	echo "Your server is now running under http://localhost:8000"
fi