crisward / dokku-clone

a dokku plugin for building an app from a cloned git repo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deploy a specific commit?

julienma opened this issue · comments

Hey,
It seems that this always build the head of the master branch.
Is there any way to specify a specific commit / tag / release to be deployed?

There isn't at the moment, but it sounds like a reasonable request.
I'll take a look and see what I can do.

I've added a third parameter to dokku clone. I've tested this with this repo

# get version 1
 dokku clone nodetest git@github.com:crisward/node-js-sample.git 1.0.0
# get version 1.1
 dokku clone nodetest git@github.com:crisward/node-js-sample.git 1.1.0

This works by passing the third parameter, if present into the git clone --branch command.
This apparently works with branches, tags and sha1 refernce etc. Though I've only tested it with tags.

Let me know how you get on, I'll update the readme when you confirm this works ok. The branch you pull gets merged into master on your dokku server as dokku only supports master branches. But that shouldn't make a difference unless you're cloning from dokku.

Thanks @crisward, this works fine with tags and branches.
I couldn't get it working with a commit SHA1 though, but that's an edge-case anyway.

I'll update the readme, thanks for the suggestion and testing.

Readme updated