Code for Deploying the SAP LeanIX GitHub Agent
Sample docker-compose
code and environment variables.
Sample Code
The snippet below provides sample docker-compose
code.
Caution
Copy the
docker-compose
code from your workspace, not from the sample provided here.
version: '3.8'
services:
github-agent:
image: ghcr.io/leanix/leanix-github-agent:v0.1.0
platform: linux/amd64
ports:
- "8080:8080"
environment:
- GITHUB_ENTERPRISE_BASE_URL=https://your-url
- GITHUB_APP_ID={{App id which can be found in the GitHub App page}}
- PEM_FILE=/privateKey.pem
- LEANIX_DOMAIN={{YOUR-SUBDOMAIN}}.leanix.net
- LEANIX_TECHNICAL_USER_TOKEN={{Administrator token generated by EAM}}
volumes:
- {{Location of the pem key downloaded from the GitHub app page}}:/privateKey.pem
Environment Variables
The table below lists environment variables used in the docker-compose
code.
Variable | Description | Required | Example |
---|---|---|---|
GITHUB_ENTERPRISE_BASE_URL | The base URL of your GitHub Enterprise instance. | Required | https://your-url |
GITHUB_APP_ID | The ID of the GitHub App used for authentication. You can find the ID in the admin panel. | Required | 1234134 |
PEM_FILE | The path to the PEM file within the container. | Required | /privateKey.pem |
LEANIX_DOMAIN | The domain where your SAP LeanIX workspace is hosted, which is used to sync data to the workspace. Copy the domain from the workspace URL. | Required | For a workspace with the following URL https://demo-eu-2.leanix.net/Acme-corp , the domain is demo-eu-2.leanix.net . |
LEANIX_TECHNICAL_USER_TOKEN | An API token associated with a technical user with admin permissions, which is required to authenticate to your SAP LeanIX workspace. For instructions, see Technical Users. | Required | API token generated in SAP LeanIX by creating a technical user |
WEBHOOK_SECRET | A webhook secret set in the GitHub setup, which is used to sign and verify webhooks sent from the GitHub instance received at the agent. Creating a secret is recommended for additional security. To learn more about webhook secrets, refer to the GitHub documentation. | A hash | |
volumes | Mounts the local PEM file to the container. The file specified by the location of the PEM key downloaded from the GitHub App page on the host machine is accessible at /privateKey.pem within the container. | Downloads/github-private-key.pem:/privateKey.pem |
Updated 2 days ago