Use custom deployment repo with default branch
Closed this issue · 2 comments
Hi everyone,
I'm currently moving all the ops logic away from the code repo in a separate one, to ease it's maintenance and avoid unpredictable differences between deployed branches.
What I was planning to do is set up a new repo in Samson project, which will contain deployment config (Capistrano). This repo should only have 1 (master
) branch, that would be checked out to execute deployment.
However, the deployed branch, transmitted to Capistrano as REVISION env variable, would have to be different.
From what I can see in the code, it is not possible to dissociate the revisions of the repo used to do the deployment and the actual revision being deployed by Capistrano (or any other tool).
Is there currently a way in Samson to address this?
Thanks!
what we usually do is deploy the main repo, but use the commands in samson to clone the other repo instead (from master) and then deploy them together
export REPO_BRANCH=${REPO_BRANCH:-master}
mkdir -p tmp && git clone --branch ${REPO_BRANCH} git@github.com:foo/deployments-stuff.git tmp/deployments-stuff
cd tmp/deployments-stuff && git rev-parse HEAD && cd -
... do stuff with deployment stiff
Looks great, thanks Michael @grosser!