这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions dokku
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,8 @@ case "$1" in
deploy)
APP="$2"; IMAGE="$3"
pluginhook pre-deploy $APP $IMAGE

# kill the app when running
if [[ -f "$DOKKU_ROOT/$APP/PORT" ]]; then
oldid=$(< "$DOKKU_ROOT/$APP/CONTAINER")
docker kill $oldid > /dev/null
fi

# start the app
id=$(docker run -d -p 5000 -e PORT=5000 $IMAGE /bin/bash -c "/start web")
echo $id > "$DOKKU_ROOT/$APP/CONTAINER"
port=$(docker port $id 5000 | sed 's/0.0.0.0://')
echo $port > "$DOKKU_ROOT/$APP/PORT"
echo "http://$(< "$DOKKU_ROOT/HOSTNAME"):$port" > "$DOKKU_ROOT/$APP/URL"

pluginhook post-deploy $APP $port
pluginhook run-deploy $APP $IMAGE
pluginhook post-deploy $APP $(< "$DOKKU_ROOT/$APP/PORT")
;;

cleanup)
Expand Down
3 changes: 3 additions & 0 deletions plugins/01_dokku-deploy/commands
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -eo pipefail
cat
18 changes: 18 additions & 0 deletions plugins/01_dokku-deploy/run-deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -eo pipefail

APP="$1"
IMAGE="$2"

# kill the app when running
if [[ -f "$DOKKU_ROOT/$APP/PORT" ]]; then
oldid=$(< "$DOKKU_ROOT/$APP/CONTAINER")
docker kill $oldid > /dev/null
fi

# start the app
id=$(docker run -d -p 5000 -e PORT=5000 $IMAGE /bin/bash -c "/start web")
echo $id > "$DOKKU_ROOT/$APP/CONTAINER"
port=$(docker port $id 5000 | sed 's/0.0.0.0://')
echo $port > "$DOKKU_ROOT/$APP/PORT"
echo "http://$(< "$DOKKU_ROOT/HOSTNAME"):$port" > "$DOKKU_ROOT/$APP/URL"
2 changes: 0 additions & 2 deletions plugins/config/commands
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ case "$1" in
APP="$2"; APP_DIR="$DOKKU_ROOT/$APP"
ENV_ADD=""
ENV_TEMP=`cat "${ENV_FILE}"`
ID=$(< "$APP_DIR/CONTAINER")
RESTART=false
VARS="${*:3}"

Expand Down Expand Up @@ -151,7 +150,6 @@ case "$1" in

APP="$2"; APP_DIR="$DOKKU_ROOT/$APP"
ENV_TEMP=`cat "${ENV_FILE}"`
ID=$(< "$APP_DIR/CONTAINER")
VARS="${*:3}"

for var in $VARS; do
Expand Down