docker dev binaries

This commit is contained in:
Sam 2015-11-02 13:33:08 +11:00
parent fbb6eba252
commit 2c4f290786
7 changed files with 53 additions and 0 deletions

14
bin/docker/boot_dev Executable file
View file

@ -0,0 +1,14 @@
#!/bin/bash
pushd `dirname $0` > /dev/null
SCRIPTPATH=`pwd -P`
popd > /dev/null
SOURCE_DIR=`(cd $SCRIPTPATH && cd ../../ && pwd)`
DATA_DIR=$SOURCE_DIR/tmp/postgres
echo $SOURCE_DIR
echo $DATA_DIR
docker run -d -p 3000:3000 -v $DATA_DIR:/shared/postgres_data -v $SOURCE_DIR:/src --hostname=discourse_dev --name=discourse_dev --restart=always discourse/dev /sbin/boot

5
bin/docker/bundle Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
PARAMS="$@"
CMD="cd /src && HOME=/home/discourse chpst -u discourse:discourse bundle $PARAMS"
docker exec -it discourse_dev /bin/bash -c "$CMD"

5
bin/docker/psql Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
PARAMS="$@"
CMD="chpst -u postgres psql $PARAMS"
docker exec -it discourse_dev /bin/bash -c "$CMD"

9
bin/docker/rails Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
PARAMS="$@"
if [[ $# = 1 ]] && [[ "$1" =~ "s" ]];
then
PARAMS="$PARAMS -b 0.0.0.0"
fi
CMD="cd /src && HOME=/home/discourse RAILS_ENV=${RAILS_ENV:=development} chpst -u discourse:discourse rails $PARAMS"
docker exec -it discourse_dev /bin/bash -c "$CMD"

5
bin/docker/rake Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
PARAMS="$@"
CMD="cd /src && HOME=/home/discourse RAILS_ENV=${RAILS_ENV:=development} chpst -u discourse:discourse rake $PARAMS"
docker exec -it discourse_dev /bin/bash -c "$CMD"

12
bin/docker/reset_db Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
pushd `dirname $0` > /dev/null
SCRIPTPATH=`pwd -P`
popd > /dev/null
SOURCE_DIR=`(cd $SCRIPTPATH && cd ../../ && pwd)`
DATA_DIR=$SOURCE_DIR/tmp/postgres
docker run -it -v $DATA_DIR:/shared/postgres_data samsaffron/discourse_dev:1.0.13 /bin/bash -c "rm -fr /shared/postgres_data/*"

3
bin/docker/shutdown_dev Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
docker rm -f discourse_dev