@stackgenhq/backstage-plugin-stackgen-backend 0.3.6-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +485 -0
- package/config.d.ts +39 -0
- package/dist/actions/core/assign_project_members_action.cjs.js +227 -0
- package/dist/actions/core/assign_project_members_action.cjs.js.map +1 -0
- package/dist/actions/core/create_appstack_action.cjs.js +953 -0
- package/dist/actions/core/create_appstack_action.cjs.js.map +1 -0
- package/dist/actions/core/create_project_action.cjs.js +243 -0
- package/dist/actions/core/create_project_action.cjs.js.map +1 -0
- package/dist/actions/core/download_iac_action.cjs.js +133 -0
- package/dist/actions/core/download_iac_action.cjs.js.map +1 -0
- package/dist/actions/core/set_environment_variable_values_action.cjs.js +121 -0
- package/dist/actions/core/set_environment_variable_values_action.cjs.js.map +1 -0
- package/dist/actions/core/set_state_backend_action.cjs.js +174 -0
- package/dist/actions/core/set_state_backend_action.cjs.js.map +1 -0
- package/dist/actions/exporter/export_iac_to_git_action.cjs.js +290 -0
- package/dist/actions/exporter/export_iac_to_git_action.cjs.js.map +1 -0
- package/dist/actions/exporter/list_vault_secrets_action.cjs.js +39 -0
- package/dist/actions/exporter/list_vault_secrets_action.cjs.js.map +1 -0
- package/dist/config/constants.cjs.js +23 -0
- package/dist/config/constants.cjs.js.map +1 -0
- package/dist/exporter/exportOverrides.cjs.js +27 -0
- package/dist/exporter/exportOverrides.cjs.js.map +1 -0
- package/dist/exporter/gitExporterConfigHttp.cjs.js +105 -0
- package/dist/exporter/gitExporterConfigHttp.cjs.js.map +1 -0
- package/dist/exporter/http.cjs.js +14 -0
- package/dist/exporter/http.cjs.js.map +1 -0
- package/dist/exporter/paths.cjs.js +25 -0
- package/dist/exporter/paths.cjs.js.map +1 -0
- package/dist/exporter/projectGitExporterTemplate.cjs.js +62 -0
- package/dist/exporter/projectGitExporterTemplate.cjs.js.map +1 -0
- package/dist/exporter/topologyResolve.cjs.js +71 -0
- package/dist/exporter/topologyResolve.cjs.js.map +1 -0
- package/dist/index.cjs.js +31 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +224 -0
- package/dist/lib/extractArchive.cjs.js +62 -0
- package/dist/lib/extractArchive.cjs.js.map +1 -0
- package/dist/modules/stackgenExporterScaffolderModule.cjs.js +29 -0
- package/dist/modules/stackgenExporterScaffolderModule.cjs.js.map +1 -0
- package/dist/modules/stackgenUiProxiesModule.cjs.js +366 -0
- package/dist/modules/stackgenUiProxiesModule.cjs.js.map +1 -0
- package/dist/plugin/plugin.cjs.js +136 -0
- package/dist/plugin/plugin.cjs.js.map +1 -0
- package/dist/plugin/router.cjs.js +341 -0
- package/dist/plugin/router.cjs.js.map +1 -0
- package/dist/services/MappingsService/mappingsService.cjs.js +149 -0
- package/dist/services/MappingsService/mappingsService.cjs.js.map +1 -0
- package/dist/services/StackgenService/stackgenService.cjs.js +267 -0
- package/dist/services/StackgenService/stackgenService.cjs.js.map +1 -0
- package/dist/utils/api-objects.cjs.js +205 -0
- package/dist/utils/api-objects.cjs.js.map +1 -0
- package/dist/vendor/stackgen-api-client/index.cjs.js +47681 -0
- package/dist/vendor/stackgen-api-client/index.cjs.js.map +1 -0
- package/migrations/20250131055302_init.js +24 -0
- package/migrations/20250305123456_alter_type_associations.js +23 -0
- package/package.json +86 -0
- package/templates/appstack-configure-environment.yaml +81 -0
- package/templates/appstack-from-template.yaml +76 -0
- package/templates/appstack-with-modules.yaml +69 -0
- package/templates/appstack-with-resources.yaml +81 -0
- package/templates/export-iac.yaml +97 -0
- package/templates/full-infra-setup.yaml +156 -0
- package/templates/git_export_exporter_multi_scm.yaml +123 -0
- package/templates/project-advanced.yaml +77 -0
- package/templates/project-basic.yaml +39 -0
- package/templates/project-with-members.yaml +86 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# Full Infrastructure Setup
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# The most comprehensive template. Creates a project with Git config, an
|
|
5
|
+
# AppStack with a resource pack, and then provisions production & staging
|
|
6
|
+
# environments — each with per-environment Terraform variables and S3
|
|
7
|
+
# state backends.
|
|
8
|
+
#
|
|
9
|
+
# This template demonstrates:
|
|
10
|
+
# • Git configuration for IaC source control
|
|
11
|
+
# • Resource pack provisioning
|
|
12
|
+
# • Environment creation with Terraform variables
|
|
13
|
+
# • S3 remote state backend configuration per environment
|
|
14
|
+
# =============================================================================
|
|
15
|
+
apiVersion: scaffolder.backstage.io/v1beta3
|
|
16
|
+
kind: Template
|
|
17
|
+
metadata:
|
|
18
|
+
name: stackgen-full-setup
|
|
19
|
+
title: Full Infrastructure Setup
|
|
20
|
+
description: Create a project, AppStack, and environments with Terraform variables and S3 state backends — all in one flow
|
|
21
|
+
spec:
|
|
22
|
+
owner: user:guest
|
|
23
|
+
type: service
|
|
24
|
+
parameters:
|
|
25
|
+
- title: Configuration
|
|
26
|
+
required:
|
|
27
|
+
- projectName
|
|
28
|
+
- serviceName
|
|
29
|
+
- repoUrl
|
|
30
|
+
properties:
|
|
31
|
+
projectName:
|
|
32
|
+
type: string
|
|
33
|
+
title: Project Name
|
|
34
|
+
serviceName:
|
|
35
|
+
type: string
|
|
36
|
+
title: Service Name
|
|
37
|
+
repoUrl:
|
|
38
|
+
type: string
|
|
39
|
+
title: Git Repository URL
|
|
40
|
+
default: "https://github.com/org/repo.git"
|
|
41
|
+
|
|
42
|
+
steps:
|
|
43
|
+
# Step 1: Create project with Git config (no environments here — those
|
|
44
|
+
# are created by setStateBackend below with state backends attached)
|
|
45
|
+
- id: createProject
|
|
46
|
+
name: Create Project with Git Config
|
|
47
|
+
action: stackGen:createProject
|
|
48
|
+
input:
|
|
49
|
+
project:
|
|
50
|
+
name: ${{ parameters.projectName }}
|
|
51
|
+
description: "Project created via Backstage — Full Infrastructure Setup"
|
|
52
|
+
gitConfig:
|
|
53
|
+
name: "default-git-config"
|
|
54
|
+
type: "git"
|
|
55
|
+
parameters:
|
|
56
|
+
scmType: "GITHUB"
|
|
57
|
+
repoUrl: ${{ parameters.repoUrl }}
|
|
58
|
+
targetBranch: "main"
|
|
59
|
+
path: "infrastructure"
|
|
60
|
+
default: true
|
|
61
|
+
|
|
62
|
+
# Step 2: Create AppStack with resource pack + standalone S3 + custom module
|
|
63
|
+
- id: createAppStack
|
|
64
|
+
name: Create AppStack with Resources
|
|
65
|
+
action: stackGen:createAppStack
|
|
66
|
+
input:
|
|
67
|
+
appstack:
|
|
68
|
+
name: ${{ parameters.serviceName }}
|
|
69
|
+
cloudProvider: "aws"
|
|
70
|
+
teamId: ${{ steps.createProject.output.teamId }}
|
|
71
|
+
resources:
|
|
72
|
+
# Resource pack — a pre-configured bundle of resources
|
|
73
|
+
- resourceType: resourcePack
|
|
74
|
+
resourcePackId: 03c4d48d-0b01-4110-80de-9ac351545329
|
|
75
|
+
# Standalone resource — an individual S3 bucket
|
|
76
|
+
- resourceType: aws_s3
|
|
77
|
+
name: my-extra-s3-bucket
|
|
78
|
+
# Custom module — a user-authored Terraform module via templateId
|
|
79
|
+
- resourceType: vibe-coded-module
|
|
80
|
+
iacType: Terraform
|
|
81
|
+
templateId: 68a391f8-0e6b-41fb-b993-75905e9f211e
|
|
82
|
+
|
|
83
|
+
# Step 3: Create 'production' environment with TF variables + S3 backend
|
|
84
|
+
- id: setBackendProd
|
|
85
|
+
name: Create Production Environment with S3 Backend
|
|
86
|
+
action: stackGen:setStateBackend
|
|
87
|
+
input:
|
|
88
|
+
teamId: ${{ steps.createProject.output.teamId }}
|
|
89
|
+
topologyId: ${{ steps.createAppStack.output.topologyId }}
|
|
90
|
+
environmentName: "production"
|
|
91
|
+
color: "#FF0000"
|
|
92
|
+
variables:
|
|
93
|
+
- name: "region"
|
|
94
|
+
type: "string"
|
|
95
|
+
defaultValueJson: '"us-east-1"'
|
|
96
|
+
description: "AWS deployment region"
|
|
97
|
+
- name: "instance_count"
|
|
98
|
+
type: "number"
|
|
99
|
+
defaultValueJson: "3"
|
|
100
|
+
description: "Number of instances"
|
|
101
|
+
- name: "environment"
|
|
102
|
+
type: "string"
|
|
103
|
+
defaultValueJson: '"production"'
|
|
104
|
+
description: "Environment name"
|
|
105
|
+
- name: "enable_monitoring"
|
|
106
|
+
type: "bool"
|
|
107
|
+
defaultValueJson: "true"
|
|
108
|
+
description: "Enable CloudWatch monitoring"
|
|
109
|
+
stateBackend:
|
|
110
|
+
type: S3
|
|
111
|
+
config:
|
|
112
|
+
bucket: "bucket-1"
|
|
113
|
+
encrypt: "true"
|
|
114
|
+
key: "production"
|
|
115
|
+
region: "us-west-1"
|
|
116
|
+
dynamodb_table: "DynamoDBTable"
|
|
117
|
+
|
|
118
|
+
# Step 4: Create 'staging' environment with TF variables + S3 backend
|
|
119
|
+
- id: setBackendStaging
|
|
120
|
+
name: Create Staging Environment with S3 Backend
|
|
121
|
+
action: stackGen:setStateBackend
|
|
122
|
+
input:
|
|
123
|
+
teamId: ${{ steps.createProject.output.teamId }}
|
|
124
|
+
topologyId: ${{ steps.createAppStack.output.topologyId }}
|
|
125
|
+
environmentName: "staging"
|
|
126
|
+
color: "#FFA500"
|
|
127
|
+
variables:
|
|
128
|
+
- name: "region"
|
|
129
|
+
type: "string"
|
|
130
|
+
defaultValueJson: '"us-west-2"'
|
|
131
|
+
description: "AWS deployment region"
|
|
132
|
+
- name: "instance_count"
|
|
133
|
+
type: "number"
|
|
134
|
+
defaultValueJson: "1"
|
|
135
|
+
description: "Number of instances"
|
|
136
|
+
- name: "environment"
|
|
137
|
+
type: "string"
|
|
138
|
+
defaultValueJson: '"staging"'
|
|
139
|
+
description: "Environment name"
|
|
140
|
+
- name: "enable_monitoring"
|
|
141
|
+
type: "bool"
|
|
142
|
+
defaultValueJson: "false"
|
|
143
|
+
description: "Enable CloudWatch monitoring"
|
|
144
|
+
stateBackend:
|
|
145
|
+
type: S3
|
|
146
|
+
config:
|
|
147
|
+
bucket: "bucket-1"
|
|
148
|
+
encrypt: "true"
|
|
149
|
+
key: "staging"
|
|
150
|
+
region: "us-west-1"
|
|
151
|
+
dynamodb_table: "DynamoDBTable"
|
|
152
|
+
|
|
153
|
+
output:
|
|
154
|
+
links:
|
|
155
|
+
- title: "View AppStack in StackGen"
|
|
156
|
+
url: ${{ steps.createAppStack.output.appStackURL }}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Example: push IaC using stackGen:exportToGit (single step — resolves topology,
|
|
2
|
+
# picks or bootstraps git exporter config, runs stack-exporter export).
|
|
3
|
+
apiVersion: scaffolder.backstage.io/v1beta3
|
|
4
|
+
kind: Template
|
|
5
|
+
metadata:
|
|
6
|
+
name: stackgen-git-export-exporter
|
|
7
|
+
title: Push IaC via StackGen exporter
|
|
8
|
+
description: >-
|
|
9
|
+
Export an existing AppStack to Git via stack-exporter. Pick team and AppStack from the dropdowns;
|
|
10
|
+
topology and exporter appstackId are resolved via appcd /appstacks when omitted. If no git exporter
|
|
11
|
+
config exists yet, the action bootstraps one from the project default template (or pass gitConfig
|
|
12
|
+
on the action). Optional explicit topologyId.
|
|
13
|
+
spec:
|
|
14
|
+
owner: user:guest
|
|
15
|
+
type: service
|
|
16
|
+
parameters:
|
|
17
|
+
- title: Stack context
|
|
18
|
+
required:
|
|
19
|
+
- teamId
|
|
20
|
+
- appstackName
|
|
21
|
+
properties:
|
|
22
|
+
teamId:
|
|
23
|
+
type: string
|
|
24
|
+
title: Team / project
|
|
25
|
+
ui:field: TeamSelect
|
|
26
|
+
appstackName:
|
|
27
|
+
type: string
|
|
28
|
+
title: AppStack
|
|
29
|
+
ui:field: AppStackSelect
|
|
30
|
+
ui:options:
|
|
31
|
+
teamId: teamId
|
|
32
|
+
existingExporterConfigId:
|
|
33
|
+
type: string
|
|
34
|
+
title: Existing exporter config
|
|
35
|
+
description: >-
|
|
36
|
+
Optional. If this AppStack already has configs, pick one (auto-selected when there is only one).
|
|
37
|
+
If none exist and you leave this blank, a config is created from the project default.
|
|
38
|
+
To define a new config in the template instead, pass gitConfig on the stackGen:exportToGit step.
|
|
39
|
+
ui:field: ExporterGitConfigSelect
|
|
40
|
+
ui:options:
|
|
41
|
+
teamId: teamId
|
|
42
|
+
appstackName: appstackName
|
|
43
|
+
|
|
44
|
+
- title: Git export options
|
|
45
|
+
properties:
|
|
46
|
+
baseBranch:
|
|
47
|
+
type: string
|
|
48
|
+
title: Base branch
|
|
49
|
+
description: >-
|
|
50
|
+
Branch to base the change on. Prefills from the selected exporter
|
|
51
|
+
config target branch; leave blank to use the config default.
|
|
52
|
+
ui:field: ExporterBaseBranch
|
|
53
|
+
ui:options:
|
|
54
|
+
teamId: teamId
|
|
55
|
+
configId: existingExporterConfigId
|
|
56
|
+
pushBranch:
|
|
57
|
+
type: object
|
|
58
|
+
title: Push branch
|
|
59
|
+
description: >-
|
|
60
|
+
Branch StackGen pushes the generated IaC to. Prefills from the latest
|
|
61
|
+
export history when available; leaving the suggestion unchanged reuses
|
|
62
|
+
that branch (use_same_branch).
|
|
63
|
+
ui:field: ExporterPushBranch
|
|
64
|
+
ui:options:
|
|
65
|
+
teamId: teamId
|
|
66
|
+
appstackName: appstackName
|
|
67
|
+
properties:
|
|
68
|
+
branch:
|
|
69
|
+
type: string
|
|
70
|
+
useSameBranch:
|
|
71
|
+
type: boolean
|
|
72
|
+
createPr:
|
|
73
|
+
type: boolean
|
|
74
|
+
title: Create pull request
|
|
75
|
+
description: >-
|
|
76
|
+
When on, StackGen opens a pull request against the base branch. When off,
|
|
77
|
+
changes are committed directly to the base branch without a pull request.
|
|
78
|
+
default: true
|
|
79
|
+
|
|
80
|
+
- title: Pull request
|
|
81
|
+
required:
|
|
82
|
+
- prTitle
|
|
83
|
+
- commitMessage
|
|
84
|
+
properties:
|
|
85
|
+
prTitle:
|
|
86
|
+
type: string
|
|
87
|
+
title: Pull request title
|
|
88
|
+
default: StackGen IaC export
|
|
89
|
+
commitMessage:
|
|
90
|
+
type: string
|
|
91
|
+
title: Commit message
|
|
92
|
+
default: Export IaC from StackGen
|
|
93
|
+
|
|
94
|
+
steps:
|
|
95
|
+
- id: exportToGit
|
|
96
|
+
name: Export AppStack to Git
|
|
97
|
+
action: stackGen:exportToGit
|
|
98
|
+
input:
|
|
99
|
+
teamId: ${{ parameters.teamId }}
|
|
100
|
+
appstackName: ${{ parameters.appstackName }}
|
|
101
|
+
configId: ${{ parameters.existingExporterConfigId }}
|
|
102
|
+
# First-class git export controls (parity with the StackGen UI). Empty base/push
|
|
103
|
+
# branches fall back to the git config defaults; createPr defaults to true.
|
|
104
|
+
# useSameBranch is true when the push branch was suggested from history and left as-is.
|
|
105
|
+
baseBranch: ${{ parameters.baseBranch }}
|
|
106
|
+
pushBranch: ${{ parameters.pushBranch.branch }}
|
|
107
|
+
useSameBranch: ${{ parameters.pushBranch.useSameBranch }}
|
|
108
|
+
createPr: ${{ parameters.createPr }}
|
|
109
|
+
overrides:
|
|
110
|
+
- key: pr_title
|
|
111
|
+
value: ${{ parameters.prTitle }}
|
|
112
|
+
- key: commit_msg
|
|
113
|
+
value: ${{ parameters.commitMessage }}
|
|
114
|
+
|
|
115
|
+
output:
|
|
116
|
+
links:
|
|
117
|
+
# Present when a pull request is created (createPr on). For commit-only exports,
|
|
118
|
+
# use steps.exportToGit.output.committedBranch / notes instead.
|
|
119
|
+
- title: View pull request
|
|
120
|
+
url: ${{ steps.exportToGit.output.pullRequestUrl }}
|
|
121
|
+
text:
|
|
122
|
+
- title: Export result
|
|
123
|
+
content: ${{ steps.exportToGit.output.notes }}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# Create Project (Advanced)
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# Creates a fully configured StackGen project with:
|
|
5
|
+
# • Git configuration (GitHub, main branch, user-provided repo URL)
|
|
6
|
+
# • Two environments: dev and production
|
|
7
|
+
# • A root-level variable "region" (default: us-east-1)
|
|
8
|
+
# • An environment override setting region to us-west-2 for production
|
|
9
|
+
#
|
|
10
|
+
# This is a reference template showing how to pass Git configs, environment
|
|
11
|
+
# templates, variables, and variable overrides to stackGen:createProject.
|
|
12
|
+
# =============================================================================
|
|
13
|
+
apiVersion: scaffolder.backstage.io/v1beta3
|
|
14
|
+
kind: Template
|
|
15
|
+
metadata:
|
|
16
|
+
name: stackgen-project-advanced
|
|
17
|
+
title: Create Project (Advanced)
|
|
18
|
+
description: Create a project with Git integration, environments, variables, and per-environment overrides
|
|
19
|
+
spec:
|
|
20
|
+
owner: user:guest
|
|
21
|
+
type: service
|
|
22
|
+
parameters:
|
|
23
|
+
- title: Project Information
|
|
24
|
+
required:
|
|
25
|
+
- projectName
|
|
26
|
+
- repoUrl
|
|
27
|
+
properties:
|
|
28
|
+
projectName:
|
|
29
|
+
title: Project Name
|
|
30
|
+
type: string
|
|
31
|
+
description: "Name of the project to create"
|
|
32
|
+
ui:autofocus: true
|
|
33
|
+
repoUrl:
|
|
34
|
+
title: Repository URL
|
|
35
|
+
type: string
|
|
36
|
+
description: "Git repository URL for the project"
|
|
37
|
+
default: "https://github.com/org/repo.git"
|
|
38
|
+
|
|
39
|
+
steps:
|
|
40
|
+
- id: create-project
|
|
41
|
+
name: Create StackGen Project
|
|
42
|
+
action: stackGen:createProject
|
|
43
|
+
input:
|
|
44
|
+
project:
|
|
45
|
+
name: ${{ parameters.projectName }}
|
|
46
|
+
description: "Project created via Backstage with Advanced Config"
|
|
47
|
+
gitConfig:
|
|
48
|
+
name: "default-git-config"
|
|
49
|
+
type: "git"
|
|
50
|
+
parameters:
|
|
51
|
+
scmType: "GITHUB"
|
|
52
|
+
repoUrl: ${{ parameters.repoUrl }}
|
|
53
|
+
targetBranch: "main"
|
|
54
|
+
default: true
|
|
55
|
+
environmentConfig:
|
|
56
|
+
name: "default-env-config"
|
|
57
|
+
environmentTemplates:
|
|
58
|
+
- name: "dev"
|
|
59
|
+
color: "#1cbb9b"
|
|
60
|
+
- name: "production"
|
|
61
|
+
color: "#FF0000"
|
|
62
|
+
# Root-level variable with a default value
|
|
63
|
+
variables:
|
|
64
|
+
- name: "region"
|
|
65
|
+
type: "string"
|
|
66
|
+
defaultValueJson: '"us-east-1"'
|
|
67
|
+
description: "AWS region for deployment"
|
|
68
|
+
# Environment-specific override: production uses us-west-2
|
|
69
|
+
variableOverrides:
|
|
70
|
+
- variableName: "region"
|
|
71
|
+
environmentTemplateName: "production"
|
|
72
|
+
valueJson: '"us-west-2"'
|
|
73
|
+
|
|
74
|
+
output:
|
|
75
|
+
links:
|
|
76
|
+
- title: "View Created Project"
|
|
77
|
+
url: "https://main.dev.stackgen.com/orgs/${{ steps['create-project'].output.projectId }}"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# Create Project (Basic)
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# Creates an empty project (team) in StackGen with just a name. No Git config,
|
|
5
|
+
# environments, or resources — a blank slate for adding AppStacks later.
|
|
6
|
+
# =============================================================================
|
|
7
|
+
apiVersion: scaffolder.backstage.io/v1beta3
|
|
8
|
+
kind: Template
|
|
9
|
+
metadata:
|
|
10
|
+
name: stackgen-project-basic
|
|
11
|
+
title: Create Project (Basic)
|
|
12
|
+
description: Create an empty StackGen project — a blank starting point for adding AppStacks and resources
|
|
13
|
+
spec:
|
|
14
|
+
owner: user:guest
|
|
15
|
+
type: service
|
|
16
|
+
parameters:
|
|
17
|
+
- title: Project Information
|
|
18
|
+
required:
|
|
19
|
+
- projectName
|
|
20
|
+
properties:
|
|
21
|
+
projectName:
|
|
22
|
+
title: Project Name
|
|
23
|
+
type: string
|
|
24
|
+
description: "Name of the project to create"
|
|
25
|
+
ui:autofocus: true
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- id: create-project
|
|
29
|
+
name: Create StackGen Project
|
|
30
|
+
action: stackGen:createProject
|
|
31
|
+
input:
|
|
32
|
+
project:
|
|
33
|
+
name: ${{ parameters.projectName }}
|
|
34
|
+
description: "Project created via Backstage"
|
|
35
|
+
|
|
36
|
+
output:
|
|
37
|
+
links:
|
|
38
|
+
- title: "View Created Project"
|
|
39
|
+
url: "https://main.dev.stackgen.com/orgs/${{ steps['create-project'].output.projectId }}"
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# Create Project with Members
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# Creates a StackGen project and assigns selected users / groups as members.
|
|
5
|
+
# Demonstrates UserGroupSelect + stackGen:assignProjectMembers.
|
|
6
|
+
# =============================================================================
|
|
7
|
+
apiVersion: scaffolder.backstage.io/v1beta3
|
|
8
|
+
kind: Template
|
|
9
|
+
metadata:
|
|
10
|
+
name: stackgen-project-with-members
|
|
11
|
+
title: Create Project with Members
|
|
12
|
+
description: Create a StackGen project and add users or groups as project members
|
|
13
|
+
tags:
|
|
14
|
+
- stackgen
|
|
15
|
+
- project
|
|
16
|
+
spec:
|
|
17
|
+
owner: user:guest
|
|
18
|
+
type: service
|
|
19
|
+
parameters:
|
|
20
|
+
- title: Project
|
|
21
|
+
required:
|
|
22
|
+
- projectName
|
|
23
|
+
properties:
|
|
24
|
+
projectName:
|
|
25
|
+
title: Project Name
|
|
26
|
+
type: string
|
|
27
|
+
description: Name of the StackGen project (team) to create
|
|
28
|
+
ui:autofocus: true
|
|
29
|
+
projectDescription:
|
|
30
|
+
title: Description
|
|
31
|
+
type: string
|
|
32
|
+
default: Project created via Backstage with member assignments
|
|
33
|
+
members:
|
|
34
|
+
title: Project Members
|
|
35
|
+
type: array
|
|
36
|
+
description: Users and/or groups to add to the new project
|
|
37
|
+
ui:field: UserGroupSelect
|
|
38
|
+
items:
|
|
39
|
+
type: object
|
|
40
|
+
required:
|
|
41
|
+
- type
|
|
42
|
+
- id
|
|
43
|
+
properties:
|
|
44
|
+
type:
|
|
45
|
+
type: string
|
|
46
|
+
enum: [user, group]
|
|
47
|
+
id:
|
|
48
|
+
type: string
|
|
49
|
+
label:
|
|
50
|
+
type: string
|
|
51
|
+
roleId:
|
|
52
|
+
title: Project role
|
|
53
|
+
type: string
|
|
54
|
+
description: >
|
|
55
|
+
Role applied to every selected user/group. Pick Admin, DevOps, or
|
|
56
|
+
Developer, or paste a custom role UUID. Leave blank to use the
|
|
57
|
+
action default (developer).
|
|
58
|
+
ui:field: RoleSelect
|
|
59
|
+
default: "00000000-0000-0000-0000-000000000004"
|
|
60
|
+
|
|
61
|
+
steps:
|
|
62
|
+
- id: create-project
|
|
63
|
+
name: Create StackGen Project
|
|
64
|
+
action: stackGen:createProject
|
|
65
|
+
input:
|
|
66
|
+
project:
|
|
67
|
+
name: ${{ parameters.projectName }}
|
|
68
|
+
description: ${{ parameters.projectDescription }}
|
|
69
|
+
|
|
70
|
+
- id: assign-members
|
|
71
|
+
name: Assign Project Members
|
|
72
|
+
action: stackGen:assignProjectMembers
|
|
73
|
+
input:
|
|
74
|
+
projectId: ${{ steps['create-project'].output.teamId }}
|
|
75
|
+
members: ${{ parameters.members }}
|
|
76
|
+
roleId: ${{ parameters.roleId }}
|
|
77
|
+
|
|
78
|
+
output:
|
|
79
|
+
links:
|
|
80
|
+
- title: View Created Project
|
|
81
|
+
url: ${{ steps['create-project'].output.projectURL }}
|
|
82
|
+
text:
|
|
83
|
+
- title: Assigned users
|
|
84
|
+
content: ${{ steps['assign-members'].output.assignedUsersText }}
|
|
85
|
+
- title: Assigned groups
|
|
86
|
+
content: ${{ steps['assign-members'].output.assignedGroupsText }}
|