diff --git a/content/en/includes/plugins/github/accounts-config-example.md b/content/en/includes/plugins/github/accounts-config-example.md new file mode 100644 index 0000000000..5e918dffb3 --- /dev/null +++ b/content/en/includes/plugins/github/accounts-config-example.md @@ -0,0 +1,29 @@ +In this example, you have `company-public` and `company-private` GitHub organizations, so you created two GitHub Apps, one for each org. +* You installed the GitHub App for the `company-private` org with access to all repos in the org. +* You installed the GitHub App for the `company-public` org with access to two specific repos in the org. + +Your `accounts` config looks like this: + +```yaml +github: + plugin: + accounts: + - name: FirstAppRepo + organization: company-public + repository: first-app-repo + defaultBranch: master + githubAppId: 9753 + githubAppPrivateKey: encrypted:k8s!n:spin-secrets!k:github-company-public-token + - name: SecondAppRepo + organization: company-public + repository: second-app-repo + defaultBranch: main + githubAppId: 9753 + githubAppPrivateKey: encrypted:k8s!n:spin-secrets!k:github-company-public-token + - name: CompanyPrivateOrgAllRepos + organization: company-private + orgWide: true + defaultBranch: main + githubAppId: 1357 + githubAppPrivateKey: encrypted:k8s!n:spin-secrets!k:github-company-private-token +``` \ No newline at end of file diff --git a/content/en/includes/plugins/github/compat-matrix.md b/content/en/includes/plugins/github/compat-matrix.md new file mode 100644 index 0000000000..e5a1ff7f1d --- /dev/null +++ b/content/en/includes/plugins/github/compat-matrix.md @@ -0,0 +1,3 @@ +| Armory CD Version | Spinnaker Version | GitHub API Plugin Version | +|:----------------- |:----------------- | :------------------------ | +| 2.30.x | 1.30.x | 1.0.0 | \ No newline at end of file diff --git a/content/en/includes/plugins/github/install-reqs.md b/content/en/includes/plugins/github/install-reqs.md new file mode 100644 index 0000000000..93c3e245ca --- /dev/null +++ b/content/en/includes/plugins/github/install-reqs.md @@ -0,0 +1,15 @@ +* You have read the GitHub API Plugin [overview]({{< ref "plugins/github-api/_index.md" >}}). +* You are familiar with [GitHub Apps](https://docs.github.com/en/apps/overview). +* You need to create and install a GitHub App that interacts with the GitHub API plugin. + + 1. Create a GitHub App. Follow the instructions in GitHub's [Registering a GitHub App](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app) guide. + + * Provide values for **GitHub App name**. **Homepage URL**, and **Repository permissions**. You _do not_ need to fill out the **Identifying and authorizing users**, **Post installation**, or **Webhook** sections. + * Your GitHub App should have the following **Repository permissions**: + + * **Actions**: `Read and write` + * **Contents**: `Read and write` + * **Deployments**: `Read and write` + * **Metadata**: `Read-only` + + 1. Install the GitHub App you created either in a specific repo or organization-wide. Follow the instructions in GitHub's [Installing your own GitHub App](https://docs.github.com/en/apps/using-github-apps/installing-your-own-github-app) guide. diff --git a/content/en/includes/plugins/github/plugin-config.md b/content/en/includes/plugins/github/plugin-config.md new file mode 100644 index 0000000000..877f3ba9c1 --- /dev/null +++ b/content/en/includes/plugins/github/plugin-config.md @@ -0,0 +1,49 @@ + +* `version`: Replace `` with the plugin version compatible with your Spinnaker version. +* `accounts`: Configure the GitHub location(s) where you installed the GitHub App you created. The configuration differs depending on whether you installed the GitHub App organization-wide or with access to individual repositories. + +{{< tabpane text=true right=true >}} +{{% tab header="**Account Config**:" disabled=true /%}} +{{% tab header="Individual Repo" %}} + +```yaml +- name: + organization: + repository: + defaultBranch: + githubAppId: + githubAppPrivateKey: +``` + +All fields are required. + +* `name`: Unique name; this name appears in the GitHub API stages' `GitHub Account` select list. +* `organization`: GitHub organization that you installed the GitHub App in +* `repository`: The GitHub repository to access +* `defaultBranch`: Default repository branch; for example, main or master +* `githubAppId`: The GitHub App's **App ID** +* `githubAppPrivateKey`: The GitHub App's private key; this field supports encrypted field references; see [Work with Secrets in Spinnaker]({{< ref "continuous-deployment/armory-admin/secrets" >}}) for details. + +{{% /tab %}} +{{% tab header="All Repos in Org" %}} + +```yaml +- name: + organization: + orgWide: true + defaultBranch: + githubAppId: + githubAppPrivateKey: +``` + +All fields are required. + +* `name`: Unique name; this name appears in the GitHub API stages' `GitHub Account` select list. +* `organization`: GitHub organization that you installed the GitHub App in +* `orgWide`: `true` +* `defaultBranch`: Default repository branch; for example, main or master +* `githubAppId`: The GitHub App's **App ID** +* `githubAppPrivateKey`: The GitHub App's private key; this field supports encrypted field references; see [Work with Secrets in Spinnaker]({{< ref "continuous-deployment/armory-admin/secrets" >}}) for details. + +{{% /tab %}} +{{< /tabpane >}} \ No newline at end of file diff --git a/content/en/plugins/github-api/_index.md b/content/en/plugins/github-api/_index.md index d4cef79b87..cf2bf054fc 100644 --- a/content/en/plugins/github-api/_index.md +++ b/content/en/plugins/github-api/_index.md @@ -3,22 +3,20 @@ title: GiHub API Plugin for Spinnaker linkTitle: GitHub API no_list: true description: > - TBD + Armory's GitHub API Plugin provides features that enable engineers to trigger Spinnaker pipelines from GitHub workflows, update GitHub deployment status based on pipeline outcome, and view GitHub Action logs in Spinnaker. --- -## What the GitHub API plugin does +## GitHub API Plugin features -Spinnaker is not offering a native integration with GitHub actions as it does with other CI systems like Jenkin, Gitlab CI, Travis, etc. +The GitHub API Plugin provides GitHub integration features that Spinnaker lacks: -By using the GitHub API plugin, we offer you multiple integration points between GitHub and Spinnaker: - -- Spinnaker stages to trigger GitHub workflows using **workflow_dispatch** or **repo_dispatch** events -- Monitor GH workflow and finish the pipeline execution based on the GitHub Workflow conclusion +- Trigger a Spinnaker pipeline from a GitHub workflow using **workflow_dispatch** or **repo_dispatch** events - Trigger a Spinnaker pipeline automatically when a GitHub workflow finishes successfully - Trigger a Spinnaker pipeline when a new GitHub Deployment is created +- Monitor a GitHub workflow and finish pipeline execution based on the GitHub workflow result - Update GitHub deployment status based on Spinnaker pipeline conclusion -- View Github Action Logs in Spinnaker, meaning there is no need to navigate to GitHub to view the logs +- View Github Action Logs in Spinnaker -- there is no need to navigate to GitHub to view the logs All the integration points mentioned above use the concept of GitHub Apps. @@ -61,5 +59,35 @@ orca ->> gh: "Deployment status update: in_progress, success, failure, or error" ## Compatibility matrix +{{< include "plugins/github/compat-matrix.md" >}} + +## Installation paths + +{{% cardpane %}} +{{% card header="Armory CD
Armory Operator" %}} +Use a Kustomize patch to install the plugin. + +1. Create a GitHub App and install it in your repo. +1. Install the plugin using the Armory Operator. + +[Instructions]({{< ref "plugins/github-api/install/armory-cd" >}}) +{{% /card %}} + +{{% card header="Spinnaker
Spinnaker Operator" %}} +Use a Kustomize patch to install the plugin. + +1. Create a GitHub App and install it in your repo. +1. Install the plugin using the Spinnaker Operator. + +[Instructions]({{< ref "plugins/github-api/install/spinnaker-operator" >}}) +{{% /card %}} + +{{% card header="Spinnaker
Halyard" %}} +Use Spinnaker local config files to install the plugin. + +1. Create a GitHub App and install it in your repo. +1. Install the plugin in local config files and apply those changes using Halyard. -## Installation paths \ No newline at end of file +[Instructions]({{< ref "plugins/github-api/install/spinnaker-halyard" >}}) +{{% /card %}} +{{% /cardpane %}} \ No newline at end of file diff --git a/content/en/plugins/github-api/install.md b/content/en/plugins/github-api/install.md deleted file mode 100644 index 30d04049ef..0000000000 --- a/content/en/plugins/github-api/install.md +++ /dev/null @@ -1,264 +0,0 @@ ---- -title: Install the GiHub API Plugin -linkTitle: Install -weight: 1 -description: > - TBD ---- - - -## {{% heading "prereq" %}} - -In order for Spinnaker to access - -For more information about GitHub applications, please check https://docs.github.com/en/apps/overview - -# GitHub Application Setup - -## GitHub application creation - -1. In the upper-right corner of any page on GitHub, click your profile photo. -2. Navigate to your account settings. - - For a GitHub App owned by a personal account, click **Settings**. - - For a GitHub App owned by an organization: - 1. Click **Your organizations**. - 2. To the right of the organization, click **Settings**. -3. In the left sidebar, click  **Developer settings**. -4. In the left sidebar, click **GitHub Apps**. -5. Click **New GitHub App**. -6. Under "GitHub App name", enter a name for your app. -7. Under "Homepage URL", type the full URL to your app's website. If you don’t have a dedicated URL and your app's code is stored in a public repository, you can use that repository URL. Or, you can use the URL of the organization or user that owns the app. -8. Under "Permissions", choose the permissions that your app needs. Select the dropdown menu for each permission and click **Read-only**, **Read & write**, or **No access**. You should select the minimum permissions necessary for your app. For more information, see "[Choosing permissions for a GitHub App](https://docs.github.com/en/apps/creating-github-apps/setting-up-a-github-app/choosing-permissions-for-a-github-app)." -9. Under "Where can this GitHub App be installed?", select **Only on this account** or **Any account**. For more information on installation options, see "[Making a GitHub App public or private](https://docs.github.com/en/apps/creating-github-apps/setting-up-a-github-app/making-a-github-app-public-or-private)." -10. Click **Create GitHub App**. -11. Download the **private key** and save the **application id** that we will use later to configure the Spinnaker GiHub API plugin - -## GitHub application installation - -1. In the upper-right corner of any page on GitHub, click your profile photo. -2. Navigate to your account settings. - - For a GitHub App owned by a personal account, click **Settings**. - - For a GitHub App owned by an organization: - 1. Click **Your organizations**. - 2. To the right of the organization, click **Settings**. -3. In the left sidebar, click  **Developer settings**. -4. In the left sidebar, click **GitHub Apps**. -5. Next to the GitHub App that you want to install, click **Edit**. -6. Click **Install App**. -7. Click **Install** next to the location where you want to install the GitHub App. -8. If the app requires repository permissions, select **All repositories** or **Only select repositories**. The app will always have at least read-only access to all public repositories on GitHub. - - If the app does not require repository permissions, these options will be omitted. - -9. If you selected **Only select repositories** in the previous step, under the **Select repositories** dropdown, select the repositories that you want the app to access. - - If the app creates any repositories, the app will automatically be granted access to those repositories as well. - -10. Click **Install**. - -# Spinnaker Plugin Installation - -## Halyard - -### Add plugin.json - -```json -hal plugins repository add githubapi \ - --url=https://raw.githubusercontent.com/armory-plugins/pluginRepository/master/repositories.json -``` - -The entry will create the following entry in halconfig: - -```jsx -spinnaker: - extensibility: - plugins: {} - repositories: - githubapi: - id: githubapi - url: https://raw.githubusercontent.com/armory-plugins/pluginRepository/master/repositories.json -``` - -### Add the plugin - -Run the following hal command - -```json -hal plugins add Armory.GithubApi --version=1.0.0 --enabled=true -``` - -Halyard adds the plugin configuration to the `.hal/config` file. - -```yaml -spinnaker: - extensibility: - plugins: - Armory.GithubApi: - id: Armory.GithubApi - enabled: true - version: 1.0. -``` - -Additionally, the gate-local.yml should contain a deck proxy entry to load the Deck plugin. - -```yaml -spinnaker: - extensibility: - deck-proxy: - enabled: true - plugins: - Armory.GithubApi: - enabled: true - version: 1.0.0 -``` - -Update settings-local.js by adding the ************github************ entry in the ********triggerTypes******** array - -```yaml -window.spinnakerSettings = { -... -triggerTypes: [ - 'artifactory', - 'concourse', - 'cron', - 'docker', - 'git', - 'github', - 'helm', - 'jenkins', - 'nexus', - 'pipeline', - 'plugin', - 'pubsub', - 'travis', - 'webhook', - 'wercker', - ] -... -} -``` - -Update echo-local.yml, gate-local.yml igor-local.yml, and orcal-local.yml files with the following configuration if you have an organization-wide GitHub application installation - -```yaml -github: - plugin: - accounts: - - name: orgwide # github app organization level installation - organization: - orgWide: true - defaultBranch: - githubAppId: - githubAppPrivateKey: -``` - -or with the following if you installed the GitHub application only in one repository - -```yaml -github: - plugin: - accounts: - - name: account1 # github app repo installation - organization: - repository: - defaultBranch: - githubAppId: - githubAppPrivateKey: -``` - -You can define multiple accounts using different Github applications like below - -```yaml -github: - plugin: - accounts: - - name: account1 # github app repo installation - organization: - repository: - defaultBranch: - githubAppId: - githubAppPrivateKey: - - name: account2 # github app repo installation - organization: - repository: - defaultBranch: - githubAppId: - githubAppPrivateKey: - - name: orgwide # github app organization level installation - organization: - orgWide: true - defaultBranch: - githubAppId: - githubAppPrivateKey: -``` - -## Operator - -You can enable Github API Plugin using the [Spinnaker Operator.](https://github.com/armory/spinnaker-operator) There’s a sample configuration you can use directly as is or adjust to your needs. Remember to specify the correct desired plugin version. - -```yaml -#------------------------------------------------------------------------------ -# Example configuration for enabling the Github API plugin -#------------------------------------------------------------------------------ -apiVersion: spinnaker.armory.io/v1alpha2 -kind: SpinnakerService -metadata: - name: spinnaker -spec: - spinnakerConfig: - profiles: - # Configs in the spinnaker profile get applied to all services - spinnaker: - github: - plugin: - accounts: - - name: account1 # github app repo installation - organization: - repository: - defaultBranch: - githubAppId: - githubAppPrivateKey: - spinnaker: - extensibility: - repositories: - repository: - enabled: true - url: https://raw.githubusercontent.com/armory-plugins/pluginRepository/master/repositories.json - deck: - settings-local.js: | - window.spinnakerSettings.triggerTypes=['artifactory','concourse','cron','docker','git','github','helm','jenkins','nexus','pipeline','plugin','pubsub','travis','webhook','wercker'] - gate: - spinnaker: - extensibility: - plugins: - Armory.GithubApi: - enabled: true - version: 1.0.0 - deck-proxy: - enabled: true - plugins: - Armory.GithubApi: - enabled: true - version: 1.0.0 - orca: - spinnaker: - extensibility: - plugins: - Armory.GithubApi: - enabled: true - version: 1.0.0 - igor: - spinnaker: - extensibility: - plugins: - Armory.GithubApi: - enabled: true - version: 1.0.0 - echo: - spinnaker: - extensibility: - plugins: - Armory.GithubApi: - enabled: true - version: 1.0.0 -``` \ No newline at end of file diff --git a/content/en/plugins/github-api/install/_index.md b/content/en/plugins/github-api/install/_index.md new file mode 100644 index 0000000000..c244f8e8e1 --- /dev/null +++ b/content/en/plugins/github-api/install/_index.md @@ -0,0 +1,7 @@ +--- +title: Get Started with the GitHub API Plugin +linkTitle: Get Started +weight: 1 +description: > + In this section, learn how to install the GitHub API Plugin for Spinnaker and Armory Continuous Deployment. +--- diff --git a/content/en/plugins/github-api/install/armory-cd.md b/content/en/plugins/github-api/install/armory-cd.md new file mode 100644 index 0000000000..93e84dbf62 --- /dev/null +++ b/content/en/plugins/github-api/install/armory-cd.md @@ -0,0 +1,126 @@ +--- +linkTitle: Armory CD +title: Install the GitHub API Plugin in Armory Continuous Deployment +weight: 1 +description: > + Learn how to install the GitHub API Plugin in Armory CD so that your app developers can trigger a Spinnaker pipeline from a GitHub workflow. +--- +![Proprietary](/images/proprietary.svg) + + +## {{% heading "prereq" %}} + +* You are running Armory Continuous Deployment. +* You manage your instance using the Armory Operator and the `spinnaker-kustomize-patches` [repo](https://github.com/armory/spinnaker-kustomize-patches). + +{{< include "plugins/github/install-reqs.md" >}} + +## Compatibility + +{{< include "plugins/github/compat-matrix.md" >}} + +## Configure the plugin + +Create a `github-api.yml` file with the following contents: + +```yaml +apiVersion: spinnaker.armory.io/v1alpha2 +kind: SpinnakerService +metadata: + name: spinnaker +spec: + spinnakerConfig: + profiles: + # Configs in the spinnaker profile get applied to all services + spinnaker: + github: + plugin: + accounts: [] + spinnaker: + extensibility: + repositories: + repository: + enabled: true + url: https://raw.githubusercontent.com/armory-plugins/pluginRepository/master/repositories.json + deck: + settings-local.js: | + window.spinnakerSettings.triggerTypes=['artifactory','concourse','cron','docker','git','github','helm','jenkins','nexus','pipeline','plugin','pubsub','travis','webhook','wercker'] + gate: + spinnaker: + extensibility: + plugins: + Armory.GithubApi: + enabled: true + version: + deck-proxy: + enabled: true + plugins: + Armory.GithubApi: + enabled: true + version: + orca: + spinnaker: + extensibility: + plugins: + Armory.GithubApi: + enabled: true + version: + igor: + spinnaker: + extensibility: + plugins: + Armory.GithubApi: + enabled: true + version: + echo: + spinnaker: + extensibility: + plugins: + Armory.GithubApi: + enabled: true + version: +``` + + +{{< include "plugins/github/plugin-config.md" >}} + +Save the file to your `spinnaker-kustomize-patches/plugins` directory. + +### Accounts config example + +{{< include "plugins/github/accounts-config-example.md" >}} + +## Install the plugin + +1. Add the plugin patch to your Kustomize recipe's `patchesStrategicMerge` section. For example: + + {{< highlight yaml "linenos=table,hl_lines=13" >}} + apiVersion: kustomize.config.k8s.io/v1beta1 + kind: Kustomization + + namespace: spinnaker + + components: + - core/base + - core/persistence/in-cluster + - targets/kubernetes/default + + patchesStrategicMerge: + - core/patches/oss-version.yml + - plugins/github-api.yml + + patches: + - target: + kind: SpinnakerService + path: utilities/switch-to-oss.yml + {{< /highlight >}} + +1. Apply the updates to your Kustomization recipe. + + ```bash + kubectl apply -k + ``` + +## {{% heading "nextSteps" %}} + +[Learn how to use the GitHub API plugin]({{< ref "plugins/github-api/use" >}}). \ No newline at end of file diff --git a/content/en/plugins/github-api/install/spinnaker-halyard.md b/content/en/plugins/github-api/install/spinnaker-halyard.md new file mode 100644 index 0000000000..c5143951c2 --- /dev/null +++ b/content/en/plugins/github-api/install/spinnaker-halyard.md @@ -0,0 +1,163 @@ +--- +title: Install the GitHub API Plugin in Spinnaker (Halyard) +linkTitle: Spinnaker - Halyard +weight: 3 +description: > + Learn how to install Armory's GitHub API Plugin in a Spinnaker instance managed by Halyard. The GitHub API enables your app developers to trigger a Spinnaker pipeline from a GitHub workflow. +--- + +## {{% heading "prereq" %}} + +* You are running open source Spinnaker. +* You manage your instance using Halyard. If you are using the Spinnaker Operator, see {{< linkWithTitle "plugins/github-api/install/spinnaker-operator.md" >}}. + +{{< include "plugins/github/install-reqs.md" >}} + + +{{% alert color="warning" title="A note about installing plugins in Spinnaker" %}} +When Halyard adds a plugin to a Spinnaker installation, it adds the plugin repository information to all services, not just the ones the plugin is for. This means that when you restart Spinnaker, each service restarts, downloads the plugin, and checks if an extension exists for that service. Each service restarting is not ideal for large Spinnaker installations due to service restart times. Clouddriver can take an hour or more to restart if you have many accounts configured. + +The GitHub API plugin extends Deck, Echo, Gate, Igor, and Orca. To avoid every Spinnaker service restarting and downloading the plugin, do not add the plugin using Halyard. Instead, follow the local config installation method, in which you configure the plugin in each extended service’s local profile. + +{{% /alert %}} + +## Compatibility + +{{< include "plugins/github/compat-matrix.md" >}} + + +### Add plugin.json + +```json +hal plugins repository add githubapi \ + --url=https://raw.githubusercontent.com/armory-plugins/pluginRepository/master/repositories.json +``` + +The entry will create the following entry in halconfig: + +```jsx +spinnaker: + extensibility: + plugins: {} + repositories: + githubapi: + id: githubapi + url: https://raw.githubusercontent.com/armory-plugins/pluginRepository/master/repositories.json +``` + +### Add the plugin + +Run the following hal command + +```json +hal plugins add Armory.GithubApi --version=1.0.0 --enabled=true +``` + +Halyard adds the plugin configuration to the `.hal/config` file. + +```yaml +spinnaker: + extensibility: + plugins: + Armory.GithubApi: + id: Armory.GithubApi + enabled: true + version: 1.0. +``` + +Additionally, the gate-local.yml should contain a deck proxy entry to load the Deck plugin. + +```yaml +spinnaker: + extensibility: + deck-proxy: + enabled: true + plugins: + Armory.GithubApi: + enabled: true + version: 1.0.0 +``` + +Update settings-local.js by adding the ************github************ entry in the ********triggerTypes******** array + +```yaml +window.spinnakerSettings = { +... +triggerTypes: [ + 'artifactory', + 'concourse', + 'cron', + 'docker', + 'git', + 'github', + 'helm', + 'jenkins', + 'nexus', + 'pipeline', + 'plugin', + 'pubsub', + 'travis', + 'webhook', + 'wercker', + ] +... +} +``` + +Update echo-local.yml, gate-local.yml igor-local.yml, and orcal-local.yml files with the following configuration if you have an organization-wide GitHub application installation + +```yaml +github: + plugin: + accounts: + - name: orgwide # github app organization level installation + organization: + orgWide: true + defaultBranch: + githubAppId: + githubAppPrivateKey: +``` + +or with the following if you installed the GitHub application only in one repository + +```yaml +github: + plugin: + accounts: + - name: account1 # github app repo installation + organization: + repository: + defaultBranch: + githubAppId: + githubAppPrivateKey: +``` + +You can define multiple accounts using different Github applications like below + +```yaml +github: + plugin: + accounts: + - name: account1 # github app repo installation + organization: + repository: + defaultBranch: + githubAppId: + githubAppPrivateKey: + - name: account2 # github app repo installation + organization: + repository: + defaultBranch: + githubAppId: + githubAppPrivateKey: + - name: orgwide # github app organization level installation + organization: + orgWide: true + defaultBranch: + githubAppId: + githubAppPrivateKey: +``` + +## {{% heading "nextSteps" %}} + +[Learn how to use the GitHub API plugin]({{< ref "plugins/github-api/use" >}}). \ No newline at end of file diff --git a/content/en/plugins/github-api/install/spinnaker-operator.md b/content/en/plugins/github-api/install/spinnaker-operator.md new file mode 100644 index 0000000000..d42fe16a08 --- /dev/null +++ b/content/en/plugins/github-api/install/spinnaker-operator.md @@ -0,0 +1,125 @@ +--- +title: Install the GitHub API Plugin in Spinnaker (Operator) +linkTitle: Spinnaker - Operator +weight: 2 +description: > + Learn how to install Armory's GitHub API Plugin in a Spinnaker instance managed by the Spinnaker Operator. The GitHub API enables your app developers to trigger a Spinnaker pipeline from a GitHub workflow. +--- + +## {{% heading "prereq" %}} + +* You are running open source Spinnaker. +* You manage your instance using the Spinnaker Operator and the `spinnaker-kustomize-patches` [repo](https://github.com/armory/spinnaker-kustomize-patches). If you are using Halyard, see {{< linkWithTitle "plugins/github-api/install/spinnaker-halyard.md" >}}. + +{{< include "plugins/github/install-reqs.md" >}} + +## Compatibility + +{{< include "plugins/github/compat-matrix.md" >}} + + +## Configure the plugin + +Create a `github-api.yml` file with the following contents: + +```yaml +apiVersion: spinnaker.io/v1alpha2 +kind: SpinnakerService +metadata: + name: spinnaker +spec: + spinnakerConfig: + profiles: + # Configs in the spinnaker profile get applied to all services + spinnaker: + github: + plugin: + accounts: [] + spinnaker: + extensibility: + repositories: + repository: + enabled: true + url: https://raw.githubusercontent.com/armory-plugins/pluginRepository/master/repositories.json + deck: + settings-local.js: | + window.spinnakerSettings.triggerTypes=['artifactory','concourse','cron','docker','git','github','helm','jenkins','nexus','pipeline','plugin','pubsub','travis','webhook','wercker'] + gate: + spinnaker: + extensibility: + plugins: + Armory.GithubApi: + enabled: true + version: + deck-proxy: + enabled: true + plugins: + Armory.GithubApi: + enabled: true + version: + orca: + spinnaker: + extensibility: + plugins: + Armory.GithubApi: + enabled: true + version: + igor: + spinnaker: + extensibility: + plugins: + Armory.GithubApi: + enabled: true + version: + echo: + spinnaker: + extensibility: + plugins: + Armory.GithubApi: + enabled: true + version: +``` + + +{{< include "plugins/github/plugin-config.md" >}} + +Save the file to your `spinnaker-kustomize-patches/plugins/oss` directory. + +### Accounts config example + +{{< include "plugins/github/accounts-config-example.md" >}} + +## Install the plugin + +1. Add the plugin patch to your Kustomize recipe's `patchesStrategicMerge` section. For example: + + {{< highlight yaml "linenos=table,hl_lines=13" >}} + apiVersion: kustomize.config.k8s.io/v1beta1 + kind: Kustomization + + namespace: spinnaker + + components: + - core/base + - core/persistence/in-cluster + - targets/kubernetes/default + + patchesStrategicMerge: + - core/patches/oss-version.yml + - plugins/oss/github-api.yml + + patches: + - target: + kind: SpinnakerService + path: utilities/switch-to-oss.yml + {{< /highlight >}} + +1. Apply the updates to your Kustomization recipe. + + ```bash + kubectl apply -k + ``` + +## {{% heading "nextSteps" %}} + +[Learn how to use the GitHub API plugin]({{< ref "plugins/github-api/use" >}}). \ No newline at end of file