forked from janus-idp/backstage-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(orchestrator): orchestrator plugin entry page & workflows table (j…
…anus-idp#31) https://issues.redhat.com/browse/FLPATH-686 https://issues.redhat.com/browse/FLPATH-682
- Loading branch information
1 parent
c832db5
commit 1a20bed
Showing
12 changed files
with
852 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
plugins/orchestrator/src/__fixtures__/fakeProcessInstance.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { | ||
ProcessInstance, | ||
ProcessInstanceState, | ||
} from '@janus-idp/backstage-plugin-orchestrator-common'; | ||
|
||
export const fakeProcessInstance: ProcessInstance = { | ||
id: '12f767c1-9002-43af-9515-62a72d0eafb2', | ||
processName: 'Workflow name', | ||
processId: 'workflow_actions', | ||
state: ProcessInstanceState.Error, | ||
start: new Date('2023-11-16T10:50:34.346Z'), | ||
lastUpdate: new Date('2023-11-16T10:50:34.5Z'), | ||
nodes: [], | ||
variables: {}, | ||
end: new Date('2023-11-16T10:50:34.5Z'), | ||
endpoint: '', | ||
}; |
246 changes: 246 additions & 0 deletions
246
plugins/orchestrator/src/__fixtures__/fakeWorkflowItem.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,246 @@ | ||
import { WorkflowItem } from '@janus-idp/backstage-plugin-orchestrator-common'; | ||
|
||
export const fakeWorkflowItem: WorkflowItem = { | ||
uri: 'quarkus-backend-workflow-ci-switch.sw.yaml', | ||
definition: { | ||
id: 'quarkus-backend-workflow-ci-switch', | ||
version: '1.0', | ||
specVersion: '0.8', | ||
name: '[WF] Create a starter Quarkus Backend application with a CI pipeline - CI Switch', | ||
description: | ||
'[WF] Create a starter Quarkus Backend application with a CI pipeline - CI Switch', | ||
functions: [ | ||
{ | ||
name: 'runActionTemplateFetch', | ||
operation: 'specs/actions-openapi.json#fetch:template', | ||
}, | ||
{ | ||
name: 'runActionPublishGithub', | ||
operation: 'specs/actions-openapi.json#publish:github', | ||
}, | ||
{ | ||
name: 'runActionCatalogRegister', | ||
operation: 'specs/actions-openapi.json#catalog:register', | ||
}, | ||
], | ||
start: 'Generating the Source Code Component', | ||
states: [ | ||
{ | ||
name: 'Generating the Source Code Component', | ||
type: 'operation', | ||
actionMode: 'sequential', | ||
actions: [ | ||
{ | ||
name: 'Fetch Template Action - Source Code', | ||
functionRef: { | ||
refName: 'runActionTemplateFetch', | ||
arguments: { | ||
url: 'https://github.com/janus-idp/software-templates/tree/main/templates/github/quarkus-backend/skeleton', | ||
values: { | ||
githubOrg: '.githubOrg', | ||
repoName: '.repoName', | ||
owner: '.owner', | ||
system: '.system', | ||
applicationType: 'api', | ||
description: '.description', | ||
namespace: '.namespace', | ||
imageUrl: 'imageUrl', | ||
imageBuilder: '.imageBuilder', | ||
imageRepository: '.imageRepository', | ||
port: '.port', | ||
ci: '.ci', | ||
groupId: '.groupId', | ||
artifactId: '.artifactId', | ||
javaPackageName: '.javaPackageName', | ||
}, | ||
}, | ||
}, | ||
actionDataFilter: { | ||
toStateData: '.actionFetchTemplateSourceCodeResult', | ||
}, | ||
}, | ||
], | ||
transition: 'Generating the CI Component', | ||
}, | ||
{ | ||
name: 'Generating the CI Component', | ||
type: 'switch', | ||
dataConditions: [ | ||
{ | ||
condition: '${ .ci == "github" }', | ||
transition: 'Generating the CI Component - GitHub', | ||
}, | ||
{ | ||
condition: '${ .ci == "tekton" }', | ||
transition: 'Generating the CI Component - Tekton', | ||
}, | ||
], | ||
defaultCondition: { | ||
transition: 'Generating the CI Component - GitHub', | ||
}, | ||
}, | ||
{ | ||
name: 'Generating the CI Component - GitHub', | ||
type: 'operation', | ||
actionMode: 'sequential', | ||
actions: [ | ||
{ | ||
name: 'Run Template Fetch Action - CI - GitHub', | ||
functionRef: { | ||
refName: 'runActionTemplateFetch', | ||
arguments: { | ||
url: 'https://github.com/janus-idp/software-templates/tree/main/skeletons/github-actions', | ||
copyWithoutTemplating: ['".github/workflows/"'], | ||
values: { | ||
githubOrg: '.githubOrg', | ||
repoName: '.repoName', | ||
owner: '.owner', | ||
system: '.system', | ||
applicationType: 'api', | ||
description: '.description', | ||
namespace: '.namespace', | ||
imageUrl: 'imageUrl', | ||
imageBuilder: '.imageBuilder', | ||
imageRepository: '.imageRepository', | ||
port: '.port', | ||
ci: '.ci', | ||
groupId: '.groupId', | ||
artifactId: '.artifactId', | ||
javaPackageName: '.javaPackageName', | ||
}, | ||
}, | ||
}, | ||
actionDataFilter: { | ||
toStateData: '.actionTemplateFetchCIResult', | ||
}, | ||
}, | ||
], | ||
transition: 'Generating the Catalog Info Component', | ||
}, | ||
{ | ||
name: 'Generating the CI Component - Tekton', | ||
type: 'operation', | ||
actionMode: 'sequential', | ||
actions: [ | ||
{ | ||
name: 'Run Template Fetch Action - CI - Tekton', | ||
functionRef: { | ||
refName: 'runActionTemplateFetch', | ||
arguments: { | ||
url: 'https://github.com/janus-idp/software-templates/tree/main/skeletons/tekton', | ||
copyWithoutTemplating: ['".tekton/workflows/"'], | ||
values: { | ||
githubOrg: '.githubOrg', | ||
repoName: '.repoName', | ||
owner: '.owner', | ||
system: '.system', | ||
applicationType: 'api', | ||
description: '.description', | ||
namespace: '.namespace', | ||
imageUrl: 'imageUrl', | ||
imageBuilder: '.imageBuilder', | ||
imageRepository: '.imageRepository', | ||
port: '.port', | ||
ci: '.ci', | ||
groupId: '.groupId', | ||
artifactId: '.artifactId', | ||
javaPackageName: '.javaPackageName', | ||
}, | ||
}, | ||
}, | ||
actionDataFilter: { | ||
toStateData: '.actionTemplateFetchCIResult', | ||
}, | ||
}, | ||
], | ||
transition: 'Generating the Catalog Info Component', | ||
}, | ||
{ | ||
name: 'Generating the Catalog Info Component', | ||
type: 'operation', | ||
actions: [ | ||
{ | ||
name: 'Fetch Template Action - Catalog Info', | ||
functionRef: { | ||
refName: 'runActionTemplateFetch', | ||
arguments: { | ||
url: 'https://github.com/janus-idp/software-templates/tree/main/skeletons/catalog-info', | ||
values: { | ||
githubOrg: '.githubOrg', | ||
repoName: '.repoName', | ||
owner: '.owner', | ||
system: '.system', | ||
applicationType: 'api', | ||
description: '.description', | ||
namespace: '.namespace', | ||
imageUrl: 'imageUrl', | ||
imageBuilder: '.imageBuilder', | ||
imageRepository: '.imageRepository', | ||
port: '.port', | ||
ci: '.ci', | ||
groupId: '.groupId', | ||
artifactId: '.artifactId', | ||
javaPackageName: '.javaPackageName', | ||
}, | ||
}, | ||
}, | ||
actionDataFilter: { | ||
toStateData: '.actionFetchTemplateCatalogInfoResult', | ||
}, | ||
}, | ||
], | ||
transition: 'Publishing to the Source Code Repository', | ||
}, | ||
{ | ||
name: 'Publishing to the Source Code Repository', | ||
type: 'operation', | ||
actionMode: 'sequential', | ||
actions: [ | ||
{ | ||
name: 'Publish Github Action', | ||
functionRef: { | ||
refName: 'runActionPublishGithub', | ||
arguments: { | ||
allowedHosts: ['"github.com"'], | ||
description: 'Workflow Action', | ||
repoUrl: | ||
'"github.com?owner=" + .githubOrg + "&repo=" + .repoName', | ||
defaultBranch: '.defaultBranch', | ||
gitCommitMessage: '.gitCommitMessage', | ||
allowAutoMerge: true, | ||
allowRebaseMerge: true, | ||
}, | ||
}, | ||
actionDataFilter: { | ||
toStateData: '.actionPublishResult', | ||
}, | ||
}, | ||
], | ||
transition: 'Registering the Catalog Info Component', | ||
}, | ||
{ | ||
name: 'Registering the Catalog Info Component', | ||
type: 'operation', | ||
actionMode: 'sequential', | ||
actions: [ | ||
{ | ||
name: 'Catalog Register Action', | ||
functionRef: { | ||
refName: 'runActionCatalogRegister', | ||
arguments: { | ||
repoContentsUrl: '.actionPublishResult.repoContentsUrl', | ||
catalogInfoPath: '"/catalog-info.yaml"', | ||
}, | ||
}, | ||
actionDataFilter: { | ||
toStateData: '.actionCatalogRegisterResult', | ||
}, | ||
}, | ||
], | ||
end: true, | ||
}, | ||
], | ||
dataInputSchema: | ||
'schemas/quarkus-backend-workflow-ci-switch__main_schema.json', | ||
}, | ||
}; |
Oops, something went wrong.