From ce1256026f00e6666c04a38642e0e10ee7384850 Mon Sep 17 00:00:00 2001 From: fabianofernandeszup Date: Tue, 28 Nov 2023 20:56:33 -0300 Subject: [PATCH 1/7] Update docs to new format using i18n Signed-off-by: fabianofernandeszup --- action.yaml | 5 ++++- docs_action/en_us/doc.md | 13 +++++++++++++ docs_action/pt_br/doc.md | 13 +++++++++++++ docs_plugin/en_us/doc.md | 13 +++++++++++++ docs_plugin/pt_br/doc.md | 13 +++++++++++++ plugin.yaml | 11 +++++------ .../setup-stackspot-workflows/docs/about.md | 1 - .../docs/implementation.md | 1 - .../docs/release-notes-0.0.1.md | 3 --- .../setup-stackspot-workflows/docs/requirements.md | 1 - 10 files changed, 61 insertions(+), 13 deletions(-) create mode 100644 docs_action/en_us/doc.md create mode 100644 docs_action/pt_br/doc.md create mode 100644 docs_plugin/en_us/doc.md create mode 100644 docs_plugin/pt_br/doc.md delete mode 100644 stackspot-actions/setup-stackspot-workflows/docs/about.md delete mode 100644 stackspot-actions/setup-stackspot-workflows/docs/implementation.md delete mode 100644 stackspot-actions/setup-stackspot-workflows/docs/release-notes-0.0.1.md delete mode 100644 stackspot-actions/setup-stackspot-workflows/docs/requirements.md diff --git a/action.yaml b/action.yaml index 1f614a94..0dd301c3 100644 --- a/action.yaml +++ b/action.yaml @@ -5,9 +5,12 @@ metadata: name: setup-stackspot-workflows display-name: StackSpot Setup Workflows. description: Action to configure Stackspot workflows in SCM provider - version: 0.0.1 + version: 1.0.0 spec: type: python + docs: + pt_br: stackspot-actions/setup-stackspot-workflows/docs/pt_br/doc.md + en_us: stackspot-actions/setup-stackspot-workflows/docs/en_us/doc.md inputs: - label: SCM provider name: provider diff --git a/docs_action/en_us/doc.md b/docs_action/en_us/doc.md new file mode 100644 index 00000000..8bfd1116 --- /dev/null +++ b/docs_action/en_us/doc.md @@ -0,0 +1,13 @@ +# About +Action to create a workflow in a repository so that it can be used as a repository for executing StackSpot workflows, +allowing the creation of Apps, Infrastructure and execution of actions through the Portal. + +# Implementation +This action will create a workflow according to the selected provider, after that just commit the files to the SCM, and +Enter its URL in the account's SCM configuration on the Stack Spot Portal. + +# Requirements +- Account with a supported SCM provider. + +# Release Notes +... \ No newline at end of file diff --git a/docs_action/pt_br/doc.md b/docs_action/pt_br/doc.md new file mode 100644 index 00000000..7b3cde71 --- /dev/null +++ b/docs_action/pt_br/doc.md @@ -0,0 +1,13 @@ +# Sobre +Action para criar um workflow em um repositório para que esse seja utilizado como repositório de execução de workflows da StackSpot, +permitindo a criação de Apps, Infra e execução de actions pelo Portal. + +# Implementação +Essa action irá criar um workflow de acordo com o provider selecionado, após isso basta comitar os arquivos para o SCM, e +informar a url do mesmo na configuração de SCM da conta no Portal da Stack Spot. + +# Requerimentos +- Conta em algum provider de SCM suportado. + +# Notas da Release +... diff --git a/docs_plugin/en_us/doc.md b/docs_plugin/en_us/doc.md new file mode 100644 index 00000000..b16f47c1 --- /dev/null +++ b/docs_plugin/en_us/doc.md @@ -0,0 +1,13 @@ +# About +Plugin to create a workflow in a repository so that it can be used as a repository for executing StackSpot workflows, +allowing the creation of Apps, Infrastructure and execution of actions through the Portal. + +# Implementation +This plugin will create a workflow according to the selected provider, after that just commit the files to the SCM, and +Enter its URL in the account's SCM configuration on the Stack Spot Portal. + +# Requirements +- Account with a supported SCM provider. + +# Release Notes +... \ No newline at end of file diff --git a/docs_plugin/pt_br/doc.md b/docs_plugin/pt_br/doc.md new file mode 100644 index 00000000..5b7a8e37 --- /dev/null +++ b/docs_plugin/pt_br/doc.md @@ -0,0 +1,13 @@ +# Sobre +Plugin para criar um workflow em um repositório para que esse seja utilizado como repositório de execução de workflows da StackSpot, +permitindo a criação de Apps, Infra e execução de actions pelo Portal. + +# Implementação +Esse plugin irá criar um workflow de acordo com o provider selecionado, após isso basta comitar os arquivos para o SCM, e +informar a url do mesmo na configuração de SCM da conta no Portal da Stack Spot. + +# Requerimentos +- Conta em algum provider de SCM suportado. + +# Notas da Release +... diff --git a/plugin.yaml b/plugin.yaml index 629c89a6..bb6ffbd2 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -2,18 +2,17 @@ schema-version: v2 kind: plugin metadata: name: setup-runner - display-name: setup-runner + display-name: Setup Runner description: Plugin to setup StackSpot workflows - version: 0.0.1 + version: 1.0.0 picture: plugin.png spec: type: app compatibility: - python - about: stackspot-actions/setup-stackspot-workflows/docs/about.md - implementation: stackspot-actions/setup-stackspot-workflows/docs/implementation.md - release-notes: stackspot-actions/setup-stackspot-workflows/docs/release-notes-0.0.1.md - requirements: stackspot-actions/setup-stackspot-workflows/docs/requirements.md + docs: + pt_br: stackspot-actions/setup-stackspot-workflows/docs/pt_br/doc.md + en_us: stackspot-actions/setup-stackspot-workflows/docs/en_us/doc.md repository: https://github.com/stack-spot/stackspot-workflows-action technologies: # Ref: https://docs.stackspot.com/docs/create-stacks/yaml-files/yaml/#technologies - Api diff --git a/stackspot-actions/setup-stackspot-workflows/docs/about.md b/stackspot-actions/setup-stackspot-workflows/docs/about.md deleted file mode 100644 index fdb647bf..00000000 --- a/stackspot-actions/setup-stackspot-workflows/docs/about.md +++ /dev/null @@ -1 +0,0 @@ -Details about plugin... \ No newline at end of file diff --git a/stackspot-actions/setup-stackspot-workflows/docs/implementation.md b/stackspot-actions/setup-stackspot-workflows/docs/implementation.md deleted file mode 100644 index 5f20a643..00000000 --- a/stackspot-actions/setup-stackspot-workflows/docs/implementation.md +++ /dev/null @@ -1 +0,0 @@ -Implementation details of plugin... \ No newline at end of file diff --git a/stackspot-actions/setup-stackspot-workflows/docs/release-notes-0.0.1.md b/stackspot-actions/setup-stackspot-workflows/docs/release-notes-0.0.1.md deleted file mode 100644 index 44d50844..00000000 --- a/stackspot-actions/setup-stackspot-workflows/docs/release-notes-0.0.1.md +++ /dev/null @@ -1,3 +0,0 @@ -Release Notes 0.0.1 -- Item A -- Item B \ No newline at end of file diff --git a/stackspot-actions/setup-stackspot-workflows/docs/requirements.md b/stackspot-actions/setup-stackspot-workflows/docs/requirements.md deleted file mode 100644 index e6d29c1c..00000000 --- a/stackspot-actions/setup-stackspot-workflows/docs/requirements.md +++ /dev/null @@ -1 +0,0 @@ -Requirements details of plugin... \ No newline at end of file From bac9d01efaea0c942cd2c8ed32ad6979ee66f810 Mon Sep 17 00:00:00 2001 From: fabianofernandeszup Date: Tue, 28 Nov 2023 22:04:40 -0300 Subject: [PATCH 2/7] Update all plugins to new docs i18n Signed-off-by: fabianofernandeszup --- .../azure/create-repo-azure/docs/about.md | 4 -- .../docs/{usage.md => en_us/doc.md} | 13 +++- .../create-repo-azure/docs/implementation.md | 0 .../azure/create-repo-azure/docs/pt_br/doc.md | 29 +++++++++ .../create-repo-azure/docs/release-notes.md | 0 .../create-repo-azure/docs/requirements.md | 0 .../create-repo-bitbucket/docs/about.md | 4 -- .../docs/{usage.md => en_us/doc.md} | 13 +++- .../docs/implementation.md | 0 .../create-repo-bitbucket/docs/pt_br/doc.md | 30 +++++++++ .../docs/release-notes.md | 0 .../docs/requirements.md | 0 .../github/create-repo-github/docs/about.md | 4 -- .../docs/{usage.md => en_us/doc.md} | 11 +++- .../create-repo-github/docs/implementation.md | 0 .../create-repo-github/docs/pt_br/doc.md} | 17 +++-- .../create-repo-github/docs/release-notes.md | 0 .../gitlab/docs/{about.md => en_us/doc.md} | 37 ++++++++++- .../gitlab/docs/implementation.md | 5 -- stackspot-actions/gitlab/docs/pt_br/doc.md | 62 +++++++++++++++++++ .../gitlab/docs/release-notes.md | 3 - stackspot-actions/gitlab/docs/requirements.md | 5 -- 22 files changed, 204 insertions(+), 33 deletions(-) delete mode 100644 stackspot-actions/azure/create-repo-azure/docs/about.md rename stackspot-actions/azure/create-repo-azure/docs/{usage.md => en_us/doc.md} (62%) delete mode 100644 stackspot-actions/azure/create-repo-azure/docs/implementation.md create mode 100644 stackspot-actions/azure/create-repo-azure/docs/pt_br/doc.md delete mode 100644 stackspot-actions/azure/create-repo-azure/docs/release-notes.md delete mode 100644 stackspot-actions/azure/create-repo-azure/docs/requirements.md delete mode 100644 stackspot-actions/bitbucket/create-repo-bitbucket/docs/about.md rename stackspot-actions/bitbucket/create-repo-bitbucket/docs/{usage.md => en_us/doc.md} (64%) delete mode 100644 stackspot-actions/bitbucket/create-repo-bitbucket/docs/implementation.md create mode 100644 stackspot-actions/bitbucket/create-repo-bitbucket/docs/pt_br/doc.md delete mode 100644 stackspot-actions/bitbucket/create-repo-bitbucket/docs/release-notes.md delete mode 100644 stackspot-actions/bitbucket/create-repo-bitbucket/docs/requirements.md delete mode 100644 stackspot-actions/github/create-repo-github/docs/about.md rename stackspot-actions/github/create-repo-github/docs/{usage.md => en_us/doc.md} (64%) delete mode 100644 stackspot-actions/github/create-repo-github/docs/implementation.md rename stackspot-actions/{gitlab/docs/usage.md => github/create-repo-github/docs/pt_br/doc.md} (55%) delete mode 100644 stackspot-actions/github/create-repo-github/docs/release-notes.md rename stackspot-actions/gitlab/docs/{about.md => en_us/doc.md} (59%) delete mode 100644 stackspot-actions/gitlab/docs/implementation.md create mode 100644 stackspot-actions/gitlab/docs/pt_br/doc.md delete mode 100644 stackspot-actions/gitlab/docs/release-notes.md delete mode 100644 stackspot-actions/gitlab/docs/requirements.md diff --git a/stackspot-actions/azure/create-repo-azure/docs/about.md b/stackspot-actions/azure/create-repo-azure/docs/about.md deleted file mode 100644 index 224a0b48..00000000 --- a/stackspot-actions/azure/create-repo-azure/docs/about.md +++ /dev/null @@ -1,4 +0,0 @@ -## Azure create repository action - -Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Azure. -The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. diff --git a/stackspot-actions/azure/create-repo-azure/docs/usage.md b/stackspot-actions/azure/create-repo-azure/docs/en_us/doc.md similarity index 62% rename from stackspot-actions/azure/create-repo-azure/docs/usage.md rename to stackspot-actions/azure/create-repo-azure/docs/en_us/doc.md index c8899636..011daa36 100644 --- a/stackspot-actions/azure/create-repo-azure/docs/usage.md +++ b/stackspot-actions/azure/create-repo-azure/docs/en_us/doc.md @@ -1,3 +1,14 @@ +## Requirements +--- +## Azure create repository action + +Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Azure. +The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. +--- +## Implementation +--- +## Release notes +--- # Usage To execute it locally, it's needed [stackspot cli](https://docs.stackspot.com/home/stk-cli/install) installed, then execute: @@ -15,4 +26,4 @@ To execute it with Stackspot workflow, just follow the steps: 1. [Publish the action](https://docs.stackspot.com/guides/studio-guides/publish-action/) 2. [Add it to a stack](https://docs.stackspot.com/guides/studio-guides/create-stack/) 3. [Add the stack to a workspace](https://docs.stackspot.com/home/workspace/add-stacks/) -4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) +4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) \ No newline at end of file diff --git a/stackspot-actions/azure/create-repo-azure/docs/implementation.md b/stackspot-actions/azure/create-repo-azure/docs/implementation.md deleted file mode 100644 index e69de29b..00000000 diff --git a/stackspot-actions/azure/create-repo-azure/docs/pt_br/doc.md b/stackspot-actions/azure/create-repo-azure/docs/pt_br/doc.md new file mode 100644 index 00000000..011daa36 --- /dev/null +++ b/stackspot-actions/azure/create-repo-azure/docs/pt_br/doc.md @@ -0,0 +1,29 @@ +## Requirements +--- +## Azure create repository action + +Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Azure. +The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. +--- +## Implementation +--- +## Release notes +--- +# Usage + +To execute it locally, it's needed [stackspot cli](https://docs.stackspot.com/home/stk-cli/install) installed, then execute: + +``` +stk run action --inputs-json '{ + "org": "", + "token": "", + "project_name": "", + "name": "" +}' +``` + +To execute it with Stackspot workflow, just follow the steps: +1. [Publish the action](https://docs.stackspot.com/guides/studio-guides/publish-action/) +2. [Add it to a stack](https://docs.stackspot.com/guides/studio-guides/create-stack/) +3. [Add the stack to a workspace](https://docs.stackspot.com/home/workspace/add-stacks/) +4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) \ No newline at end of file diff --git a/stackspot-actions/azure/create-repo-azure/docs/release-notes.md b/stackspot-actions/azure/create-repo-azure/docs/release-notes.md deleted file mode 100644 index e69de29b..00000000 diff --git a/stackspot-actions/azure/create-repo-azure/docs/requirements.md b/stackspot-actions/azure/create-repo-azure/docs/requirements.md deleted file mode 100644 index e69de29b..00000000 diff --git a/stackspot-actions/bitbucket/create-repo-bitbucket/docs/about.md b/stackspot-actions/bitbucket/create-repo-bitbucket/docs/about.md deleted file mode 100644 index bba3e3cd..00000000 --- a/stackspot-actions/bitbucket/create-repo-bitbucket/docs/about.md +++ /dev/null @@ -1,4 +0,0 @@ -## Bitbucket create repository action - -Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Bitbucket. -The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. diff --git a/stackspot-actions/bitbucket/create-repo-bitbucket/docs/usage.md b/stackspot-actions/bitbucket/create-repo-bitbucket/docs/en_us/doc.md similarity index 64% rename from stackspot-actions/bitbucket/create-repo-bitbucket/docs/usage.md rename to stackspot-actions/bitbucket/create-repo-bitbucket/docs/en_us/doc.md index c8d01386..6205574b 100644 --- a/stackspot-actions/bitbucket/create-repo-bitbucket/docs/usage.md +++ b/stackspot-actions/bitbucket/create-repo-bitbucket/docs/en_us/doc.md @@ -1,3 +1,14 @@ +## Requirements +--- +## Bitbucket create repository action + +Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Bitbucket. +The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. +--- +## Implementation +--- +## Release notes +--- # Usage To execute it locally, it's needed [stackspot cli](https://docs.stackspot.com/home/stk-cli/install) installed, then execute: @@ -16,4 +27,4 @@ To execute it with Stackspot workflow, just follow the steps: 1. [Publish the action](https://docs.stackspot.com/guides/studio-guides/publish-action/) 2. [Add it to a stack](https://docs.stackspot.com/guides/studio-guides/create-stack/) 3. [Add the stack to a workspace](https://docs.stackspot.com/home/workspace/add-stacks/) -4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) +4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) \ No newline at end of file diff --git a/stackspot-actions/bitbucket/create-repo-bitbucket/docs/implementation.md b/stackspot-actions/bitbucket/create-repo-bitbucket/docs/implementation.md deleted file mode 100644 index e69de29b..00000000 diff --git a/stackspot-actions/bitbucket/create-repo-bitbucket/docs/pt_br/doc.md b/stackspot-actions/bitbucket/create-repo-bitbucket/docs/pt_br/doc.md new file mode 100644 index 00000000..6205574b --- /dev/null +++ b/stackspot-actions/bitbucket/create-repo-bitbucket/docs/pt_br/doc.md @@ -0,0 +1,30 @@ +## Requirements +--- +## Bitbucket create repository action + +Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Bitbucket. +The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. +--- +## Implementation +--- +## Release notes +--- +# Usage + +To execute it locally, it's needed [stackspot cli](https://docs.stackspot.com/home/stk-cli/install) installed, then execute: + +``` +stk run action --inputs-json '{ + "visibility": "[PRIVATE|PUBLIC]", + "project_name": "", + "token": "", + "name": "", + "org": "" +}' +``` + +To execute it with Stackspot workflow, just follow the steps: +1. [Publish the action](https://docs.stackspot.com/guides/studio-guides/publish-action/) +2. [Add it to a stack](https://docs.stackspot.com/guides/studio-guides/create-stack/) +3. [Add the stack to a workspace](https://docs.stackspot.com/home/workspace/add-stacks/) +4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) \ No newline at end of file diff --git a/stackspot-actions/bitbucket/create-repo-bitbucket/docs/release-notes.md b/stackspot-actions/bitbucket/create-repo-bitbucket/docs/release-notes.md deleted file mode 100644 index e69de29b..00000000 diff --git a/stackspot-actions/bitbucket/create-repo-bitbucket/docs/requirements.md b/stackspot-actions/bitbucket/create-repo-bitbucket/docs/requirements.md deleted file mode 100644 index e69de29b..00000000 diff --git a/stackspot-actions/github/create-repo-github/docs/about.md b/stackspot-actions/github/create-repo-github/docs/about.md deleted file mode 100644 index 5656b030..00000000 --- a/stackspot-actions/github/create-repo-github/docs/about.md +++ /dev/null @@ -1,4 +0,0 @@ -## Gitlab create repository action - -Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Github. -The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. diff --git a/stackspot-actions/github/create-repo-github/docs/usage.md b/stackspot-actions/github/create-repo-github/docs/en_us/doc.md similarity index 64% rename from stackspot-actions/github/create-repo-github/docs/usage.md rename to stackspot-actions/github/create-repo-github/docs/en_us/doc.md index 040a00ba..97744752 100644 --- a/stackspot-actions/github/create-repo-github/docs/usage.md +++ b/stackspot-actions/github/create-repo-github/docs/en_us/doc.md @@ -1,3 +1,12 @@ +## Gitlab create repository action + +Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Github. +The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. +--- +## Implementation +--- +## Release notes +--- # Usage To execute it locally, it's needed [stackspot cli](https://docs.stackspot.com/home/stk-cli/install) installed, then execute: @@ -15,4 +24,4 @@ To execute it with Stackspot workflow, just follow the steps: 1. [Publish the action](https://docs.stackspot.com/guides/studio-guides/publish-action/) 2. [Add it to a stack](https://docs.stackspot.com/guides/studio-guides/create-stack/) 3. [Add the stack to a workspace](https://docs.stackspot.com/home/workspace/add-stacks/) -4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) +4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) \ No newline at end of file diff --git a/stackspot-actions/github/create-repo-github/docs/implementation.md b/stackspot-actions/github/create-repo-github/docs/implementation.md deleted file mode 100644 index e69de29b..00000000 diff --git a/stackspot-actions/gitlab/docs/usage.md b/stackspot-actions/github/create-repo-github/docs/pt_br/doc.md similarity index 55% rename from stackspot-actions/gitlab/docs/usage.md rename to stackspot-actions/github/create-repo-github/docs/pt_br/doc.md index 8e458f3e..97744752 100644 --- a/stackspot-actions/gitlab/docs/usage.md +++ b/stackspot-actions/github/create-repo-github/docs/pt_br/doc.md @@ -1,12 +1,21 @@ +## Gitlab create repository action + +Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Github. +The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. +--- +## Implementation +--- +## Release notes +--- # Usage To execute it locally, it's needed [stackspot cli](https://docs.stackspot.com/home/stk-cli/install) installed, then execute: ``` stk run action --inputs-json '{ - "visibility": "[private|public]", - "group_name": "", - "token": "", + "visibility": "[private|public|internal]", + "org": "", + "token": "", "name": "" }' ``` @@ -15,4 +24,4 @@ To execute it with Stackspot workflow, just follow the steps: 1. [Publish the action](https://docs.stackspot.com/guides/studio-guides/publish-action/) 2. [Add it to a stack](https://docs.stackspot.com/guides/studio-guides/create-stack/) 3. [Add the stack to a workspace](https://docs.stackspot.com/home/workspace/add-stacks/) -4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) +4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) \ No newline at end of file diff --git a/stackspot-actions/github/create-repo-github/docs/release-notes.md b/stackspot-actions/github/create-repo-github/docs/release-notes.md deleted file mode 100644 index e69de29b..00000000 diff --git a/stackspot-actions/gitlab/docs/about.md b/stackspot-actions/gitlab/docs/en_us/doc.md similarity index 59% rename from stackspot-actions/gitlab/docs/about.md rename to stackspot-actions/gitlab/docs/en_us/doc.md index 6628366e..0e0107ef 100644 --- a/stackspot-actions/gitlab/docs/about.md +++ b/stackspot-actions/gitlab/docs/en_us/doc.md @@ -1,3 +1,9 @@ +## Before using this Action + +- Access to a Gitlab account +- A group of gitlab where the project will be associated +- +--- ## Gitlab create repository action Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Gitlab. @@ -24,4 +30,33 @@ These inputs are: "created_repository": "" } } -``` \ No newline at end of file +``` +--- +## Implementation + +1. Checks if informed group exists, if not, aborts +2. Try to create the project with the inputted name, if it succeeded or the repository already exists +3. Writes the repository https clone path into a file which will be used into stackspot workflows +--- +# Release Notes 1.0.0 + +- Initial implementation +--- +# Usage + +To execute it locally, it's needed [stackspot cli](https://docs.stackspot.com/home/stk-cli/install) installed, then execute: + +``` +stk run action --inputs-json '{ + "visibility": "[private|public]", + "group_name": "", + "token": "", + "name": "" +}' +``` + +To execute it with Stackspot workflow, just follow the steps: +1. [Publish the action](https://docs.stackspot.com/guides/studio-guides/publish-action/) +2. [Add it to a stack](https://docs.stackspot.com/guides/studio-guides/create-stack/) +3. [Add the stack to a workspace](https://docs.stackspot.com/home/workspace/add-stacks/) +4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) \ No newline at end of file diff --git a/stackspot-actions/gitlab/docs/implementation.md b/stackspot-actions/gitlab/docs/implementation.md deleted file mode 100644 index d8a3080e..00000000 --- a/stackspot-actions/gitlab/docs/implementation.md +++ /dev/null @@ -1,5 +0,0 @@ -## Implementation - -1. Checks if informed group exists, if not, aborts -2. Try to create the project with the inputted name, if it succeeded or the repository already exists -3. Writes the repository https clone path into a file which will be used into stackspot workflows \ No newline at end of file diff --git a/stackspot-actions/gitlab/docs/pt_br/doc.md b/stackspot-actions/gitlab/docs/pt_br/doc.md new file mode 100644 index 00000000..0e0107ef --- /dev/null +++ b/stackspot-actions/gitlab/docs/pt_br/doc.md @@ -0,0 +1,62 @@ +## Before using this Action + +- Access to a Gitlab account +- A group of gitlab where the project will be associated +- +--- +## Gitlab create repository action + +Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Gitlab. +The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. + +Feel free to clone it and add features before publish it into your studio. But first, before modifying, +there are two points of implementation that a developer should pay attention: + +1. Stackspot workflow api by default, when identifies a "create repository action", +it adds 5 hidden inputs to the stk run action workflow call. +Even if you do not declare then in action.yml they will be added. +But if you declare then in action manifest, the stackspot portal will ask these inputs when you try to dispatch a workflow, then they will not be overwritten. +These inputs are: + - name: copied from the app/infra which will be created by the workflow. + - description: copied from the description of the app/infra which will be created by the workflow. + - org: its the group_name from the workflow url, which is configured into scm integration page. + - token: The token which was configured into scm integration page, it is used to create the repository by the gitlab api. + - workflow_api_authorization: A valid token with the same rules of portal user, which dispatched the workflow, that token can be used to call stackspot apis. + +2. For now, to the workflow work well, the action need to open a file named "stk-local-context.json" and write the name of created repository as value of the following key in the object: +```json +{ + "outputs": { + "created_repository": "" + } +} +``` +--- +## Implementation + +1. Checks if informed group exists, if not, aborts +2. Try to create the project with the inputted name, if it succeeded or the repository already exists +3. Writes the repository https clone path into a file which will be used into stackspot workflows +--- +# Release Notes 1.0.0 + +- Initial implementation +--- +# Usage + +To execute it locally, it's needed [stackspot cli](https://docs.stackspot.com/home/stk-cli/install) installed, then execute: + +``` +stk run action --inputs-json '{ + "visibility": "[private|public]", + "group_name": "", + "token": "", + "name": "" +}' +``` + +To execute it with Stackspot workflow, just follow the steps: +1. [Publish the action](https://docs.stackspot.com/guides/studio-guides/publish-action/) +2. [Add it to a stack](https://docs.stackspot.com/guides/studio-guides/create-stack/) +3. [Add the stack to a workspace](https://docs.stackspot.com/home/workspace/add-stacks/) +4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) \ No newline at end of file diff --git a/stackspot-actions/gitlab/docs/release-notes.md b/stackspot-actions/gitlab/docs/release-notes.md deleted file mode 100644 index 64fcb557..00000000 --- a/stackspot-actions/gitlab/docs/release-notes.md +++ /dev/null @@ -1,3 +0,0 @@ -# Release Notes 1.0.0 - -- Initial implementation \ No newline at end of file diff --git a/stackspot-actions/gitlab/docs/requirements.md b/stackspot-actions/gitlab/docs/requirements.md deleted file mode 100644 index 213648d7..00000000 --- a/stackspot-actions/gitlab/docs/requirements.md +++ /dev/null @@ -1,5 +0,0 @@ -## Before using this Action - -- Access to a Gitlab account -- A group of gitlab where the project will be associated -- \ No newline at end of file From 6cd55519a08b666ae71734b9a1e16d93e78e8f48 Mon Sep 17 00:00:00 2001 From: fabianofernandeszup Date: Tue, 28 Nov 2023 23:12:38 -0300 Subject: [PATCH 3/7] Fix markdow Signed-off-by: fabianofernandeszup --- docs_action/en_us/doc.md | 14 +++++++------- docs_action/pt_br/doc.md | 14 +++++++------- docs_plugin/en_us/doc.md | 14 +++++++------- docs_plugin/pt_br/doc.md | 14 +++++++------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/docs_action/en_us/doc.md b/docs_action/en_us/doc.md index 8bfd1116..21b12a03 100644 --- a/docs_action/en_us/doc.md +++ b/docs_action/en_us/doc.md @@ -1,13 +1,13 @@ -# About +## About Action to create a workflow in a repository so that it can be used as a repository for executing StackSpot workflows, allowing the creation of Apps, Infrastructure and execution of actions through the Portal. - -# Implementation +--- +## Implementation This action will create a workflow according to the selected provider, after that just commit the files to the SCM, and Enter its URL in the account's SCM configuration on the Stack Spot Portal. - -# Requirements +--- +## Requirements - Account with a supported SCM provider. - -# Release Notes +--- +## Release Notes ... \ No newline at end of file diff --git a/docs_action/pt_br/doc.md b/docs_action/pt_br/doc.md index 7b3cde71..c193ea29 100644 --- a/docs_action/pt_br/doc.md +++ b/docs_action/pt_br/doc.md @@ -1,13 +1,13 @@ -# Sobre +## Sobre Action para criar um workflow em um repositório para que esse seja utilizado como repositório de execução de workflows da StackSpot, permitindo a criação de Apps, Infra e execução de actions pelo Portal. - -# Implementação +--- +## Implementação Essa action irá criar um workflow de acordo com o provider selecionado, após isso basta comitar os arquivos para o SCM, e informar a url do mesmo na configuração de SCM da conta no Portal da Stack Spot. - -# Requerimentos +--- +## Requerimentos - Conta em algum provider de SCM suportado. - -# Notas da Release +--- +## Notas da Release ... diff --git a/docs_plugin/en_us/doc.md b/docs_plugin/en_us/doc.md index b16f47c1..6c31d313 100644 --- a/docs_plugin/en_us/doc.md +++ b/docs_plugin/en_us/doc.md @@ -1,13 +1,13 @@ -# About +## About Plugin to create a workflow in a repository so that it can be used as a repository for executing StackSpot workflows, allowing the creation of Apps, Infrastructure and execution of actions through the Portal. - -# Implementation +--- +## Implementation This plugin will create a workflow according to the selected provider, after that just commit the files to the SCM, and Enter its URL in the account's SCM configuration on the Stack Spot Portal. - -# Requirements +--- +## Requirements - Account with a supported SCM provider. - -# Release Notes +--- +## Release Notes ... \ No newline at end of file diff --git a/docs_plugin/pt_br/doc.md b/docs_plugin/pt_br/doc.md index 5b7a8e37..3d4842b4 100644 --- a/docs_plugin/pt_br/doc.md +++ b/docs_plugin/pt_br/doc.md @@ -1,13 +1,13 @@ -# Sobre +## Sobre Plugin para criar um workflow em um repositório para que esse seja utilizado como repositório de execução de workflows da StackSpot, permitindo a criação de Apps, Infra e execução de actions pelo Portal. - -# Implementação +--- +## Implementação Esse plugin irá criar um workflow de acordo com o provider selecionado, após isso basta comitar os arquivos para o SCM, e informar a url do mesmo na configuração de SCM da conta no Portal da Stack Spot. - -# Requerimentos +--- +## Requerimentos - Conta em algum provider de SCM suportado. - -# Notas da Release +--- +## Notas da Release ... From 357a83f2220bf997ea01603f4e52212a58bf79ae Mon Sep 17 00:00:00 2001 From: fabianofernandeszup Date: Tue, 28 Nov 2023 23:26:13 -0300 Subject: [PATCH 4/7] Fix yamls Signed-off-by: fabianofernandeszup --- action.yaml | 190 ++++++++++++++++++++++------------------------ docs/en_us/doc.md | 0 docs/pt_br/doc.md | 0 plugin.yaml | 85 ++++++++++----------- 4 files changed, 131 insertions(+), 144 deletions(-) create mode 100644 docs/en_us/doc.md create mode 100644 docs/pt_br/doc.md diff --git a/action.yaml b/action.yaml index 0dd301c3..547eaed8 100644 --- a/action.yaml +++ b/action.yaml @@ -6,107 +6,97 @@ metadata: display-name: StackSpot Setup Workflows. description: Action to configure Stackspot workflows in SCM provider version: 1.0.0 -spec: +spec: type: python docs: - pt_br: stackspot-actions/setup-stackspot-workflows/docs/pt_br/doc.md - en_us: stackspot-actions/setup-stackspot-workflows/docs/en_us/doc.md + pt_br: docs/pt_br/doc.md + en_us: docs/en_us/doc.md inputs: - - label: SCM provider - name: provider - type: text - items: - - Azure - - Bitbucket - - Github - - Gitlab - - - label: Personal Access Token - name: pat - type: password - condition: - variable: provider - operator: containsAny - value: - - Azure - - Github - - Gitlab - - - label: Project Name - name: project_name - type: text - condition: - variable: provider - operator: containsAny - value: - - Azure - - Gitlab - - - label: Project Key - name: project_key - type: text - condition: - variable: provider - operator: containsAny - value: - - Bitbucket - - - label: Organization Name - name: org_name - type: text - condition: - variable: provider - operator: containsAny - value: - - Azure - - Github - - - label: Repository Name - name: repo_name - type: text - condition: - variable: provider - operator: containsAny - value: - - Github - - Bitbucket - - Azure - - - label: Group Name - name: group_name - type: text - condition: - variable: provider - operator: containsAny - value: - - Gitlab - - - label: Workspace Name - name: workspace_name - type: text - condition: - variable: provider - operator: containsAny - value: - - Bitbucket - - - label: Client Key - name: client_key - type: text - condition: - variable: provider - operator: containsAny - value: - - Bitbucket - - - label: Client Secret - name: client_secret - type: password - condition: - variable: provider - operator: containsAny - value: - - Bitbucket - + - label: SCM provider + name: provider + type: text + items: + - Azure + - Bitbucket + - Github + - Gitlab + - label: Personal Access Token + name: pat + type: password + condition: + variable: provider + operator: containsAny + value: + - Azure + - Github + - Gitlab + - label: Project Name + name: project_name + type: text + condition: + variable: provider + operator: containsAny + value: + - Azure + - Gitlab + - label: Project Key + name: project_key + type: text + condition: + variable: provider + operator: containsAny + value: + - Bitbucket + - label: Organization Name + name: org_name + type: text + condition: + variable: provider + operator: containsAny + value: + - Azure + - Github + - label: Repository Name + name: repo_name + type: text + condition: + variable: provider + operator: containsAny + value: + - Github + - Bitbucket + - Azure + - label: Group Name + name: group_name + type: text + condition: + variable: provider + operator: containsAny + value: + - Gitlab + - label: Workspace Name + name: workspace_name + type: text + condition: + variable: provider + operator: containsAny + value: + - Bitbucket + - label: Client Key + name: client_key + type: text + condition: + variable: provider + operator: containsAny + value: + - Bitbucket + - label: Client Secret + name: client_secret + type: password + condition: + variable: provider + operator: containsAny + value: + - Bitbucket python: - script: stackspot-actions/setup-stackspot-workflows/main.py \ No newline at end of file + script: stackspot-actions/setup-stackspot-workflows/main.py diff --git a/docs/en_us/doc.md b/docs/en_us/doc.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/pt_br/doc.md b/docs/pt_br/doc.md new file mode 100644 index 00000000..e69de29b diff --git a/plugin.yaml b/plugin.yaml index bb6ffbd2..35eac5aa 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -9,51 +9,48 @@ metadata: spec: type: app compatibility: - - python + - python docs: - pt_br: stackspot-actions/setup-stackspot-workflows/docs/pt_br/doc.md - en_us: stackspot-actions/setup-stackspot-workflows/docs/en_us/doc.md + pt_br: docs/pt_br/doc.md + en_us: docs/en_us/doc.md repository: https://github.com/stack-spot/stackspot-workflows-action - technologies: # Ref: https://docs.stackspot.com/docs/create-stacks/yaml-files/yaml/#technologies - - Api + technologies: + - Api inputs: - - label: SCM provider - name: provider - type: text - items: - - Azure - - Bitbucket - - Github - - Gitlab + - label: SCM provider + name: provider + type: text + items: + - Azure + - Bitbucket + - Github + - Gitlab hooks: - - type: render-templates - trigger: after-render - path: workflow-templates/azure - condition: - variable: provider - operator: == - value: Azure - - - type: render-templates - trigger: after-render - path: workflow-templates/github - condition: - variable: provider - operator: == - value: Github - - - type: render-templates - trigger: after-render - path: workflow-templates/bitbucket - condition: - variable: provider - operator: == - value: Bitbucket - - - type: render-templates - trigger: after-render - path: workflow-templates/gitlab - condition: - variable: provider - operator: == - value: Gitlab \ No newline at end of file + - type: render-templates + trigger: after-render + path: workflow-templates/azure + condition: + variable: provider + operator: == + value: Azure + - type: render-templates + trigger: after-render + path: workflow-templates/github + condition: + variable: provider + operator: == + value: Github + - type: render-templates + trigger: after-render + path: workflow-templates/bitbucket + condition: + variable: provider + operator: == + value: Bitbucket + - type: render-templates + trigger: after-render + path: workflow-templates/gitlab + condition: + variable: provider + operator: == + value: Gitlab From 16b7ed95a3a2f4bf98527be22e92432b7f861e56 Mon Sep 17 00:00:00 2001 From: fabianofernandeszup Date: Tue, 28 Nov 2023 23:28:48 -0300 Subject: [PATCH 5/7] Fix yamls Signed-off-by: fabianofernandeszup --- docs/en_us/doc.md | 0 docs/pt_br/doc.md | 0 .../azure/create-repo-azure/action.yaml | 29 +++++---- .../azure/create-repo-azure/docs/en_us/doc.md | 29 --------- .../azure/create-repo-azure/docs/pt_br/doc.md | 29 --------- .../create-repo-bitbucket/action.yaml | 37 ++++++----- .../create-repo-bitbucket/docs/en_us/doc.md | 30 --------- .../create-repo-bitbucket/docs/pt_br/doc.md | 30 --------- .../github/create-repo-github/action.yaml | 35 +++++------ .../create-repo-github/docs/en_us/doc.md | 27 -------- .../create-repo-github/docs/pt_br/doc.md | 27 -------- stackspot-actions/gitlab/action.yaml | 48 +++++++------- stackspot-actions/gitlab/docs/en_us/doc.md | 62 ------------------- stackspot-actions/gitlab/docs/pt_br/doc.md | 62 ------------------- 14 files changed, 73 insertions(+), 372 deletions(-) delete mode 100644 docs/en_us/doc.md delete mode 100644 docs/pt_br/doc.md diff --git a/docs/en_us/doc.md b/docs/en_us/doc.md deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/pt_br/doc.md b/docs/pt_br/doc.md deleted file mode 100644 index e69de29b..00000000 diff --git a/stackspot-actions/azure/create-repo-azure/action.yaml b/stackspot-actions/azure/create-repo-azure/action.yaml index 65d9275d..f2c26231 100644 --- a/stackspot-actions/azure/create-repo-azure/action.yaml +++ b/stackspot-actions/azure/create-repo-azure/action.yaml @@ -7,22 +7,21 @@ metadata: version: 0.0.1 spec: type: python - about: docs/about.md - usage: docs/usage.md - release-notes: docs/release-notes.md - requirements: docs/requirements.md - implementation: docs/implementation.md inputs: - - label: Project name - name: project_name - type: text - required: true - help: Input the Azure devOps project name, if it does not exist it will be created - - label: Repository name - name: name - type: text - required: true - help: Input the Azure devOps repository name, if it does not exist it will be created + - label: Project name + name: project_name + type: text + required: true + help: Input the Azure devOps project name, if it does not exist it will be created + - label: Repository name + name: name + type: text + required: true + help: Input the Azure devOps repository name, if it does not exist it will be + created python: workdir: . script: script.py + docs: + pt_br: docs/pt_br/doc.md + en_us: docs/en_us/doc.md diff --git a/stackspot-actions/azure/create-repo-azure/docs/en_us/doc.md b/stackspot-actions/azure/create-repo-azure/docs/en_us/doc.md index 011daa36..e69de29b 100644 --- a/stackspot-actions/azure/create-repo-azure/docs/en_us/doc.md +++ b/stackspot-actions/azure/create-repo-azure/docs/en_us/doc.md @@ -1,29 +0,0 @@ -## Requirements ---- -## Azure create repository action - -Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Azure. -The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. ---- -## Implementation ---- -## Release notes ---- -# Usage - -To execute it locally, it's needed [stackspot cli](https://docs.stackspot.com/home/stk-cli/install) installed, then execute: - -``` -stk run action --inputs-json '{ - "org": "", - "token": "", - "project_name": "", - "name": "" -}' -``` - -To execute it with Stackspot workflow, just follow the steps: -1. [Publish the action](https://docs.stackspot.com/guides/studio-guides/publish-action/) -2. [Add it to a stack](https://docs.stackspot.com/guides/studio-guides/create-stack/) -3. [Add the stack to a workspace](https://docs.stackspot.com/home/workspace/add-stacks/) -4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) \ No newline at end of file diff --git a/stackspot-actions/azure/create-repo-azure/docs/pt_br/doc.md b/stackspot-actions/azure/create-repo-azure/docs/pt_br/doc.md index 011daa36..e69de29b 100644 --- a/stackspot-actions/azure/create-repo-azure/docs/pt_br/doc.md +++ b/stackspot-actions/azure/create-repo-azure/docs/pt_br/doc.md @@ -1,29 +0,0 @@ -## Requirements ---- -## Azure create repository action - -Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Azure. -The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. ---- -## Implementation ---- -## Release notes ---- -# Usage - -To execute it locally, it's needed [stackspot cli](https://docs.stackspot.com/home/stk-cli/install) installed, then execute: - -``` -stk run action --inputs-json '{ - "org": "", - "token": "", - "project_name": "", - "name": "" -}' -``` - -To execute it with Stackspot workflow, just follow the steps: -1. [Publish the action](https://docs.stackspot.com/guides/studio-guides/publish-action/) -2. [Add it to a stack](https://docs.stackspot.com/guides/studio-guides/create-stack/) -3. [Add the stack to a workspace](https://docs.stackspot.com/home/workspace/add-stacks/) -4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) \ No newline at end of file diff --git a/stackspot-actions/bitbucket/create-repo-bitbucket/action.yaml b/stackspot-actions/bitbucket/create-repo-bitbucket/action.yaml index aa40d3bc..3b54d57e 100644 --- a/stackspot-actions/bitbucket/create-repo-bitbucket/action.yaml +++ b/stackspot-actions/bitbucket/create-repo-bitbucket/action.yaml @@ -7,26 +7,25 @@ metadata: version: 0.0.1 spec: type: python - about: docs/about.md - usage: docs/usage.md - release-notes: docs/release-notes.md - requirements: docs/requirements.md - implementation: docs/implementation.md inputs: - - label: Bitbucket project name - name: project_name - type: text - required: true - help: Input the Bitbucket devOps project name, if it does not exist it will be created - - label: Repository visibility - name: visibility - type: text - required: true - help: Input the Bitbucket repository visibility - items: - - PUBLIC - - PRIVATE - default: PRIVATE + - label: Bitbucket project name + name: project_name + type: text + required: true + help: Input the Bitbucket devOps project name, if it does not exist it will be + created + - label: Repository visibility + name: visibility + type: text + required: true + help: Input the Bitbucket repository visibility + items: + - PUBLIC + - PRIVATE + default: PRIVATE python: workdir: . script: script.py + docs: + pt_br: docs/pt_br/doc.md + en_us: docs/en_us/doc.md diff --git a/stackspot-actions/bitbucket/create-repo-bitbucket/docs/en_us/doc.md b/stackspot-actions/bitbucket/create-repo-bitbucket/docs/en_us/doc.md index 6205574b..e69de29b 100644 --- a/stackspot-actions/bitbucket/create-repo-bitbucket/docs/en_us/doc.md +++ b/stackspot-actions/bitbucket/create-repo-bitbucket/docs/en_us/doc.md @@ -1,30 +0,0 @@ -## Requirements ---- -## Bitbucket create repository action - -Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Bitbucket. -The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. ---- -## Implementation ---- -## Release notes ---- -# Usage - -To execute it locally, it's needed [stackspot cli](https://docs.stackspot.com/home/stk-cli/install) installed, then execute: - -``` -stk run action --inputs-json '{ - "visibility": "[PRIVATE|PUBLIC]", - "project_name": "", - "token": "", - "name": "", - "org": "" -}' -``` - -To execute it with Stackspot workflow, just follow the steps: -1. [Publish the action](https://docs.stackspot.com/guides/studio-guides/publish-action/) -2. [Add it to a stack](https://docs.stackspot.com/guides/studio-guides/create-stack/) -3. [Add the stack to a workspace](https://docs.stackspot.com/home/workspace/add-stacks/) -4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) \ No newline at end of file diff --git a/stackspot-actions/bitbucket/create-repo-bitbucket/docs/pt_br/doc.md b/stackspot-actions/bitbucket/create-repo-bitbucket/docs/pt_br/doc.md index 6205574b..e69de29b 100644 --- a/stackspot-actions/bitbucket/create-repo-bitbucket/docs/pt_br/doc.md +++ b/stackspot-actions/bitbucket/create-repo-bitbucket/docs/pt_br/doc.md @@ -1,30 +0,0 @@ -## Requirements ---- -## Bitbucket create repository action - -Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Bitbucket. -The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. ---- -## Implementation ---- -## Release notes ---- -# Usage - -To execute it locally, it's needed [stackspot cli](https://docs.stackspot.com/home/stk-cli/install) installed, then execute: - -``` -stk run action --inputs-json '{ - "visibility": "[PRIVATE|PUBLIC]", - "project_name": "", - "token": "", - "name": "", - "org": "" -}' -``` - -To execute it with Stackspot workflow, just follow the steps: -1. [Publish the action](https://docs.stackspot.com/guides/studio-guides/publish-action/) -2. [Add it to a stack](https://docs.stackspot.com/guides/studio-guides/create-stack/) -3. [Add the stack to a workspace](https://docs.stackspot.com/home/workspace/add-stacks/) -4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) \ No newline at end of file diff --git a/stackspot-actions/github/create-repo-github/action.yaml b/stackspot-actions/github/create-repo-github/action.yaml index c4dd7e92..2b44bea3 100644 --- a/stackspot-actions/github/create-repo-github/action.yaml +++ b/stackspot-actions/github/create-repo-github/action.yaml @@ -7,25 +7,24 @@ metadata: version: 1.0.2 spec: type: python - about: docs/about.md - usage: docs/usage.md - release-notes: docs/release-notes.md - implementation: docs/implementation.md inputs: - - label: Visibility - name: visibility - type: text - required: true - items: - - public - - internal - - private - help: "Internal repo can only be created by enterprise accounts." - - label: Repository name - name: name - type: text - required: true - help: Input the repository name, if it does not exist it will be created + - label: Visibility + name: visibility + type: text + required: true + items: + - public + - internal + - private + help: Internal repo can only be created by enterprise accounts. + - label: Repository name + name: name + type: text + required: true + help: Input the repository name, if it does not exist it will be created python: workdir: . script: script.py + docs: + pt_br: docs/pt_br/doc.md + en_us: docs/en_us/doc.md diff --git a/stackspot-actions/github/create-repo-github/docs/en_us/doc.md b/stackspot-actions/github/create-repo-github/docs/en_us/doc.md index 97744752..e69de29b 100644 --- a/stackspot-actions/github/create-repo-github/docs/en_us/doc.md +++ b/stackspot-actions/github/create-repo-github/docs/en_us/doc.md @@ -1,27 +0,0 @@ -## Gitlab create repository action - -Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Github. -The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. ---- -## Implementation ---- -## Release notes ---- -# Usage - -To execute it locally, it's needed [stackspot cli](https://docs.stackspot.com/home/stk-cli/install) installed, then execute: - -``` -stk run action --inputs-json '{ - "visibility": "[private|public|internal]", - "org": "", - "token": "", - "name": "" -}' -``` - -To execute it with Stackspot workflow, just follow the steps: -1. [Publish the action](https://docs.stackspot.com/guides/studio-guides/publish-action/) -2. [Add it to a stack](https://docs.stackspot.com/guides/studio-guides/create-stack/) -3. [Add the stack to a workspace](https://docs.stackspot.com/home/workspace/add-stacks/) -4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) \ No newline at end of file diff --git a/stackspot-actions/github/create-repo-github/docs/pt_br/doc.md b/stackspot-actions/github/create-repo-github/docs/pt_br/doc.md index 97744752..e69de29b 100644 --- a/stackspot-actions/github/create-repo-github/docs/pt_br/doc.md +++ b/stackspot-actions/github/create-repo-github/docs/pt_br/doc.md @@ -1,27 +0,0 @@ -## Gitlab create repository action - -Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Github. -The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. ---- -## Implementation ---- -## Release notes ---- -# Usage - -To execute it locally, it's needed [stackspot cli](https://docs.stackspot.com/home/stk-cli/install) installed, then execute: - -``` -stk run action --inputs-json '{ - "visibility": "[private|public|internal]", - "org": "", - "token": "", - "name": "" -}' -``` - -To execute it with Stackspot workflow, just follow the steps: -1. [Publish the action](https://docs.stackspot.com/guides/studio-guides/publish-action/) -2. [Add it to a stack](https://docs.stackspot.com/guides/studio-guides/create-stack/) -3. [Add the stack to a workspace](https://docs.stackspot.com/home/workspace/add-stacks/) -4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) \ No newline at end of file diff --git a/stackspot-actions/gitlab/action.yaml b/stackspot-actions/gitlab/action.yaml index dbe568ae..f043a6c7 100644 --- a/stackspot-actions/gitlab/action.yaml +++ b/stackspot-actions/gitlab/action.yaml @@ -7,31 +7,31 @@ metadata: version: 1.0.0 spec: type: python - about: docs/about.md - usage: docs/usage.md - release-notes: docs/release-notes.md - requirements: docs/requirements.md - implementation: docs/implementation.md inputs: - - label: Gitlab project name - name: name - type: text - required: true - help: Input the Gitlab devOps project/repository name, if it does not exist it will be created - - label: Gitlab group name - name: group_name - type: text - required: true - help: Input the Gitlab group name. It must exist in your Gitlab account as a top-level group - - label: Repository visibility - name: visibility - type: text - required: true - help: Input the Gitlab repository visibility - items: - - public - - private - default: private + - label: Gitlab project name + name: name + type: text + required: true + help: Input the Gitlab devOps project/repository name, if it does not exist it + will be created + - label: Gitlab group name + name: group_name + type: text + required: true + help: Input the Gitlab group name. It must exist in your Gitlab account as a top-level + group + - label: Repository visibility + name: visibility + type: text + required: true + help: Input the Gitlab repository visibility + items: + - public + - private + default: private python: workdir: . script: script.py + docs: + pt_br: docs/pt_br/doc.md + en_us: docs/en_us/doc.md diff --git a/stackspot-actions/gitlab/docs/en_us/doc.md b/stackspot-actions/gitlab/docs/en_us/doc.md index 0e0107ef..e69de29b 100644 --- a/stackspot-actions/gitlab/docs/en_us/doc.md +++ b/stackspot-actions/gitlab/docs/en_us/doc.md @@ -1,62 +0,0 @@ -## Before using this Action - -- Access to a Gitlab account -- A group of gitlab where the project will be associated -- ---- -## Gitlab create repository action - -Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Gitlab. -The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. - -Feel free to clone it and add features before publish it into your studio. But first, before modifying, -there are two points of implementation that a developer should pay attention: - -1. Stackspot workflow api by default, when identifies a "create repository action", -it adds 5 hidden inputs to the stk run action workflow call. -Even if you do not declare then in action.yml they will be added. -But if you declare then in action manifest, the stackspot portal will ask these inputs when you try to dispatch a workflow, then they will not be overwritten. -These inputs are: - - name: copied from the app/infra which will be created by the workflow. - - description: copied from the description of the app/infra which will be created by the workflow. - - org: its the group_name from the workflow url, which is configured into scm integration page. - - token: The token which was configured into scm integration page, it is used to create the repository by the gitlab api. - - workflow_api_authorization: A valid token with the same rules of portal user, which dispatched the workflow, that token can be used to call stackspot apis. - -2. For now, to the workflow work well, the action need to open a file named "stk-local-context.json" and write the name of created repository as value of the following key in the object: -```json -{ - "outputs": { - "created_repository": "" - } -} -``` ---- -## Implementation - -1. Checks if informed group exists, if not, aborts -2. Try to create the project with the inputted name, if it succeeded or the repository already exists -3. Writes the repository https clone path into a file which will be used into stackspot workflows ---- -# Release Notes 1.0.0 - -- Initial implementation ---- -# Usage - -To execute it locally, it's needed [stackspot cli](https://docs.stackspot.com/home/stk-cli/install) installed, then execute: - -``` -stk run action --inputs-json '{ - "visibility": "[private|public]", - "group_name": "", - "token": "", - "name": "" -}' -``` - -To execute it with Stackspot workflow, just follow the steps: -1. [Publish the action](https://docs.stackspot.com/guides/studio-guides/publish-action/) -2. [Add it to a stack](https://docs.stackspot.com/guides/studio-guides/create-stack/) -3. [Add the stack to a workspace](https://docs.stackspot.com/home/workspace/add-stacks/) -4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) \ No newline at end of file diff --git a/stackspot-actions/gitlab/docs/pt_br/doc.md b/stackspot-actions/gitlab/docs/pt_br/doc.md index 0e0107ef..e69de29b 100644 --- a/stackspot-actions/gitlab/docs/pt_br/doc.md +++ b/stackspot-actions/gitlab/docs/pt_br/doc.md @@ -1,62 +0,0 @@ -## Before using this Action - -- Access to a Gitlab account -- A group of gitlab where the project will be associated -- ---- -## Gitlab create repository action - -Action created by Stackspot to be used into workspace workflows as a before action to create a repository, when the account scm provider is Gitlab. -The action is functional, but it was build to be simple as an example of how actions of create repository should be implemented. - -Feel free to clone it and add features before publish it into your studio. But first, before modifying, -there are two points of implementation that a developer should pay attention: - -1. Stackspot workflow api by default, when identifies a "create repository action", -it adds 5 hidden inputs to the stk run action workflow call. -Even if you do not declare then in action.yml they will be added. -But if you declare then in action manifest, the stackspot portal will ask these inputs when you try to dispatch a workflow, then they will not be overwritten. -These inputs are: - - name: copied from the app/infra which will be created by the workflow. - - description: copied from the description of the app/infra which will be created by the workflow. - - org: its the group_name from the workflow url, which is configured into scm integration page. - - token: The token which was configured into scm integration page, it is used to create the repository by the gitlab api. - - workflow_api_authorization: A valid token with the same rules of portal user, which dispatched the workflow, that token can be used to call stackspot apis. - -2. For now, to the workflow work well, the action need to open a file named "stk-local-context.json" and write the name of created repository as value of the following key in the object: -```json -{ - "outputs": { - "created_repository": "" - } -} -``` ---- -## Implementation - -1. Checks if informed group exists, if not, aborts -2. Try to create the project with the inputted name, if it succeeded or the repository already exists -3. Writes the repository https clone path into a file which will be used into stackspot workflows ---- -# Release Notes 1.0.0 - -- Initial implementation ---- -# Usage - -To execute it locally, it's needed [stackspot cli](https://docs.stackspot.com/home/stk-cli/install) installed, then execute: - -``` -stk run action --inputs-json '{ - "visibility": "[private|public]", - "group_name": "", - "token": "", - "name": "" -}' -``` - -To execute it with Stackspot workflow, just follow the steps: -1. [Publish the action](https://docs.stackspot.com/guides/studio-guides/publish-action/) -2. [Add it to a stack](https://docs.stackspot.com/guides/studio-guides/create-stack/) -3. [Add the stack to a workspace](https://docs.stackspot.com/home/workspace/add-stacks/) -4. [Configure the workspace workflow](https://docs.stackspot.com/home/workspace/configure-workflow/) \ No newline at end of file From 44256f034bf23b30b116ee8efbc10408adc33174 Mon Sep 17 00:00:00 2001 From: fabianofernandeszup Date: Wed, 29 Nov 2023 11:33:52 -0300 Subject: [PATCH 6/7] Fix docs url path Signed-off-by: fabianofernandeszup --- action.yaml | 4 ++-- plugin.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/action.yaml b/action.yaml index 547eaed8..3f7371af 100644 --- a/action.yaml +++ b/action.yaml @@ -9,8 +9,8 @@ metadata: spec: type: python docs: - pt_br: docs/pt_br/doc.md - en_us: docs/en_us/doc.md + pt_br: docs_action/pt_br/doc.md + en_us: docs_action/en_us/doc.md inputs: - label: SCM provider name: provider diff --git a/plugin.yaml b/plugin.yaml index 35eac5aa..73752266 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -11,8 +11,8 @@ spec: compatibility: - python docs: - pt_br: docs/pt_br/doc.md - en_us: docs/en_us/doc.md + pt_br: docs_plugin/pt_br/doc.md + en_us: docs_plugin/en_us/doc.md repository: https://github.com/stack-spot/stackspot-workflows-action technologies: - Api From d591a1233eb23a514971487e2630cab83f521390 Mon Sep 17 00:00:00 2001 From: fabianofernandeszup Date: Wed, 29 Nov 2023 15:11:33 -0300 Subject: [PATCH 7/7] Fix en_us and pt_br to en-us and pt-br Signed-off-by: fabianofernandeszup --- action.yaml | 4 ++-- docs_action/{en_us => en-us}/doc.md | 0 docs_action/{pt_br => pt-br}/doc.md | 0 docs_plugin/{en_us => en-us}/doc.md | 0 docs_plugin/{pt_br => pt-br}/doc.md | 0 plugin.yaml | 4 ++-- stackspot-actions/azure/create-repo-azure/action.yaml | 4 ++-- .../azure/create-repo-azure/docs/{en_us => en-us}/doc.md | 0 .../azure/create-repo-azure/docs/{pt_br => pt-br}/doc.md | 0 stackspot-actions/bitbucket/create-repo-bitbucket/action.yaml | 4 ++-- .../create-repo-bitbucket/docs/{en_us => en-us}/doc.md | 0 .../create-repo-bitbucket/docs/{pt_br => pt-br}/doc.md | 0 stackspot-actions/github/create-repo-github/action.yaml | 4 ++-- .../github/create-repo-github/docs/{en_us => en-us}/doc.md | 0 .../github/create-repo-github/docs/{pt_br => pt-br}/doc.md | 0 stackspot-actions/gitlab/action.yaml | 4 ++-- stackspot-actions/gitlab/docs/{en_us => en-us}/doc.md | 0 stackspot-actions/gitlab/docs/{pt_br => pt-br}/doc.md | 0 18 files changed, 12 insertions(+), 12 deletions(-) rename docs_action/{en_us => en-us}/doc.md (100%) rename docs_action/{pt_br => pt-br}/doc.md (100%) rename docs_plugin/{en_us => en-us}/doc.md (100%) rename docs_plugin/{pt_br => pt-br}/doc.md (100%) rename stackspot-actions/azure/create-repo-azure/docs/{en_us => en-us}/doc.md (100%) rename stackspot-actions/azure/create-repo-azure/docs/{pt_br => pt-br}/doc.md (100%) rename stackspot-actions/bitbucket/create-repo-bitbucket/docs/{en_us => en-us}/doc.md (100%) rename stackspot-actions/bitbucket/create-repo-bitbucket/docs/{pt_br => pt-br}/doc.md (100%) rename stackspot-actions/github/create-repo-github/docs/{en_us => en-us}/doc.md (100%) rename stackspot-actions/github/create-repo-github/docs/{pt_br => pt-br}/doc.md (100%) rename stackspot-actions/gitlab/docs/{en_us => en-us}/doc.md (100%) rename stackspot-actions/gitlab/docs/{pt_br => pt-br}/doc.md (100%) diff --git a/action.yaml b/action.yaml index 3f7371af..add38535 100644 --- a/action.yaml +++ b/action.yaml @@ -9,8 +9,8 @@ metadata: spec: type: python docs: - pt_br: docs_action/pt_br/doc.md - en_us: docs_action/en_us/doc.md + pt_br: docs_action/pt-br/doc.md + en_us: docs_action/en-us/doc.md inputs: - label: SCM provider name: provider diff --git a/docs_action/en_us/doc.md b/docs_action/en-us/doc.md similarity index 100% rename from docs_action/en_us/doc.md rename to docs_action/en-us/doc.md diff --git a/docs_action/pt_br/doc.md b/docs_action/pt-br/doc.md similarity index 100% rename from docs_action/pt_br/doc.md rename to docs_action/pt-br/doc.md diff --git a/docs_plugin/en_us/doc.md b/docs_plugin/en-us/doc.md similarity index 100% rename from docs_plugin/en_us/doc.md rename to docs_plugin/en-us/doc.md diff --git a/docs_plugin/pt_br/doc.md b/docs_plugin/pt-br/doc.md similarity index 100% rename from docs_plugin/pt_br/doc.md rename to docs_plugin/pt-br/doc.md diff --git a/plugin.yaml b/plugin.yaml index 73752266..e48fd6d3 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -11,8 +11,8 @@ spec: compatibility: - python docs: - pt_br: docs_plugin/pt_br/doc.md - en_us: docs_plugin/en_us/doc.md + pt_br: docs_plugin/pt-br/doc.md + en_us: docs_plugin/en-us/doc.md repository: https://github.com/stack-spot/stackspot-workflows-action technologies: - Api diff --git a/stackspot-actions/azure/create-repo-azure/action.yaml b/stackspot-actions/azure/create-repo-azure/action.yaml index f2c26231..3b96bb40 100644 --- a/stackspot-actions/azure/create-repo-azure/action.yaml +++ b/stackspot-actions/azure/create-repo-azure/action.yaml @@ -23,5 +23,5 @@ spec: workdir: . script: script.py docs: - pt_br: docs/pt_br/doc.md - en_us: docs/en_us/doc.md + pt_br: docs/pt-br/doc.md + en_us: docs/en-us/doc.md diff --git a/stackspot-actions/azure/create-repo-azure/docs/en_us/doc.md b/stackspot-actions/azure/create-repo-azure/docs/en-us/doc.md similarity index 100% rename from stackspot-actions/azure/create-repo-azure/docs/en_us/doc.md rename to stackspot-actions/azure/create-repo-azure/docs/en-us/doc.md diff --git a/stackspot-actions/azure/create-repo-azure/docs/pt_br/doc.md b/stackspot-actions/azure/create-repo-azure/docs/pt-br/doc.md similarity index 100% rename from stackspot-actions/azure/create-repo-azure/docs/pt_br/doc.md rename to stackspot-actions/azure/create-repo-azure/docs/pt-br/doc.md diff --git a/stackspot-actions/bitbucket/create-repo-bitbucket/action.yaml b/stackspot-actions/bitbucket/create-repo-bitbucket/action.yaml index 3b54d57e..50dc4cf9 100644 --- a/stackspot-actions/bitbucket/create-repo-bitbucket/action.yaml +++ b/stackspot-actions/bitbucket/create-repo-bitbucket/action.yaml @@ -27,5 +27,5 @@ spec: workdir: . script: script.py docs: - pt_br: docs/pt_br/doc.md - en_us: docs/en_us/doc.md + pt_br: docs/pt-br/doc.md + en_us: docs/en-us/doc.md diff --git a/stackspot-actions/bitbucket/create-repo-bitbucket/docs/en_us/doc.md b/stackspot-actions/bitbucket/create-repo-bitbucket/docs/en-us/doc.md similarity index 100% rename from stackspot-actions/bitbucket/create-repo-bitbucket/docs/en_us/doc.md rename to stackspot-actions/bitbucket/create-repo-bitbucket/docs/en-us/doc.md diff --git a/stackspot-actions/bitbucket/create-repo-bitbucket/docs/pt_br/doc.md b/stackspot-actions/bitbucket/create-repo-bitbucket/docs/pt-br/doc.md similarity index 100% rename from stackspot-actions/bitbucket/create-repo-bitbucket/docs/pt_br/doc.md rename to stackspot-actions/bitbucket/create-repo-bitbucket/docs/pt-br/doc.md diff --git a/stackspot-actions/github/create-repo-github/action.yaml b/stackspot-actions/github/create-repo-github/action.yaml index 2b44bea3..76a175ca 100644 --- a/stackspot-actions/github/create-repo-github/action.yaml +++ b/stackspot-actions/github/create-repo-github/action.yaml @@ -26,5 +26,5 @@ spec: workdir: . script: script.py docs: - pt_br: docs/pt_br/doc.md - en_us: docs/en_us/doc.md + pt_br: docs/pt-br/doc.md + en_us: docs/en-us/doc.md diff --git a/stackspot-actions/github/create-repo-github/docs/en_us/doc.md b/stackspot-actions/github/create-repo-github/docs/en-us/doc.md similarity index 100% rename from stackspot-actions/github/create-repo-github/docs/en_us/doc.md rename to stackspot-actions/github/create-repo-github/docs/en-us/doc.md diff --git a/stackspot-actions/github/create-repo-github/docs/pt_br/doc.md b/stackspot-actions/github/create-repo-github/docs/pt-br/doc.md similarity index 100% rename from stackspot-actions/github/create-repo-github/docs/pt_br/doc.md rename to stackspot-actions/github/create-repo-github/docs/pt-br/doc.md diff --git a/stackspot-actions/gitlab/action.yaml b/stackspot-actions/gitlab/action.yaml index f043a6c7..512d4040 100644 --- a/stackspot-actions/gitlab/action.yaml +++ b/stackspot-actions/gitlab/action.yaml @@ -33,5 +33,5 @@ spec: workdir: . script: script.py docs: - pt_br: docs/pt_br/doc.md - en_us: docs/en_us/doc.md + pt_br: docs/pt-br/doc.md + en_us: docs/en-us/doc.md diff --git a/stackspot-actions/gitlab/docs/en_us/doc.md b/stackspot-actions/gitlab/docs/en-us/doc.md similarity index 100% rename from stackspot-actions/gitlab/docs/en_us/doc.md rename to stackspot-actions/gitlab/docs/en-us/doc.md diff --git a/stackspot-actions/gitlab/docs/pt_br/doc.md b/stackspot-actions/gitlab/docs/pt-br/doc.md similarity index 100% rename from stackspot-actions/gitlab/docs/pt_br/doc.md rename to stackspot-actions/gitlab/docs/pt-br/doc.md