Merge pull request #1789 from lvillani/skip-deploy
Make it possible to skip a deploy
This commit is contained in:
commit
32f1bc5396
2 files changed
+23
-4
No files matched your search
@@ -126,6 +126,14 @@ Dokku only supports deploying from its master branch, so if you'd like to deploy
|
|||||||
|
|
||||||
You can also support pushing multiple branches using the [receive-branch](/dokku/development/plugin-triggers/#receive-branch) plugin trigger in a custom plugin.
|
You can also support pushing multiple branches using the [receive-branch](/dokku/development/plugin-triggers/#receive-branch) plugin trigger in a custom plugin.
|
||||||
|
|
||||||
|
### Skipping deployment
|
||||||
|
|
||||||
|
If you only want to rebuild and tag a container, you can skip the deployment phase by setting `$DOKKU_SKIP_DEPLOY` to `true` by running:
|
||||||
|
|
||||||
|
``` shell
|
||||||
|
dokku config:set ruby-rails-sample DOKKU_SKIP_DEPLOY=true
|
||||||
|
```
|
||||||
|
|
||||||
### Deploying with private git submodules
|
### Deploying with private git submodules
|
||||||
|
|
||||||
Dokku uses git locally (i.e. not a docker image) to build its own copy of your app repo, including submodules. This is done as the `dokku` user. Therefore, in order to deploy private git submodules, you'll need to drop your deploy key in `/home/dokku/.ssh/` and potentially add github.com (or your VCS host key) into `/home/dokku/.ssh/known_hosts`. The following test should help confirm you've done it correctly.
|
Dokku uses git locally (i.e. not a docker image) to build its own copy of your app repo, including submodules. This is done as the `dokku` user. Therefore, in order to deploy private git submodules, you'll need to drop your deploy key in `/home/dokku/.ssh/` and potentially add github.com (or your VCS host key) into `/home/dokku/.ssh/known_hosts`. The following test should help confirm you've done it correctly.
|
||||||
|
|||||||
@@ -316,12 +316,23 @@ release_and_deploy() {
|
|||||||
IMAGE_SOURCE_TYPE="dockerfile"
|
IMAGE_SOURCE_TYPE="dockerfile"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
DOKKU_APP_SKIP_DEPLOY="$(dokku config:get $APP DOKKU_SKIP_DEPLOY || true)"
|
||||||
|
DOKKU_GLOBAL_SKIP_DEPLOY="$(dokku config:get --global DOKKU_SKIP_DEPLOY || true)"
|
||||||
|
|
||||||
|
DOKKU_SKIP_DEPLOY=${DOKKU_APP_SKIP_DEPLOY:="$DOKKU_GLOBAL_SKIP_DEPLOY"}
|
||||||
|
|
||||||
dokku_log_info1 "Releasing $APP ($IMAGE)..."
|
dokku_log_info1 "Releasing $APP ($IMAGE)..."
|
||||||
dokku release "$APP" "$IMAGE_SOURCE_TYPE" "$IMAGE_TAG"
|
dokku release "$APP" "$IMAGE_SOURCE_TYPE" "$IMAGE_TAG"
|
||||||
dokku_log_info1 "Deploying $APP ($IMAGE)..."
|
|
||||||
dokku deploy "$APP" "$IMAGE_TAG"
|
if [[ "$DOKKU_SKIP_DEPLOY" != "true" ]]; then
|
||||||
dokku_log_info2 "Application deployed:"
|
dokku_log_info1 "Deploying $APP ($IMAGE)..."
|
||||||
dokku urls $APP | sed "s/^/ /"
|
dokku deploy "$APP" "$IMAGE_TAG"
|
||||||
|
dokku_log_info2 "Application deployed:"
|
||||||
|
dokku urls $APP | sed "s/^/ /"
|
||||||
|
else
|
||||||
|
dokku_log_info1 "Skipping deployment"
|
||||||
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user