feat: flesh out git plugin further

- add `report` and `set` subcommands to the git plugin
- move configuring the DOKKU_DEPLOY_BRANCH to the git plugin
- implement configurable GIT_REV support
- migrate DOKKU_DEPLOY_BRANCH settings
- add a golang-compatible, shell based method of setting plugin configuration variables

Deprecates the community dokku-git-rev plugin.

Closes #2621
Refs dokku-community/dokku-git-rev#9
This commit is contained in:
Jose Diaz-Gonzalez
2018-03-11 20:03:11 -04:00
parent 776226d0d8
commit d67e883e13
14 changed files with 425 additions and 71 deletions

View File

@@ -15,7 +15,7 @@ git clone git@github.com:heroku/ruby-rails-sample.git
Create the application on the Dokku host. You will need to ssh onto the host to run this command.
```shell
# on your Dokku host
# on the Dokku host
dokku apps:create ruby-rails-sample
```
@@ -24,7 +24,7 @@ dokku apps:create ruby-rails-sample
When you create a new app, Dokku by default *does not* provide any datastores such as MySQL or PostgreSQL. You will need to install plugins to handle that, but fortunately [Dokku has official plugins](/docs/community/plugins.md#official-plugins-beta) for common datastores. Our sample app requires a PostgreSQL service:
```shell
# on your Dokku host
# on the Dokku host
# install the postgres plugin
# plugin installation requires root, hence the user change
sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git
@@ -40,7 +40,7 @@ dokku postgres:create rails-database
Once the service creation is complete, set the `POSTGRES_URL` environment variable by linking the service.
```shell
# on your Dokku host
# on the Dokku host
# each official datastore offers a `link` method to link a service to any application
dokku postgres:link rails-database ruby-rails-sample
```
@@ -93,30 +93,12 @@ When the deploy finishes, the application's URL will be shown as seen above.
Dokku supports deploying applications via [Heroku buildpacks](https://devcenter.heroku.com/articles/buildpacks) with [Herokuish](https://github.com/gliderlabs/herokuish#buildpacks) or using a project's [dockerfile](https://docs.docker.com/reference/builder/).
### Deploying non-master branch
Dokku only supports deploying from its master branch, so if you'd like to deploy a different local branch use: ```git push dokku <local branch>:master```
An alternative is to use the `DOKKU_DEPLOY_BRANCH` application config value to specify a branch that should be deployed. The implicit default is master, and this can be modified both at the app and global level:
```shell
# on your Dokku host
# set it globally
dokku config:set --global DOKKU_DEPLOY_BRANCH=some-branch
# override for a specific app
dokku config:set ruby-rails-sample DOKKU_DEPLOY_BRANCH=some-branch
```
You can also support pushing multiple branches using the [receive-branch](/docs/development/plugin-triggers.md#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
# on your Dokku host
# on the Dokku host
dokku config:set ruby-rails-sample DOKKU_SKIP_DEPLOY=true
```
@@ -125,7 +107,7 @@ dokku config:set ruby-rails-sample DOKKU_SKIP_DEPLOY=true
If you need to re-deploy (or restart) your app:
```shell
# on your Dokku host
# on the Dokku host
dokku ps:rebuild ruby-rails-sample
```
@@ -136,7 +118,7 @@ See the [process scaling documentation](/docs/deployment/process-management.md)
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.
```shell
# on your Dokku host
# on the Dokku host
su - dokku
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
ssh -T git@github.com
@@ -202,18 +184,22 @@ See the [user management documentation](/docs/deployment/user-management.md).
See the [nginx documentation](/docs/configuration/nginx.md#default-site).
## Deploying non-master branch
See the [git documentation](/docs/deployment/methods/git.md#changing-the-deploy-branch).
## Dockerfile deployment
See the [dockerfile documentation](/docs/deployment/methods/dockerfiles.md).
## Specifying a custom buildpack
See the [buildpack documentation](/docs/deployment/methods/buildpacks.md).
## Image tagging
See the [image tagging documentation](/docs/deployment/methods/images.md).
## Specifying a custom buildpack
See the [buildpack documentation](/docs/deployment/methods/buildpacks.md).
## Removing a deployed app
See the [application management documentation](/docs/deployment/application-management.md#removing-a-deployed-app).