Skip to content

Instantly share code, notes, and snippets.

@gcpantazis
Created June 12, 2014 21:57
Show Gist options
  • Save gcpantazis/d7db6cda8b582763403d to your computer and use it in GitHub Desktop.
Save gcpantazis/d7db6cda8b582763403d to your computer and use it in GitHub Desktop.
Drone setup for deploying every branch to Dokku
#!/bin/bash
if [ $DRONE_BRANCH ]; then
git fetch --unshallow
git remote remove dokku
git remote add dokku dokku@foo.dokkuhost.com:project-bar-$DRONE_BRANCH
git push dokku $DRONE_BRANCH:master
fi
image: phusion/passenger-full
script:
- sudo apt-get update
- gem install sass
- npm config set loglevel warn
- npm install -g grunt-cli
- npm install
- npm test
deploy:
bash:
command: './deploy'
@gcpantazis
Copy link
Author

git fetch --unshallow is necessary, as the first push to a new feature branch will attempt to push to an empty repo on dokku. Subsequently it isn't necessary, so you could theoretically improve this by checking the dokku remote before fetching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment