-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
1,491 additions
and
119 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
186 changes: 186 additions & 0 deletions
186
och-content/implementation/atlassian/confluence/install.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
ocfVersion: 0.0.1 | ||
revision: 0.1.0 | ||
kind: Implementation | ||
metadata: | ||
prefix: cap.implementation.atlassian.confluence | ||
name: install | ||
displayName: Install Confluence | ||
description: Action which installs Confluence via Helm chart | ||
documentationURL: https://github.com/javimox/helm-charts/tree/master/charts/confluence-server | ||
supportURL: https://mox.sh/helm/ | ||
license: | ||
name: "Apache 2.0" | ||
maintainers: | ||
- email: team-dev@projectvoltron.dev | ||
name: Voltron Dev Team | ||
url: https://projectvoltron.dev | ||
|
||
spec: | ||
appVersion: "2.x.x" | ||
|
||
additionalInput: | ||
typeInstances: | ||
postgresql: | ||
typeRef: | ||
path: cap.type.database.postgresql.config | ||
revision: 0.1.0 | ||
verbs: [ "get" ] | ||
|
||
additionalOutput: | ||
typeInstances: | ||
confluence-helm-release: | ||
typeRef: | ||
path: cap.type.helm.chart.release | ||
revision: 0.1.0 | ||
database: | ||
typeRef: | ||
path: cap.type.postgresql.database | ||
revision: 0.1.0 | ||
typeInstanceRelations: | ||
confluence-config: | ||
uses: | ||
- confluence-helm-release | ||
- postgresql | ||
- database | ||
|
||
implements: | ||
- path: cap.interface.productivity.confluence.install | ||
revision: 0.1.0 | ||
|
||
requires: | ||
cap.core.type.platform: | ||
oneOf: | ||
- name: kubernetes | ||
revision: 0.1.0 | ||
|
||
imports: | ||
- interfaceGroupPath: cap.interface.runner.argo | ||
alias: argo | ||
methods: | ||
- name: run | ||
revision: 0.1.0 | ||
- interfaceGroupPath: cap.interface.runner.helm | ||
alias: helm | ||
methods: | ||
- name: run | ||
revision: 0.1.0 | ||
- interfaceGroupPath: cap.interface.database.postgresql | ||
alias: postgresql | ||
methods: | ||
- name: install | ||
revision: 0.1.0 | ||
- name: create-db | ||
revision: 0.1.0 | ||
- interfaceGroupPath: cap.interface.templating.jinja2 | ||
alias: jinja2 | ||
methods: | ||
- name: template | ||
revision: 0.1.0 | ||
|
||
action: | ||
runnerInterface: argo.run | ||
args: | ||
workflow: | ||
entrypoint: main | ||
templates: | ||
- name: main | ||
# Voltron Engine will inject the 'input-parameters' artifacts into the workflow entrypoint. | ||
# It contains the Interface parameters, in our case it is `confluence.install-input`. | ||
inputs: | ||
artifacts: | ||
- name: input-parameters | ||
steps: | ||
# If the postgresql TypeInstance was not provided, then create it | ||
# using the imported 'postgresql.install' Interface. | ||
- - name: install-db | ||
voltron-action: postgresql.install | ||
voltron-when: postgresql == nil | ||
arguments: | ||
artifacts: | ||
- name: input-parameters | ||
raw: | ||
data: | | ||
superuser: | ||
username: superuser | ||
password: okon | ||
defaultDBName: postgres | ||
# Create the database for Confluence in our PostgreSQL instance | ||
# using the imported 'postgresql.create-db' Interface | ||
- - name: create-db | ||
voltron-action: postgresql.create-db | ||
voltron-outputTypeInstances: | ||
- name: database # Defining the output TypeInstance 'database' | ||
from: database | ||
arguments: | ||
artifacts: | ||
- name: postgresql | ||
from: "{{workflow.outputs.artifacts.postgresql}}" | ||
- name: database-input | ||
raw: | ||
data: | | ||
name: confluencedb | ||
owner: superuser | ||
# Here we prepare the input for the Helm runner. In the next two steps, | ||
# we use Jinja2 to render the input and fill the required parameters. | ||
# In the future there might be better way to do this. | ||
- - name: render-helm-args | ||
voltron-action: jinja2.template | ||
arguments: | ||
artifacts: | ||
- name: template | ||
raw: | ||
data: | | ||
command: "install" | ||
generateName: true | ||
chart: | ||
name: "confluence-server" | ||
repo: "https://helm.mox.sh" | ||
output:{% raw %} | ||
goTemplate: | ||
version: {{ '"{{ .Values.image.tag }}"' }} | ||
host: {{ "'{{ template \"confluence-server.fullname\" . }}'" }}{% endraw %} | ||
values: | ||
postgresql: | ||
enabled: false | ||
databaseConnection: | ||
host: "{{ host }}" | ||
user: "{{ superuser.username }}" | ||
password: "{{ superuser.password }}" | ||
{% raw %}database: "{{ name }}"{% endraw %} | ||
ingress: | ||
enabled: true | ||
hosts: | ||
- host: confluence.voltron.local | ||
paths: ['/'] | ||
- name: input-parameters | ||
from: "{{workflow.outputs.artifacts.postgresql}}" | ||
|
||
- - name: fill-params-in-helm-args | ||
voltron-action: jinja2.template | ||
arguments: | ||
artifacts: | ||
- name: template | ||
from: "{{steps.render-helm-args.outputs.artifacts.render}}" | ||
- name: input-parameters | ||
from: "{{steps.create-db.outputs.artifacts.database}}" | ||
|
||
# Execute the Helm runner, with the input parameters created in the previous step. | ||
# This will create the Helm chart and deploy our Confluence instance | ||
- - name: helm-run | ||
voltron-action: helm.run | ||
voltron-outputTypeInstances: | ||
- name: confluence-config # Defining the output TypeInstance 'confluence-config' | ||
from: additional | ||
- name: confluence-helm-release # Defining the output TypeInstance 'confluence-helm-release' | ||
from: helm-release | ||
arguments: | ||
artifacts: | ||
- name: input-parameters | ||
from: "{{steps.fill-params-in-helm-args.outputs.artifacts.render}}" | ||
- name: runner-context | ||
from: "{{workflow.outputs.artifacts.runner-context}}" | ||
|
||
signature: | ||
och: eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.