By default, code for Dash apps deployed to Dash Enterprise is stored in Gitea, which runs within the Dash Enterprise namespace.
Administrators with access to the Dash Enterprise Helm chart can integrate Dash Enterprise with their GitHub organization. This must be done at the Dash Enterprise installation time (in the future, it may be possible to integrate GitHub after a complete Dash Enterprise installation). With GitHub integrated, the code for Dash apps lives in GitHub repositories belonging to the integrated organization instead of in Gitea.
Dash Enterprise does not support storing code in both Gitea and GitHub.
Support for other Git-based version control platforms may be added in the future.
When GitHub is integrated with Dash Enterprise, a webhook detects when code is pushed to GitHub and triggers and build and deploy of the app on Dash Enterprise. Actions that push code include local git commands, pull request merges, as well as deploys initiated from Dash Enterprise (such as one-click deploy in workspaces).
Dash Enterprise respects the rules for the GitHub repositories that code is stored in. For example, users with no write access to the repository cannot push code to it from Dash Enterprise.
Integrating GitHub with Dash Enterprise changes how developers initialize and deploy apps.
kubectl access to the Kubernetes cluster where Dash Enterprise is installed.First, you’ll create a GitHub App in your GitHub organization that will handle the connection between Dash Enterprise and your GitHub organization.
To create and configure the GitHub App:
In Homepage URL, enter your Dash Enterprise URL.
<img>
Go to the Identifying and authorizing users section and configure the parameters as follows:
https://api-<your-domain>/v1/git-callback (substituting <your-domain> for your Dash Enterprise base domain).<img>
https://api-<your-domain>/v1/git-webhook (substituting <your-domain> for your Dash Enterprise base domain).In Secret, enter a secure string. (Store it for later).
Tip: You can generate a random secure string with
openssl rand -hex 32.
<img>
Go to the Permissions section and do the following:
Set Members to Read-only (required for obtaining and validating organization member information).
Go to the Subscribe to events section and select Push (required for triggering app builds on Dash Enterprise).
Select Create GitHub App. You are taken to the newly created App.
<img>
https://github.com/settings/installations/<installation-id>). You’ll need it in a later step.To generate required secrets for the GitHub App:
.pem file and store it securely for later use.Must be done after the Dash Enterprise namespace is created in the cluster.
In this step, you’ll create a Kubernetes secret in the cluster where Dash Enterprise is installed. This secret is namespace-scoped and contains sensitive information about the GitHub App.
To create the secret:
kubectl create secret generic github-app \
--namespace=$NAMESPACE \
--from-literal=GITHUB_WEBHOOK_SECRET="<github-app-webhook-secret>" \
--from-literal=GITHUB_CLIENT_SECRET="<github-app-client-secret>" \
--from-file=GITHUB_APP_PRIVATE_KEY="<github-app-private-key-path>"
where:
<github-app-webhook-secret> is the webhook secret that you defined when configuring the GitHub App.<github-app-client-secret> is the GitHub App client secret that you generated in the previous step.<github-app-private-key-path> is the absolute or relative path to the GitHub App private key file that you downloaded in the previous step.Verify with:
kubectl get secret github-app -n $NAMESPACE -o yaml
Must be done after the Dash Enterprise namespace is created in the cluster.
In this step, you’ll create a ConfigMap in the cluster where Dash Enterprise is installed. This ConfigMap is namespace-scoped and contains non-sensitive information about the GitHub App.
To create the ConfigMap:
kubectl create configmap github-app \
--namespace=$NAMESPACE \
--from-literal=GITHUB_CLIENT_ID="<github-app-client-id>" \
--from-literal=GITHUB_INSTALLATION_ID="<github-app-installation-id>"
where:
<github-app-client-id> is the client ID displayed in the GitHub App settings.<github-app-installation-id> is the ID that you copied after installing the GitHub App.Verify with:
kubectl get configmap github-app -n $NAMESPACE -o yaml
GitHub integration is disabled for Dash Enterprise by default. It needs to be enabled at installation time.
Note that with GitHub integration enabled, Gitea will still be installed unless --set gitea.enabled=false is set in the helm install command. It is safe to keep Gitea in the Dash Enterprise namespace, but administrators who prefer to minimize Dash Enterprise’s footprint in the cluster should disable it.
To enable GitHub integration at installation time:
values.yml file from the Helm chart if you haven’t already.values.yml file that you’ll use for overriding the default values (again, if you haven’t already). You can call it something like values-custom.yml.true:yml
# -- Enable GitHub integration
deGithubIntegrationEnabled: trueFind the following lines and make sure that the names for the Kubernetes secret and ConfigMap match what you created in the previous steps. If you used different names for the Kubernetes secret and ConfigMap, edit the names here.
yml
# GitHub app configuration
githubApp:
# -- Name of secret containing GITHUB_CLIENT_ID, GITHUB_INSTALLATION_ID
existingSecret: "github-app"
# -- Name of config containing GITHUB_APP_PRIVATE_KEY, GITHUB_CLIENT_SECRET
existingConfigmap: "github-app"
Continue with your installation.
de deploy is not supported (git commands are).git checkout <branch>) to use one-click deploy. Otherwise, one-click deploy fails with an error similar tosh
error: src refspec detached does not match any
error: src refspec from does not match any
error: failed to push some refs to 'https://github.com/<github-org>/<repo>'