forked from clean-docker/Magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init
executable file
·42 lines (34 loc) · 1.22 KB
/
init
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
#!/usr/bin/env bash
if [ "$2" == "clone" ]; then
git clone https://github.com/clean-docker/Magento2.git $1 && cd $1;
fi
git config --global core.autocrlf false
git config --global core.eol LF
git config --global core.fileMode false
git config --global diff.renamelimit 5000
sudo chmod -R u+x ./*
docker image pull rafaelcgstz/magento2
if [ "$(uname)" == "Darwin" ]; then
git checkout -f mac;
sed -i '' -e "s/<project_name>/$1/g" docker-compose.yml \
&& sed -i '' -e "s/<project_name>/$1/g" docker-compose-dev.yml \
&& sed -i '' -e "s/<project_name>/$1/g" docker-sync.yml;
elif [ "$(uname)" == "cygwin" ] || [ "$(uname)" == "msys" ] || [ "$(uname)" == "win32" ]; then
git checkout -f windows;
sed -i '' -e "s/<project_name>/$1/g" docker-compose.yml \
&& sed -i '' -e "s/<project_name>/$1/g" docker-compose-dev.yml \
&& sed -i '' -e "s/<project_name>/$1/g" docker-sync.yml;
else
git checkout -f master;
sed -i '' -e "s/<project_name>/$1/g" docker-compose.yml;
fi
if [ ! -e src/index.php ]; then
echo "<?php phpinfo();" > src/index.php;
fi
if [ -d src/app/etc ]; then
if [ ! -e src/app/etc/env.php ]; then
cp .docker/users/env.sample.php src/app/etc/env.php;
fi
fi
chmod -R 777 src
bash start