Configuration
This page explains the available options to configure Runbooks with your git server.
To start, make sure to install the hoop command line and login to your gateway instance:
hoop config create --api-url https://<API_URL>
hoop login
Public Repositories
To configure any public repositories
hoop admin create plugin runbooks --overwrite \
-c GIT_URL=https://github.com/your-org/your-repo
Required Configuration:
GIT_URL
(required) - the GIT URL of the repository (http or ssh)
Basic Credentials
It uses username and password to clone a repository via HTTP.
hoop admin create plugin runbooks --overwrite \
-c GIT_URL=https://github.com/your-org/your-repo \
-c GIT_PASSWORD=your-personal-access-token
Required Configuration:
GIT_URL
(required) - the HTTP GIT URL of the repositoryGIT_USER
(optional) - the git username, defaults tooauth2
if it’s emptyGIT_PASSWORD
(required) - the password or token that has read access to the repository
GitHub users could use personal tokens
SSH Private Keys
It uses a private key to clone the repository via SSH.
hoop admin create plugin runbooks --overwrite \
-c GIT_URL=git@github.com:your-org/your-repo.git \
-c GIT_SSH_KEY=path:$HOME/.ssh/your_key
GitHub users could follow the Setup Deploy Keys guide to generate a key.
Required Configuration:
GIT_URL
(required) - the HTTP GIT URL of the repositoryGIT_SSH_KEY
(required) - the private key that has read access to the repositoryGIT_SSH_USER
(optional) - the git username, defaults togit
if it’s emptyGIT_SSH_KEYPASS
(optional) - the password of the keyGIT_SSH_KNOWN_HOSTS
(optional) - the path to the known hosts file to use
We recoommend using the option GIT_SSH_KNOWN_HOSTS
to prevent MITM when cloning repositories.
Testing
To test the integration, issue the command below, it will return the last commit from the directory. When you add a runbook file it will show in the items attribute.
hoop admin get runbooks -o json
{"items":[],"commit":"<git-sha>","commit_author":"author <author@email.tld>","commit_message":"<msg>\n"}