mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
DEV: Update docker development binstubs
- Add `d/ember-cli`, and publish port 4200 - Remove `d/sidekiq`. Sidekiq is now started with the rails server - Move all `docker exec` logic into a single place, so we have one place to set environment variable pass-throughs - Use `exec` for all bash scripts, so that return statuses are passed back correctly - Avoid using `bin/bash -c` unnecessarily, because it makes escaping arguments difficult
This commit is contained in:
parent
ab23412113
commit
73050d9049
|
@ -86,6 +86,7 @@ docker pull discourse/discourse_dev:release
|
|||
docker run -d \
|
||||
-p $local_publish:1080:1080 \
|
||||
-p $local_publish:3000:3000 \
|
||||
-p $local_publish:4200:4200 \
|
||||
-p $local_publish:9292:9292 \
|
||||
-p $local_publish:9405:9405 \
|
||||
-v "$DATA_DIR:/shared/postgres_data:delegated" \
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
PARAMS="$@"
|
||||
CMD="cd /src && USER=discourse RAILS_ENV=${RAILS_ENV:=development} bundle $PARAMS"
|
||||
docker exec -it -u discourse:discourse discourse_dev /bin/bash -c "$CMD"
|
||||
exec "$(dirname "$0")/exec" bundle "$@"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
PARAMS="$@"
|
||||
CMD="cd /src && USER=discourse RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 LD_PRELOAD=/usr/lib/libjemalloc.so RAILS_ENV=${RAILS_ENV:=development} script/discourse $PARAMS"
|
||||
docker exec -it -u discourse:discourse discourse_dev /bin/bash -c "$CMD"
|
||||
exec "$(dirname "$0")/exec" script/discourse "$@"
|
||||
|
|
3
bin/docker/ember-cli
Executable file
3
bin/docker/ember-cli
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
exec "$(dirname "$0")/exec" bin/ember-cli "$@"
|
13
bin/docker/exec
Executable file
13
bin/docker/exec
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
exec docker exec \
|
||||
-it \
|
||||
-u discourse:discourse \
|
||||
-w '/src' \
|
||||
-e RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 \
|
||||
-e LD_PRELOAD=/usr/lib/libjemalloc.so \
|
||||
-e RAILS_ENV \
|
||||
-e NO_EMBER_CLI \
|
||||
-e QUNIT_RAILS_ENV \
|
||||
discourse_dev \
|
||||
"$@"
|
|
@ -1,4 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
CMD="USER=discourse mailcatcher --http-ip 0.0.0.0 -f"
|
||||
docker exec -it discourse_dev /bin/bash -c "$CMD"
|
||||
exec "$(dirname "$0")/exec" mailcatcher --http-ip 0.0.0.0 -f
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
CMD="cd /src && USER=discourse RAILS_ENV=development rake db:migrate"
|
||||
docker exec -it -u discourse:discourse discourse_dev /bin/bash -c "$CMD"
|
||||
CMD="cd /src && USER=discourse RAILS_ENV=test rake db:migrate"
|
||||
docker exec -it -u discourse:discourse discourse_dev /bin/bash -c "$CMD"
|
||||
"$(dirname "$0")/exec" bin/rake db:migrate
|
||||
RAILS_ENV=test "$(dirname "$0")/exec" bin/rake db:migrate
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
PARAMS="$@"
|
||||
CMD="USER=discourse psql $PARAMS"
|
||||
docker exec -it -u postgres discourse_dev /bin/bash -c "$CMD"
|
||||
exec "$(dirname "$0")/exec" psql "$@"
|
||||
|
|
|
@ -1,10 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
PARAMS="$@"
|
||||
if [[ $# = 1 ]] && [[ "$1" =~ "s" ]];
|
||||
then
|
||||
PARAMS="$PARAMS -b 0.0.0.0"
|
||||
fi
|
||||
|
||||
CMD="cd /src && USER=discourse RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 LD_PRELOAD=/usr/lib/libjemalloc.so RACK_HANDLER=puma RAILS_ENV=${RAILS_ENV:=development} rails $PARAMS"
|
||||
docker exec -it -u discourse:discourse discourse_dev /bin/bash -c "$CMD"
|
||||
exec "$(dirname "$0")/exec" bin/rails "$@"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
PARAMS="$@"
|
||||
CMD="cd /src && USER=discourse RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 LD_PRELOAD=/usr/lib/libjemalloc.so RAILS_ENV=${RAILS_ENV:=development} bundle exec rake $PARAMS"
|
||||
docker exec -it -u discourse:discourse discourse_dev /bin/bash -c "$CMD"
|
||||
exec "$(dirname "$0")/exec" bin/rake "$@"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
PARAMS="$@"
|
||||
CMD="cd /src && USER=discourse RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 LD_PRELOAD=/usr/lib/libjemalloc.so RAILS_ENV=${RAILS_ENV:=test} bin/rspec $PARAMS"
|
||||
docker exec -it -u discourse:discourse discourse_dev /bin/bash -c "$CMD"
|
||||
exec "$(dirname "$0")/exec" bin/rspec "$@"
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
#!/bin/bash
|
||||
docker exec -it -u discourse:discourse discourse_dev /bin/bash
|
||||
|
||||
exec "$(dirname "$0")/exec" /bin/bash "$@"
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
#!/bin/bash
|
||||
docker exec -it discourse_dev /bin/bash
|
||||
|
||||
exec docker exec -it discourse_dev /bin/bash
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
PARAMS="$@"
|
||||
CMD="cd /src && USER=discourse RAILS_ENV=${RAILS_ENV:=development} bundle exec sidekiq -q critical -q low -q default -q ultra_low"
|
||||
docker exec -it -u discourse:discourse discourse_dev /bin/bash -c "$CMD"
|
|
@ -1,10 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
PARAMS="$@"
|
||||
if [[ $# = 1 ]] && [[ "$1" =~ "s" ]];
|
||||
then
|
||||
PARAMS="$PARAMS -b 0.0.0.0"
|
||||
fi
|
||||
|
||||
CMD="cd /src && USER=discourse RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 LD_PRELOAD=/usr/lib/libjemalloc.so RAILS_ENV=${RAILS_ENV:=development} bin/unicorn $PARAMS"
|
||||
docker exec -it -u discourse:discourse discourse_dev /bin/bash -c "$CMD"
|
||||
exec "$(dirname "$0")/exec" bin/unicorn "$@"
|
||||
|
|
Loading…
Reference in New Issue
Block a user