Skip to content

Heroku buildpack for setting a private git SSH key as part of the application build

Notifications You must be signed in to change notification settings

poetic-labs/git-ssh-key-buildpack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

git-ssh-key-buildpack

A Heroku buildpack for setting a private git SSH key as part of the application build. Particularly useful for granting Heroku access to installing a private git repository as a dependency.

Configuration

  1. Set up a deploy/access key with GitHub, GitLab, or BitBucket.

  2. Once you've generated the SSH key, configure the Heroku environment variable GIT_SSH_KEY (note that the key needs to be base64 encoded):

    $ heroku config:set GIT_SSH_KEY=$(cat path/to/your/keys/id_rsa | base64)
  3. Configure the Heroku environment variable GIT_SSH_HOST based on your host. That is, github.com, gitlab.com, bitbucket.org, or maybe a hosted instance of GitLab:

    $ heroku config:set GIT_SSH_HOST="example.com"
  4. Add the buildpack to Heroku using either the CLI or the dashboard. It will need to run before any buildpack trying to get SSH access. In the following example, it runs before the heroku/nodejs buildpack:

    $ heroku buildpacks:set --index 1 https://github.com/poetic-labs/git-ssh-key-buildpack.git
    $ heroku buildpacks:add heroku/nodejs

About

Heroku buildpack for setting a private git SSH key as part of the application build

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages