Currently my deployment looks as follows:
After committing local changes, I run locally a grunt task to build the project into a
/dist
folder.Then I push them to bitbucket. e.g. branch name is feature/deposit
In Bitbucket I merge feature/deposit into develop branch and Codeship builds develop branch (runs test) and after that the following code is executed:
ssh nodejs@12.345.67.891 'cd project/www; git checkout develop; git pull origin develop; npm install; sudo monit restart project.app.js'
I do not like this approach, because for me it would make much more sense that I deploy what Codeship built. Codeship runs npm install
, and I want it to run my grunt:build
task and then deploy it to my production server.
I found an article addressing a similar issue and added export CI_COMMIT_ID=$(git rev-parse HEAD) task. But I just do not fully realise what I need to do with it in my deployment script. Besides this example is used with heroku whereas in my case I use custom deployment script.
I also found a github repo with useful deployment scrips and this one might suit my needs.
But what I want to figure out is if I can pull from the built version (the one that Codeship built) in a same fashion as I do it now, but
git pull origin develop
should be git pull
from what Codeship just built