-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
68 lines (49 loc) · 1.78 KB
/
.zshrc
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
function doxid {
export name="$1";
targetpath=~/Development/$name
repository=https://github.com/OXIDFabian/OXID_Docker_Stackv2.git
dstop
git clone $repository $targetpath
echo "Created directory:" $targetpath
cd $targetpath
mkdir data && mkdir data/www && mkdir data/mysql
# docker-sync
echo "Checking out docker-sync files."
mkdir docker-sync
git clone https://github.com/michaelkeiluweit/OXID_Docker_Stackv2_4Mac.git docker-sync
cp docker-sync/docker-compose.yml docker-sync/docker-compose-dev.yml docker-sync/docker-sync.yml ./
sed -i '' 's/db-sync/db-sync-'"${name}"'/g' docker-sync.yml
sed -i '' 's/db-sync/db-sync-'"${name}"'/g' docker-compose-dev.yml
sed -i '' 's/php-www-sync/php-www-sync-'"${name}"'/g' docker-sync.yml
sed -i '' 's/php-www-sync/php-www-sync-'"${name}"'/g' docker-compose-dev.yml
echo "Copy default docker configuration"
cp ~/docker_config/.env $targetpath
cp ~/docker_config/auth.json $targetpath
#echo "open PHPStorm"
#(nohup /usr/local/bin/pstorm . >/dev/null 2>&1 &)
echo "done."
}
function dstop {
echo "Stopping ongoing docker images...";
docker ps -aq | xargs docker stop $(docker ps -a -q)
wait $!
#docker network prune -f;
#docker-sync stop
}
function dstart {
echo "Boot docker containers..."
#docker-compose up -d --force-recreate
docker-sync start
docker-compose -f docker-compose.yml -f docker-compose-dev.yml up
#echo "Start PHPStorm"
#(nohup phpstorm . >/dev/null 2>&1 &)
#dlogin
}
function dlogin {
#echo "Switch context to docker container php"
#docker-compose exec php bash
#gnome-terminal -- bash -c "docker-compose exec php bash;bash"
}
function dlogs {
docker-compose logs -f php
}