crisward / dokku-clone

a dokku plugin for building an app from a cloned git repo
48 stars 9 forks source link

Deploy a specific commit? #3

Closed julienma closed 8 years ago

julienma commented 8 years ago

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?

crisward commented 8 years ago

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

crisward commented 8 years ago

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.

julienma commented 8 years ago

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.

crisward commented 8 years ago

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

crisward commented 8 years ago

Readme updated