Deploy your code to a dokku(-alt) host. (All further mentioning of dokku also applies to dokku-alt)
You should generate a private/public key pair on wercker and manually add the public key to the dokku host.
- Generate a new key in wercker in the
Key management
section (application
-settings
). - Copy the public key and add it on the intended dokku host.
- for dokku this could be something like
cat $wercker.pub | ssh dokku-host "sudo sshcommand acl-add dokku $USER"
- for dokku-alt this could be something like
cat $wercker.pub | ssh dokku@dokku-host deploy:allow $app-name
- for dokku this could be something like
- In wercker edit the dokku deploy target to which you would like to deploy, and add an environment variable:
- Give the environment variable a name (remember this name, you will need it in the last step).
- Select
SSH Key pair
as the type and select the key pair which you created earlier.
- In the
dokku-deploy
step in yourwercker.yml
add thekey-name
property with the value you used earlier:
deploy:
steps:
- gekkie/dokku-deploy@0.0.2:
app-name: your-app-name-on-the-host
host: the-dokku-host
key-name: your-key-as-registered-with-wercker
In the above example the MY_DEPLOY_KEY
should match the environment variable name you used in wercker. Note: you should not prefix it with a dollar sign or post fix it with _PRIVATE
or _PUBLIC
.
host-public-key
(optional) This is the public key for the host your deploying to. If left out this will ignore the host public key. Important: Leaving this out might be seen as a security risk due to the fact that host key checking will be disabled leaving your app open for MITM attacks via DNS tainting.retry
(optional) When a deploy to dokku fails, a new deploy is automatically performed after 5 seconds. If you want to disable this behavior, setretry
tofalse
.keep-repository
(optional) This will allow a user to keep the original history of the repository, speeding up deployment. Important: changes made during the build will not be deployed. Also keep in mind that deploying an already up to date repo will not result in an application restart. Use therun
parameter to forcibly reload to achieve this. This feature is considered beta, expect issues. If you find one, please contact us.
deploy:
steps:
- gekkie/dokku-deploy@0.0.2:
app-name: node-example
host: dokkuhost.com
key-name: my-node-example-dokku-host-key
The MIT License (MIT)
- reverted previous naming change.
- updated the various environment variables to reflect the naming scheme
owner_step_param
- disabled testing by empty function
- disabled the testing of the authentication, i cant get it to work.
- use the identity provided by wercker for testing authentication
- rearranged the setting of authentication before testing it ;)
- Added the option of passing in the public key for the deploy-host
- just added a few keywords
- I left a superfluous remnant of the heroku-api key requirement. This has been removed. Also updated the docs for more clarity.
- Initial release based of the excellent work already done by wercker themselves as the heroku-deploy-step.