This article pertains to non-Dokku environments.

If deployment via git is configured for your environment, refer to the following instructions for getting started.

Configuring a local git remote

On your development machine, define a new git remote:   

git remote add hcb ssh://USERNAME@MACHINE_ID.healthcareblocks.com/data/apps/APP_NAME/deploy.git

Commit all local code changes and push:

git push hcb master

Configuration for multiple servers

If you are deploying to a cluster, simply add another remote as a child of the first one:  

git remote set-url --add hcb ssh://USERNAME@MACHINE_ID.healthcareblocks.com/data/apps/APP_NAME/deploy.git

Deployment hooks

A git deployment executes a post receive script (/data/apps/APP_NAME/deploy.git/.git/hooks/post-receive). This script preserves the last few deployments (for easy rollback) and restarts the application server. For specific stacks like Ruby on Rails, the hook also compiles assets. To insert a custom build step into this process, you can add a bash script named /data/apps/APP_NAME/shared/config/build_script. If you need assistance modifying the behavior of the deployment process, please contact us for assistance.