Skip to content

Commit

Permalink
Merge pull request #174 from flanksource/playbook-updates
Browse files Browse the repository at this point in the history
Playbook updates
  • Loading branch information
moshloop authored Feb 20, 2024
2 parents 562e764 + 2a211ae commit ff9b28e
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 106 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.envrc
default.nix

.DS_Store
site/
**/build/
Expand Down
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"semi": false,
"trailingComma": "none"
"trailingComma": "none",
"singleQuote": true
}
95 changes: 0 additions & 95 deletions canary-checker/docs/index.md

This file was deleted.

2 changes: 1 addition & 1 deletion mission-control/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY:
sync:
rm docs/canary-checker/index.md
rm -f docs/canary-checker/index.md

watch: sync
npm exec -c 'docusaurus start'
68 changes: 68 additions & 0 deletions mission-control/docs/playbooks/actions/azure_devops_pipeline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: Azure DevOps Pipeline Action
---

# <Icon name="azure-devops"/> Azure DevOps Pipeline Action

This action allows you to invoke pipelines in your Azure DevOps project.

```yaml title="invoke-azure-devops-pipeline.yaml"
apiVersion: mission-control.flanksource.com/v1
kind: Playbook
metadata:
name: invoke-azure-devops-pipeline
namespace: default
spec:
parameters:
- name: project
label: Project name
- name: pipeline
label: Pipeline ID
actions:
- name: Invoke pipeline
azureDevopsPipeline:
org: flanksource
project: "{{.params.project}}"
token:
valueFrom:
secretKeyRef:
name: azure-devops
key: token
pipeline:
id: "{{.params.pipeline}}"
```
| Field | Description | Scheme | Required | Templatable |
| ------------ | ------------------------------------------------------------- | ---------------------------------------------- | -------- | ----------- |
| `org` | Org is the name of the Azure DevOps organization. | `string` | `true` | `true` |
| `project` | Project ID or project name | `string` | `true` | `true` |
| `token` | Token is the personal access token. | <CommonLink to="secrets">_EnvVar_</CommonLink> | `true` | `true` |
| `pipeline` | Pipeline is the azure pipeline to invoke. | [`AzureDevopsPipeline`](#pipeline) | `true` | `true` |
| `parameters` | Parameteres are the settings that influence the pipeline run. | [`AzureDevopsPipelineParameters`](#parameters) | `false` | `true` |

## Pipeline

| Field | Description | Scheme | Required | Templatable |
| --------- | ----------------- | -------- | -------- | ----------- |
| `id` | Pipeline ID. | `string` | `true` | `true` |
| `version` | Pipeline version. | `string` | `false` | `true` |

## Parameters

| Field | Description | Scheme | Required | Templatable |
| -------------------- | ----------------------------------------- | ---------------- | -------- | ----------- |
| `resources` | The resources the run requires. | `map[string]any` | `false` | `true` |
| `templateParameters` | The template parameters the run requires. | `map[string]any` | `false` | `true` |
| `variables` | The variables the run requires. | `map[string]any` | `false` | `true` |
| `stagesToSkip` | The stages to skip. | `[]string` | `false` | `true` |

## Templating

The fields that are marked as `templatable` receives a environment variable that contain details about the corresponding config, check or component and the parameter(if applicable).

| Field | Description | Schema |
| ----------- | ---------------------------------------- | -------------------------------------------- |
| `config` | Config passed to the playbook | [`ConfigItem`](../references/config_item.md) |
| `component` | Component passed to the playbook | [`Component`](../references/component.md) |
| `check` | Canary Check passed to the playbook | [`Check`](../references/check.md) |
| `params` | User provided parameters to the playbook | `map[string]string` |
19 changes: 11 additions & 8 deletions mission-control/docs/playbooks/actions/gitops.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ spec:
```
:::info
On Github and Azure Devops, it's possible to create Pull Requests as well.
On Github, GitLab and Azure Devops, it's possible to create Pull Requests as well.
:::
| Field | Description | Scheme | Required | Templatable |
Expand All @@ -66,15 +66,18 @@ At least a patch or files config is required.

### Repository Detail

| Field | Description | Scheme | Required | Templatable |
| ------------ | --------------------------------------------------------------------- | -------- | -------- | ----------- |
| `connection` | Connection name to use the credentials for the git repo | `string` | | |
| `url` | URL of the git repository | `string` | | |
| `base` | Branch to clone. _(Defaults to "main")_ | `string` | | `true` |
| `branch` | The new branch to create. _(Defaults to base branch specified above)_ | `string` | | `true` |
| Field | Description | Scheme | Required | Templatable |
| ------------ | ------------------------------------------------------------------------- | -------- | -------- | ----------- |
| `connection` | Connection name to use the credentials for the git repo | `string` | | |
| `url` | URL of the git repository | `string` | | |
| `base` | Branch to clone. _(Defaults to "main")_ | `string` | | `true` |
| `branch` | The new branch to create. _(Defaults to base branch specified above)_ | `string` | | `true` |
| `type` | Specify the service the repository is hosted on (eg: github, gitlab, etc) | `string` | | |

:::note
Either the `connection` or the `url` is required
Either the `connection` or the `url` is required.

For private GitLab repositories, please sepcify the type as "gitlab"
:::

### Commit Detail
Expand Down
7 changes: 6 additions & 1 deletion mission-control/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,11 @@ const sidebars = {
type: 'category',
label: 'Actions',
items: [
{
type: 'doc',
id: 'playbooks/actions/azure_devops_pipeline',
label: 'Azure DevOps Pipeline'
},
{
type: 'doc',
id: 'playbooks/actions/exec',
Expand All @@ -538,7 +543,7 @@ const sidebars = {
{
type: 'doc',
id: 'playbooks/actions/github',
label: 'Github'
label: 'GitHub'
},
{
type: 'doc',
Expand Down

0 comments on commit ff9b28e

Please sign in to comment.