Skip to content

Commit

Permalink
add $LARADOCK_CURRENT_PATH, readme fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bagart committed Mar 1, 2019
1 parent 21e9c63 commit 41a207f
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .laradock/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ if [ -d "_env" ]; then
echo "---------- prepare LARADOCK -----------"
cd $LARADOCK_PATH
./prepare.sh
cd $PROJECT_PATH
cd $LARADOCK_CURRENT_PATH
fi
fi
4 changes: 2 additions & 2 deletions .laradock/dotenv_rebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo "---------- Laradock set env: $LARADOCKENV_PROJECT_NAME ----------"

cd $LARADOCK_PATH
cp env-example .env
sed -i "s#^APP_CODE_PATH_HOST=.*#APP_CODE_PATH_HOST=$PROJECT_PATH#" .env
sed -i "s#^APP_CODE_PATH_HOST=.*#APP_CODE_PATH_HOST=$LARADOCK_PROJECT_PATH#" .env
sed -i "s#^COMPOSE_PROJECT_NAME=.*#COMPOSE_PROJECT_NAME=$LARADOCK_PROJECT_NAME#" .env
sed -i "s#^DATA_PATH_HOST=.*#DATA_PATH_HOST=.data#" .env

Expand All @@ -17,5 +17,5 @@ cd $LARADOCK_PATH
# sed -i "s#^\( *\-\) \($.*_PORT.*\)\$#\1 \"\2\"#" docker-compose.yml
# sed -i "s#^\( *\-\) \($.*\)\$#\1 d:\2#" docker-compose.yml
#fi;
cd $PROJECT_PATH
cd $LARADOCK_CURRENT_PATH
exit
7 changes: 5 additions & 2 deletions .laradock/init.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#! /bin/bash

LARADOCK_CURRENT_PATH=`pwd`
if [ -f `dirname "${BASH_SOURCE[0]}"`/../.env ]; then
. `dirname "${BASH_SOURCE[0]}"`/../.env
else
. `dirname "${BASH_SOURCE[0]}"`/../.env.example
fi

#echo ----------------------------------------------
#echo LARADOCK_PATH = $LARADOCK_PATH
#echo PROJECT_PATH = $PROJECT_PATH
#echo LARADOCK_PROJECT_PATH = $LARADOCK_PROJECT_PATH
#echo LARADOCKENV_PATH = $LARADOCKENV_PATH
#echo LARADOCK_PROJECT_NAME = $LARADOCK_PROJECT_NAME
#echo LARADOCK_CURRENT_PATH = $LARADOCK_CURRENT_PATH
#echo ----------------------------------------------

case `uname -s` in
Linux*) DOCKERHOST_OS=Linux;;
Expand Down
2 changes: 1 addition & 1 deletion .laradock/rebuild_containers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ cd $LARADOCK_PATH

echo ---------- rebuild$LaraDockEnv_BUILD_PARAM: $LARADOCK_PROJECT_SERVICES ----------
docker-compose build $LaraDockEnv_BUILD_PARAM --pull $LARADOCK_PROJECT_SERVICES | $LaraDock_PARAM
cd $PROJECT_PATH
cd $LARADOCK_CURRENT_PATH
2 changes: 1 addition & 1 deletion .laradock/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if [ -d $LARADOCK_PATH ]; then
cd $LARADOCK_PATH
docker-compose stop
docker-compose rm -f
cd $PROJECT_PATH
cd $LARADOCK_CURRENT_PATH
rm -rf $LARADOCK_PATH
else
echo "---------- Laradock uninstall is not needed ----------"
Expand Down
4 changes: 2 additions & 2 deletions .laradock/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ if [ -d $LARADOCK_PATH ]; then
cd $LARADOCK_PATH
git reset --hard origin/master
git pull
cd $PROJECT_PATH
cd $LARADOCK_CURRENT_PATH
else
echo "---------- Laradock 1st init: $LARADOCKENV_PROJECT_NAME ----------"
git clone https://github.com/LaraDock/laradock.git $LARADOCK_PATH
cd $LARADOCK_PATH
cp env-example .env
cd $PROJECT_PATH
cd $LARADOCK_CURRENT_PATH
fi
2 changes: 1 addition & 1 deletion app/purge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [[ "$1" != "" ]]; then
docker-compose rm -f $1
rm -rf .data/$1
docker-compose up -d $1
cd $PROJECT_PATH
cd $LARADOCK_CURRENT_PATH
else
echo Laradock service $1 is not exist
fi
Expand Down
2 changes: 1 addition & 1 deletion logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

cd $LARADOCK_PATH
docker-compose logs -f $1 | grep -v " schedule:run >> /dev/null 2>&1"
cd $PROJECT_PATH
cd $LARADOCK_CURRENT_PATH
2 changes: 1 addition & 1 deletion ps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

cd $LARADOCK_PATH
docker-compose ps
cd $PROJECT_PATH
cd $LARADOCK_CURRENT_PATH
13 changes: 6 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ Laradock ENV is a wrapper with command tools for build AND management of [Larado
- stop, rm, pull, rebuild without cache
- very slow
Benchmark: .laradock/rebuild_containers.sh, run two times
* windows:
- `time laradock/.laradock/rebuild_containers.sh`: 28 -> 15 sec
- `time laradock/.laradock/rebuild_containers.sh`: 9m 2sec
* windows --fix: 28sec
* windows+ssd:
- `time laradock/.laradock/rebuild_containers.sh`: 28 sec (second: 15 sec)
- `time laradock/.laradock/rebuild_containers.sh --fix`: 9m 2sec

`./conn.sh $service` - Connect to Laradock service terminal by name
`./conn.sh workspace` - Connect to workspace terminal with laradock user
Expand Down Expand Up @@ -97,14 +96,14 @@ Run in root of your project
```bash
git submodule add git://github.com/bagart/laradock_env.git cmd/laradock
cmd/laradock/up.sh
cp cmd/laradock/.env.exaple cmd/laradock/.env
cp cmd/laradock/.env.example cmd/laradock/.env
```

### Alternative
```bash
git clone git://github.com/bagart/laradock_env.git cmd/laradock
cmd/laradock/up.sh
cp cmd/laradock/.env.exaple cmd/laradock/.env
cp cmd/laradock/.env.example cmd/laradock/.env
```

### Optional
Expand All @@ -130,6 +129,6 @@ REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379
#for use workers: redis
#for use with workers: redis|beanstalkd|etc
QUEUE_CONNECTION=sync
```
2 changes: 1 addition & 1 deletion stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

cd $LARADOCK_PATH
docker-compose stop
cd $PROJECT_PATH
cd $LARADOCK_CURRENT_PATH
2 changes: 1 addition & 1 deletion up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "---------- Laradock UP: $LARADOCKENV_PROJECT_NAME ($LARADOCK_PROJECT_SERVI
if [ -f $LARADOCK_PATH/docker-compose.yml ]; then
cd $LARADOCK_PATH
docker-compose up -d $LARADOCK_PROJECT_SERVICES
cd $PROJECT_PATH
cd $LARADOCK_CURRENT_PATH
else
$LARADOCKENV_PATH/install.sh
fi
Expand Down

0 comments on commit 41a207f

Please sign in to comment.