diff --git a/README.md b/README.md index 719fd10..0c96a30 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ resources. Please provide organization-level configuration for these secrets and If you wish to create a new Quay repository, you would need to possess an API token for your Quay organization, and pass it when prompted. After successfully creating a new Quay repository, the user would have to configure a robot user with write permissions to continue the repository for their CI/CD process. + The value of the `OPENSHIFT_TOKEN` secret must provide the permissions to create resources in multiple namesapces, so we provide a simple procedure to bind it to the `cluster-admin` role, but we recommend to configure a new role with only the required privileges instead. @@ -34,7 +35,7 @@ oc get $(oc get secret -o name | grep orchestrator-token) -o yaml | yq '.data.to ``` Finally, put the output of the last command in the `OPENSHIFT_TOKEN` secret. -## Generated artifacts +## Generated artifacts in a GitHub pipeline The execution of the software template produces the following output: * A workflow repository with a sample Serverless Workflow * Including manifests to configure the Tekton trigger and ArgoCD application @@ -45,6 +46,16 @@ The execution of the software template produces the following output: env variables to specify the values) * Registers the workflow and workflow-gitops repositories in Backstage as `Component`s +## Generated artifacts in a GitLab pipeline +The execution of the software template produces the following output: +* A workflow repository with a sample Serverless Workflow + * Including manifests to configure the Tekton trigger and ArgoCD application + * Includes a GL pipeline to deploy the Tekton trigger and ArgoCD application: the action is executed by a GitLab runner to start the deployment by the template +* A config repository with initial configuration of a kustomize project to deploy the application + * Uses properties file to allow setting user-specific configuration for the workflow (assuming that the workflow `application.properties` are using + env variables to specify the values) +* Registers the workflow and workflow-gitops repositories in Backstage as `Component`s + # Associated issues: * [An action to create an ArgoCD repository](https://github.com/RoadieHQ/roadie-backstage-plugins/issues/1298) * [Template review page should not invent the parameter names](https://github.com/backstage/backstage/issues/23794) diff --git a/scaffolder-templates/build/argocd/pipelinerun.template b/scaffolder-templates/build/argocd/pipelinerun.template index 17bb48c..ea788c5 100644 --- a/scaffolder-templates/build/argocd/pipelinerun.template +++ b/scaffolder-templates/build/argocd/pipelinerun.template @@ -21,6 +21,8 @@ spec: value: ${{ values.quayOrgName }} - name: quayRepoName value: ${{ values.quayRepoName }} + - name: gitHost + value: ${{ values.gitHost }} pipelineRef: name: workflow-deployment workspaces: @@ -43,6 +45,12 @@ spec: - name: docker-credentials secret: secretName: docker-credentials +{% if values.gitHost == "github.com" %} - name: ssh-creds secret: - secretName: git-ssh-credentials \ No newline at end of file + secretName: github-ssh-credentials +{% else %} + - name: ssh-creds + secret: + secretName: gitlab-ssh-credentials +{% endif %} \ No newline at end of file diff --git a/scaffolder-templates/advanced-workflow/template.yaml b/scaffolder-templates/github-workflows/advanced-workflow/template.yaml similarity index 94% rename from scaffolder-templates/advanced-workflow/template.yaml rename to scaffolder-templates/github-workflows/advanced-workflow/template.yaml index 749e195..5575e58 100644 --- a/scaffolder-templates/advanced-workflow/template.yaml +++ b/scaffolder-templates/github-workflows/advanced-workflow/template.yaml @@ -247,7 +247,7 @@ spec: action: fetch:template input: # "Relative path is not allowed to refer to a directory outside its parent" - url: ./skeleton + url: ../../skeletons/advanced-workflow-skeleton values: namespace: ${{ parameters.namespace }} argocdNamespace: ${{ parameters.argocdNamespace }} @@ -282,10 +282,28 @@ spec: name: Generating the Build Code for the Workflow action: fetch:template if: ${{ parameters.CI == 'tekton_argocd' }} + input: + url: ../../build + values: + namespace: ${{ parameters.namespace }} + argocdNamespace: ${{ parameters.argocdNamespace }} + orgName: ${{ parameters.orgName }} + workflowId: ${{ parameters.workflowId }} + gitUrl: git@github.com:${{ parameters.orgName }}/${{ parameters.repoName }}.git + gitOpsUrl: git@github.com:${{ parameters.orgName }}/${{ parameters.repoName }}-gitops.git + quayOrgName: ${{ parameters.quayOrgName }} + quayRepoName: ${{ parameters.quayRepoName }} + convertToFlat: false + gitHost: github.com + targetPath: workflow + - id: addCIPipeline + name: Adding the github pipelinerun + action: fetch:template + if: ${{ parameters.CI == 'tekton_argocd' }} input: url: ../build copyWithoutTemplating: - - .github/workflows/update_pipelinerun.yaml + - build/.github/workflows/update_pipelinerun.yaml values: namespace: ${{ parameters.namespace }} argocdNamespace: ${{ parameters.argocdNamespace }} @@ -317,7 +335,7 @@ spec: action: fetch:template if: ${{ parameters.CI == 'tekton_argocd' }} input: - url: ../gitops + url: ../../gitops values: workflowId: ${{ parameters.workflowId }} namespace: ${{ parameters.namespace }} @@ -342,6 +360,7 @@ spec: persistencePSQLDatabaseSchema: ${{ parameters.workflowId }} quayOrgName: ${{ parameters.quayOrgName }} quayRepoName: ${{ parameters.quayRepoName }} + gitHost: github.com targetPath: gitops - id: renameFilesForPersistence if: ${{ parameters.CI == 'tekton_argocd' }} diff --git a/scaffolder-templates/basic-workflow/template.yaml b/scaffolder-templates/github-workflows/basic-workflow/template.yaml similarity index 95% rename from scaffolder-templates/basic-workflow/template.yaml rename to scaffolder-templates/github-workflows/basic-workflow/template.yaml index 0930a80..f03e016 100644 --- a/scaffolder-templates/basic-workflow/template.yaml +++ b/scaffolder-templates/github-workflows/basic-workflow/template.yaml @@ -278,7 +278,7 @@ spec: action: fetch:template input: # "Relative path is not allowed to refer to a directory outside its parent" - url: ./skeleton + url: ../../skeletons/basic-workflow-skeleton values: namespace: ${{ parameters.namespace }} argocdNamespace: ${{ parameters.argocdNamespace }} @@ -318,6 +318,23 @@ spec: name: Generating the Build Code for the Workflow action: fetch:template if: ${{ parameters.CI == 'tekton_argocd' }} + input: + url: ../../build + values: + namespace: ${{ parameters.namespace }} + argocdNamespace: ${{ parameters.argocdNamespace }} + orgName: ${{ parameters.orgName }} + workflowId: ${{ parameters.workflowId }} + gitUrl: git@github.com:${{ parameters.orgName }}/${{ parameters.repoName }}.git + gitOpsUrl: git@github.com:${{ parameters.orgName }}/${{ parameters.repoName }}-gitops.git + quayOrgName: ${{ parameters.quayOrgName }} + quayRepoName: ${{ parameters.quayRepoName }} + convertToFlat: true + targetPath: workflow + - id: addCIPipeline + name: Adding the github pipelinerun + action: fetch:template + if: ${{ parameters.CI == 'tekton_argocd' }} input: url: ../build copyWithoutTemplating: @@ -332,6 +349,7 @@ spec: quayOrgName: ${{ parameters.quayOrgName }} quayRepoName: ${{ parameters.quayRepoName }} convertToFlat: true + gitHost: github.com targetPath: workflow - id: publishWorkflow name: Publishing to the Workflow Repository @@ -353,7 +371,7 @@ spec: action: fetch:template if: ${{ parameters.CI == 'tekton_argocd' }} input: - url: ../gitops + url: ../../gitops values: workflowId: ${{ parameters.workflowId }} namespace: ${{ parameters.namespace }} @@ -378,6 +396,7 @@ spec: persistencePSQLDatabaseSchema: ${{ parameters.workflowId }} quayOrgName: ${{ parameters.quayOrgName }} quayRepoName: ${{ parameters.quayRepoName }} + gitHost: github.com targetPath: gitops - id: renameFilesForPersistence if: ${{ parameters.CI == 'tekton_argocd' }} diff --git a/scaffolder-templates/build/.github/workflows/update_pipelinerun.yaml b/scaffolder-templates/github-workflows/build/.github/workflows/update_pipelinerun.yaml similarity index 100% rename from scaffolder-templates/build/.github/workflows/update_pipelinerun.yaml rename to scaffolder-templates/github-workflows/build/.github/workflows/update_pipelinerun.yaml diff --git a/scaffolder-templates/gitlab-workflows/advanced-workflow/template.yaml b/scaffolder-templates/gitlab-workflows/advanced-workflow/template.yaml new file mode 100644 index 0000000..3946b5c --- /dev/null +++ b/scaffolder-templates/gitlab-workflows/advanced-workflow/template.yaml @@ -0,0 +1,435 @@ +apiVersion: scaffolder.backstage.io/v1beta3 +kind: Template +metadata: + name: gitlab-advanced-workflow-bootstrap + title: Gitlab Advanced workflow bootstrap project + description: Bootstrap project for an advanced assessment serverless workflow using custom java code + tags: + - orchestrator + - built-in + links: + - url: https://openshift-knative.github.io/docs/docs/latest/serverless-logic/about.html + title: About OpenShift Serverless Logic + icon: techdocs + - url: https://kiegroup.github.io/kogito-docs/serverlessworkflow/latest/index.html + title: SonataFlow Guides + icon: techdocs + - url: https://www.parodos.dev/docs/core-concepts/workflow-types/ + title: Workflow Types + icon: techdocs +spec: + owner: janus-orchestrator + type: advanced-workflow-bootstrap + parameters: + - title: Workflow Software Project + description: Configure the github repository where the Maven software project is located + required: + - orgName + - repoName + - workflowId + - description + - infrastructureWorkflowId + - owner + - system + properties: + orgName: + title: Group Name + type: string + ui:autofocus: true + description: Gitlab Group Name + repoName: + title: Project Name + type: string + description: Gitlab Project name + description: + title: Description + type: string + description: Description added to the README file + workflowId: + title: Workflow ID + type: string + pattern: "^([a-zA-Z][a-zA-Z0-9]*)([.]?[a-zA-Z0-9]+)*$" # hypens '-' are not allowed to not mess with java package + description: Unique identifier of the workflow in SonataFlow + infrastructureWorkflowId: + title: Infrastructure Workflow ID + type: string + pattern: "^([a-zA-Z][a-zA-Z0-9]*)([.][a-zA-Z0-9]+)*$" # hypens '-' are not allowed to not mess with java package + description: Workflow ID, the unique identifier of the infrastructure worklow available in the environment + owner: + title: Owner + type: string + ui:field: EntityPicker + ui:options: + catalogFilter: + kind: + - Group + - User + default: user:guest + system: + title: System + type: string + ui:field: EntityPicker + ui:options: + catalogFilter: + kind: + - System + - title: Build Environment + required: + - CI + properties: + CI: + title: Select a CI/CD method + type: string + description: This action will create a CI pipeline for your application based on chosen method + default: tekton_argocd + enum: + - none + - tekton_argocd + enumNames: + - None + - Tekton with ArgoCD + # See: https://github.com/redhat-developer/red-hat-developer-hub-software-templates/blob/3019e781b988e0548eb987eed3e522854ed8c52f/templates/github/quarkus-backend/template.yaml#L101 + dependencies: + CI: + oneOf: + - properties: + CI: + const: none + - properties: + CI: + const: tekton_argocd + namespace: + title: Workflow Namespace + type: string + default: sonataflow-infra + description: Deployment namespace for workflow applications + argocdNamespace: + title: GitOps Namespace + type: string + default: orchestrator-gitops + description: Deployment namespace for ArgoCD and Tekton resources + gitlabHost: + title: Gitlab Instance Name + type: string + default: gitlab.cee.redhat.com + description: The name or host of your gitlab instance + persistencePSQLSecretName: + title: PostgreSQL Secret Name + type: string + default: sonataflow-psql-postgresql + description: Name of the secret in which the PostgreSQL secrets are stored. Shall be in the same namespace as the workflow + persistencePSQLUserKey: + title: PostgreSQL User key from secret + type: string + description: The key name in which the PostgreSQL user is stored + default: postgres-username + persistencePSQLPasswordKey: + title: PostgreSQL Password key from secret + type: string + description: The key name in which the PostgreSQL password is stored + default: postgres-password + persistencePSQLServiceName: + title: PostgreSQL K8s Service Name + type: string + default: sonataflow-psql-postgresql + description: Name of the service running the PostgreSQL instance + persistencePSQLServiceNamespace: + title: PostgreSQL K8s Service Namespace + type: string + default: sonataflow-infra + description: Namespace of the service running the PostgreSQL instance + persistencePSQLServicePort: + title: PostgreSQL Port + type: integer + default: 5432 + description: Port on which the PostgreSQL instance is running + persistencePSQLDatabaseName: + title: PostgreSQL Database Name + type: string + description: Name of the database to use for persistence + default: sonataflow + quayConfig: + title: Quay Configuration + description: Choose between creating a new Quay repository or using an existing one + type: string + default: "Use Existing Repository" + enum: + - "Use Existing Repository" + - "Create New Repository" + ui:widget: radio + dependencies: + quayConfig: + oneOf: + - properties: + quayConfig: + const: "Use Existing Repository" + quayOrgName: + title: Quay Organization Name + type: string + description: The Quay organization name of the published workflow + quayRepoName: + title: Quay Repository Name + type: string + description: The Quay repository name of the published workflow. The repository must exist before deploying the gitops + required: + - quayOrgName + - quayRepoName + - properties: + quayConfig: + const: "Create New Repository" + quayOrgName: + title: Quay Organization Name + type: string + description: The Quay Organization Name of the published workflow + quayRepoName: + title: Quay Repository Name + type: string + description: A name to create a new Quay Repository of the published workflow + token: + title: Quay AuthToken + type: string + description: Quay organization bearer token used for authorization + ui:field: Secret + visibility: + title: Quay Repository Visiblity + type: string + description: Visibility setting for the created repository, either public or private + ui:widget: select + enum: ["public", "private"] + default: public + repoKind: + title: Quay Repository Kind + type: string + description: The created Quay repository kind, either image or application + ui:widget: select + enum: ["image", "application"] + default: image + newRepoDescription: + title: Quay Repository Description + type: string + description: The Quay repository description + baseUrl: + title: Quay Base URL + type: string + description: URL of your Quay instance + default: "https://quay.io" + quayNamespace: + title: Quay Namespace + type: string + description: The Quay namespace of the published workflow + required: + - visibility + - newRepoDescription + - quayNamespace + - token + - quayOrgName + - quayRepoName + required: + - namespace + - argocdNamespace + - persistencePSQLSecretName + - persistencePSQLUserKey + - persistencePSQLPasswordKey + - persistencePSQLServiceName + - persistencePSQLServiceNamespace + - persistencePSQLServicePort + - persistencePSQLDatabaseName + steps: + - id: createQuayRepository + name: Create Quay Repository + action: quay:create-repository + if: ${{ parameters.quayConfig == 'Create New Repository' }} + input: + baseUrl: ${{ parameters.baseUrl }} + token: ${{ parameters.token }} + name: ${{ parameters.quayRepoName }} + visibility: ${{ parameters.visibility }} + description: ${{ parameters.newRepoDescription }} + repoKind: ${{ parameters.repoKind }} + namespace: ${{ parameters.quayNamespace }} + - id: workflowCodeTemplate + name: Generating the Workflow Source Code and Catalog Info Component + action: fetch:template + input: + # "Relative path is not allowed to refer to a directory outside its parent" + url: ../../skeletons/advanced-workflow-skeleton + values: + namespace: ${{ parameters.namespace }} + argocdNamespace: ${{ parameters.argocdNamespace }} + orgName: ${{ parameters.orgName }} + repoName: ${{ parameters.repoName }} + owner: ${{ parameters.owner }} + system: ${{ parameters.system }} + description: ${{ parameters.description }} + groupId: io.janus.workflow + artifactId: ${{ parameters.workflowId }} + version: 1.0.0-SNAPSHOT + workflowId: ${{ parameters.workflowId }} + infrastructureWorkflowId: ${{ parameters.infrastructureWorkflowId }} + sourceControl: github.com + applicationType: workflow-project + lifecycle: development + quayOrgName: ${{ parameters.quayOrgName }} + quayRepoName: ${{ parameters.quayRepoName }} + targetPath: workflow + - id: renameFiles + action: fs:rename + name: Rename files + input: + files: + - from: workflow/src/main/resources/specs/dataindex.yaml + to: workflow/src/main/resources/specs/${{ parameters.workflowId }}-dataindex.yaml + overwrite: true + - from: workflow/src/main/resources/template.sw.yaml + to: workflow/src/main/resources/${{ parameters.workflowId }}.sw.yaml + overwrite: true + - id: buildCodeTemplate + name: Generating the Build Code for the Workflow + action: fetch:template + if: ${{ parameters.CI == 'tekton_argocd' }} + input: + url: ../../build + values: + namespace: ${{ parameters.namespace }} + argocdNamespace: ${{ parameters.argocdNamespace }} + orgName: ${{ parameters.orgName }} + workflowId: ${{ parameters.workflowId }} + gitUrl: git@github.com:${{ parameters.orgName }}/${{ parameters.repoName }}.git + gitOpsUrl: git@github.com:${{ parameters.orgName }}/${{ parameters.repoName }}-gitops.git + quayOrgName: ${{ parameters.quayOrgName }} + quayRepoName: ${{ parameters.quayRepoName }} + gitHost: ${{ parameters.gitlabHost }} + convertToFlat: false + targetPath: workflow + - id: addCIPipeline + name: Adding the gitlab pipeline for the Workflow + action: fetch:template + if: ${{ parameters.CI == 'tekton_argocd' }} + input: + url: ../build/ + copyWithoutTemplating: + - .gitlab-ci.yml + values: + namespace: ${{ parameters.namespace }} + argocdNamespace: ${{ parameters.argocdNamespace }} + orgName: ${{ parameters.orgName }} + workflowId: ${{ parameters.workflowId }} + gitUrl: git@github.com:${{ parameters.orgName }}/${{ parameters.repoName }}.git + gitOpsUrl: git@github.com:${{ parameters.orgName }}/${{ parameters.repoName }}-gitops.git + quayOrgName: ${{ parameters.quayOrgName }} + quayRepoName: ${{ parameters.quayRepoName }} + convertToFlat: false + targetPath: workflow + + - id: publishWorkflow + name: Publishing to the Workflow Repository + action: publish:gitlab + input: + allowedHosts: ["${{ parameters.gitlabHost }}"] + description: ${{ parameters.description }} + repoUrl: ${{ parameters.gitlabHost }}?owner=${{ parameters.orgName }}&repo=${{ parameters.repoName }} + defaultBranch: main + sourcePath: workflow + + - id: createProjectAccessToken + name: Create a Project Access Token to the workflow Repository + action: gitlab:projectAccessToken:create + input: + projectId: ${{ parameters.orgName }}/${{ parameters.repoName }} + repoUrl: ${{ parameters.gitlabHost }}?owner=${{ parameters.orgName }}&repo=${{ parameters.repoName }} + name: PROJECT_ACCESS_TOKEN + scopes: + [api, read_api, create_runner, read_repository, write_repository] + + - id: createAccessTokenVariable + name: Create a Project Variable to hold the Token + action: gitlab:projectVariable:create + input: + repoUrl: ${{ parameters.gitlabHost }}?owner=${{ parameters.orgName }}&repo=${{ parameters.repoName }} + projectId: ${{ parameters.orgName }}/${{ parameters.repoName }} + key: PROJECT_ACCESS_TOKEN + value: ${{ steps.createProjectAccessToken.output.access_token }} + variableType: env_var + raw: false + masked: true + + - id: register + name: Registering the Catalog Info Component + action: catalog:register + input: + repoContentsUrl: ${{ steps.publishWorkflow.output.repoContentsUrl }} + catalogInfoPath: /catalog-info.yaml + + - id: gitopsCodeTemplate + name: Generating the GitOps Component and Catalog Info Component + action: fetch:template + if: ${{ parameters.CI == 'tekton_argocd' }} + input: + url: ../../gitops + values: + workflowId: ${{ parameters.workflowId }} + namespace: ${{ parameters.namespace }} + argocdNamespace: ${{ parameters.argocdNamespace }} + orgName: ${{ parameters.orgName }} + repoName: ${{ parameters.repoName }}-gitops + owner: ${{ parameters.owner }} + system: ${{ parameters.system }} + applicationType: workflow-project + description: ${{ parameters.description }} + sourceControl: github.com + lifecycle: development + gitUrl: git@github.com:${{ parameters.orgName }}/${{ parameters.repoName }}.git + gitOpsUrl: git@github.com:${{ parameters.orgName }}/${{ parameters.repoName }}-gitops.git + persistencePSQLSecretName: ${{ parameters.persistencePSQLSecretName }} + persistencePSQLUserKey: ${{ parameters.persistencePSQLUserKey }} + persistencePSQLPasswordKey: ${{ parameters.persistencePSQLPasswordKey }} + persistencePSQLServiceName: ${{ parameters.persistencePSQLServiceName }} + persistencePSQLServiceNamespace: ${{ parameters.persistencePSQLServiceNamespace }} + persistencePSQLServicePort: ${{ parameters.persistencePSQLServicePort }} + persistencePSQLDatabaseName: ${{ parameters.persistencePSQLDatabaseName }} + persistencePSQLDatabaseSchema: ${{ parameters.workflowId }} + quayOrgName: ${{ parameters.quayOrgName }} + quayRepoName: ${{ parameters.quayRepoName }} + gitHost: ${{ parameters.gitlabHost }} + targetPath: gitops + - id: renameFilesForPersistence + if: ${{ parameters.CI == 'tekton_argocd' }} + action: fs:rename + name: Rename files for persistence + input: + files: + - from: gitops/kustomize/base/sonataflow-patch-persistence.yaml + to: gitops/kustomize/base/sonataflow-patch.yaml + overwrite: true + - id: publishGitOps + if: ${{ parameters.CI == 'tekton_argocd' }} + name: Publishing to the GitOps Code Repository + action: publish:gitlab + input: + allowedHosts: ["${{ parameters.gitlabHost }}"] + description: Configuration repository for ${{ parameters.orgName }}/${{ parameters.repoName }} + repoUrl: ${{ parameters.gitlabHost }}?owner=${{ parameters.orgName }}&repo=${{ parameters.repoName }}-gitops + defaultBranch: main + sourcePath: gitops + - id: registerGitOps + if: ${{ parameters.CI == 'tekton_argocd' }} + name: Registering the GitOps Catalog Info Component + action: catalog:register + input: + repoContentsUrl: ${{ steps.publishGitOps.output.repoContentsUrl }} + catalogInfoPath: /catalog-info.yaml + output: + links: + - title: Bootstrap the GitOps Resources + icon: github + url: ${{ steps.publishWorkflow.output.remoteUrl }}-gitops/tree/main/bootstrap + - title: Open the Source Code Repository + icon: github + url: ${{ steps.publishWorkflow.output.remoteUrl }} + - title: Open the Catalog Info Component + icon: catalog + entityRef: ${{ steps.register.output.entityRef }} + # If quayConfig is not populated, the Quay URL link will not appear. + - title: Quay Repository + icon: dashboard + url: ${{ steps['createQuayRepository'].output.repositoryUrl }} diff --git a/scaffolder-templates/gitlab-workflows/basic-workflow/template.yaml b/scaffolder-templates/gitlab-workflows/basic-workflow/template.yaml new file mode 100644 index 0000000..78f521f --- /dev/null +++ b/scaffolder-templates/gitlab-workflows/basic-workflow/template.yaml @@ -0,0 +1,469 @@ +apiVersion: scaffolder.backstage.io/v1beta3 +kind: Template +metadata: + name: gitlab-basic-workflow-bootstrap + title: Gitlab Basic workflow bootstrap project + description: Bootstrap project for basic serverless workflow with gitlab + tags: + - orchestrator + - built-in + links: + - url: https://openshift-knative.github.io/docs/docs/latest/serverless-logic/about.html + title: About OpenShift Serverless Logic + icon: techdocs + - url: https://kiegroup.github.io/kogito-docs/serverlessworkflow/latest/index.html + title: SonataFlow Guides + icon: techdocs + - url: https://www.parodos.dev/docs/core-concepts/workflow-types/ + title: Workflow Types + icon: techdocs +spec: + owner: janus-orchestrator + type: gitlab-workflow + parameters: + - title: Workflow Software Project + description: Configure the gitlab repository where the Maven software project is located + required: + - orgName + - repoName + - workflowId + - description + - owner + - system + properties: + orgName: + title: Group Name + type: string + ui:autofocus: true + description: Gitlab Group Name + repoName: + title: Project Name + type: string + description: Gitlab Project name + default: onboarding + description: + title: Description + type: string + description: Description added to the README file + default: A workflow for onboarding applications to OCP cluster + workflowId: + title: Workflow ID + type: string + pattern: "^([a-zA-Z][a-zA-Z0-9]*)([.]?[a-zA-Z0-9]+)*$" # hypens '-' are not allowed to not mess with java package + description: Unique identifier of the workflow in SonataFlow + default: onboarding + owner: + title: Owner + type: string + ui:field: EntityPicker + ui:options: + catalogFilter: + kind: + - Group + - User + default: user:guest + system: + title: System + type: string + ui:field: EntityPicker + ui:options: + catalogFilter: + kind: + - System + - title: Workflow Type + description: Select the workflow type. For an assessment, provide an infrastructure workflow option, which should already be set up in your environment + required: + - workflowType + properties: + workflowType: + title: Workflow Type + type: string + description: Annotation to be added to the workflow in SonataFlow to specify its type + ui:widget: radio + enum: + - infrastructure + - assessment + enumNames: + - Infrastructure + - Assessment + default: infrastructure + dependencies: + workflowType: + oneOf: + - properties: + workflowType: + const: infrastructure + - properties: + workflowType: + const: assessment + infrastructureWorkflowId: + title: Infrastructure Workflow ID + type: string + pattern: "^([a-zA-Z][a-zA-Z0-9]*)([.]?[a-zA-Z0-9]+)*$" # hypens '-' are not allowed to not mess with java package + description: Workflow ID, the unique identifier of the infrastructure worklow available in the environment + required: + - infrastructureWorkflowId + - title: Build Environment + required: + - CI + properties: + CI: + title: Select a CI/CD method + type: string + description: This action will create a CI pipeline for your application based on chosen method + default: tekton_argocd + enum: + - none + - tekton_argocd + enumNames: + - None + - Tekton with ArgoCD + # See: https://github.com/redhat-developer/red-hat-developer-hub-software-templates/blob/3019e781b988e0548eb987eed3e522854ed8c52f/templates/github/quarkus-backend/template.yaml#L101 + dependencies: + CI: + oneOf: + - properties: + CI: + const: none + - properties: + CI: + const: tekton_argocd + namespace: + title: Workflow Namespace + type: string + default: sonataflow-infra + description: Deployment namespace for workflow applications + argocdNamespace: + title: GitOps Namespace + type: string + default: orchestrator-gitops + description: Deployment namespace for ArgoCD and Tekton resources + gitlabHost: + title: Gitlab Instance Name + type: string + default: gitlab.cee.redhat.com + description: The name or host of your gitlab instance + persistencePSQLSecretName: + title: PostgreSQL Secret Name + type: string + default: sonataflow-psql-postgresql + description: Name of the secret in which the PostgreSQL secrets are stored. Shall be in the same namespace as the workflow + persistencePSQLUserKey: + title: PostgreSQL User key from secret + type: string + description: The key name in which the PostgreSQL user is stored + default: postgres-username + persistencePSQLPasswordKey: + title: PostgreSQL Password key from secret + type: string + description: The key name in which the PostgreSQL password is stored + default: postgres-password + persistencePSQLServiceName: + title: PostgreSQL K8s Service Name + type: string + default: sonataflow-psql-postgresql + description: Name of the service running the PostgreSQL instance + persistencePSQLServiceNamespace: + title: PostgreSQL K8s Service Namespace + type: string + default: sonataflow-infra + description: Namespace of the service running the PostgreSQL instance + persistencePSQLServicePort: + title: PostgreSQL Port + type: integer + default: 5432 + description: Port on which the PostgreSQL instance is running + persistencePSQLDatabaseName: + title: PostgreSQL Database Name + type: string + description: Name of the database to use for persistence + default: sonataflow + quayConfig: + title: Quay Configuration + description: Choose between creating a new Quay repository or using an existing one + type: string + default: "Use Existing Repository" + enum: + - "Use Existing Repository" + - "Create New Repository" + ui:widget: radio + dependencies: + quayConfig: + oneOf: + - properties: + quayConfig: + const: "Use Existing Repository" + quayOrgName: + title: Quay Organization Name + type: string + description: The Quay organization name of the published workflow + quayRepoName: + title: Quay Repository Name + type: string + description: The Quay repository name of the published workflow. The repository must exist before deploying the gitops + required: + - quayOrgName + - quayRepoName + - properties: + quayConfig: + const: "Create New Repository" + quayOrgName: + title: Quay Organization Name + type: string + description: The Quay Organization Name of the published workflow + quayRepoName: + title: Quay Repository Name + type: string + description: A name to create a new Quay Repository of the published workflow + token: + title: Quay AuthToken + type: string + description: Quay organization bearer token used for authorization + ui:widget: password + visibility: + title: Quay Repository Visiblity + type: string + description: Visibility setting for the created repository, either public or private + ui:widget: select + enum: ["public", "private"] + default: public + repoKind: + title: Quay Repository Kind + type: string + description: The created Quay repository kind, either image or application + ui:widget: select + enum: ["image", "application"] + default: image + newRepoDescription: + title: Quay Repository Description + type: string + description: The Quay repository description + baseUrl: + title: Quay Base URL + type: string + description: URL of your Quay instance + default: "https://quay.io" + quayNamespace: + title: Quay Namespace + type: string + description: The Quay namespace of the published workflow + required: + - visibility + - newRepoDescription + - quayNamespace + - token + - quayOrgName + - quayRepoName + required: + - namespace + - argocdNamespace + - persistencePSQLSecretName + - persistencePSQLUserKey + - persistencePSQLPasswordKey + - persistencePSQLServiceName + - persistencePSQLServiceNamespace + - persistencePSQLServicePort + - persistencePSQLDatabaseName + steps: + - id: createQuayRepository + name: Create Quay Repository + action: quay:create-repository + if: ${{ parameters.quayConfig == 'Create New Repository' }} + input: + baseUrl: ${{ parameters.baseUrl }} + token: ${{ parameters.token }} + name: ${{ parameters.quayRepoName }} + visibility: ${{ parameters.visibility }} + description: ${{ parameters.newRepoDescription }} + repoKind: ${{ parameters.repoKind }} + namespace: ${{ parameters.quayNamespace }} + + - id: workflowCodeTemplate + name: Generating the Workflow Source Code and Catalog Info Component + action: fetch:template + input: + # "Relative path is not allowed to refer to a directory outside its parent" + url: ../../skeletons/basic-workflow-skeleton + values: + namespace: ${{ parameters.namespace }} + argocdNamespace: ${{ parameters.argocdNamespace }} + orgName: ${{ parameters.orgName }} + repoName: ${{ parameters.repoName }} + owner: ${{ parameters.owner }} + system: ${{ parameters.system }} + description: ${{ parameters.description }} + groupId: io.janus.workflow + artifactId: ${{ parameters.workflowId }} + version: 1.0.0-SNAPSHOT + workflowId: ${{ parameters.workflowId }} + workflowType: ${{ parameters.workflowType }} + infrastructureWorkflowId: ${{ parameters.infrastructureWorkflowId }} + sourceControl: gitlab.com + applicationType: workflow-project + lifecycle: development + quayOrgName: ${{ parameters.quayOrgName }} + quayRepoName: ${{ parameters.quayRepoName }} + targetPath: workflow + - id: renameFiles + action: fs:rename + name: Rename files + input: + files: + - from: workflow/src/main/resources/${{ parameters.workflowType }}-template.sw.yaml + to: workflow/src/main/resources/${{ parameters.workflowId }}.sw.yaml + overwrite: false + - id: deleteFiles + action: fs:delete + name: Delete files + input: + files: + - workflow/src/main/resources/assessment-template.sw.yaml + - workflow/src/main/resources/infrastructure-template.sw.yaml + - id: buildCodeTemplate + name: Generating the Build Code for the Workflow + action: fetch:template + if: ${{ parameters.CI == 'tekton_argocd' }} + input: + url: ../../build + values: + namespace: ${{ parameters.namespace }} + argocdNamespace: ${{ parameters.argocdNamespace }} + orgName: ${{ parameters.orgName }} + workflowId: ${{ parameters.workflowId }} + gitUrl: git@${{ parameters.gitlabHost }}:${{ parameters.orgName }}/${{ parameters.repoName }}.git + gitOpsUrl: git@${{ parameters.gitlabHost }}:${{ parameters.orgName }}/${{ parameters.repoName }}-gitops.git + quayOrgName: ${{ parameters.quayOrgName }} + quayRepoName: ${{ parameters.quayRepoName }} + convertToFlat: true + gitHost: ${{ parameters.gitlabHost }} + targetPath: workflow + - id: addCIPipeline + name: Adding the gitlab pipeline the Workflow + action: fetch:template + if: ${{ parameters.CI == 'tekton_argocd' }} + input: + url: ./ + copyWithoutTemplating: + - .gitlab-ci.yml + values: + namespace: ${{ parameters.namespace }} + argocdNamespace: ${{ parameters.argocdNamespace }} + orgName: ${{ parameters.orgName }} + workflowId: ${{ parameters.workflowId }} + gitUrl: git@${{ parameters.gitlabHost }}:${{ parameters.orgName }}/${{ parameters.repoName }}.git + gitOpsUrl: git@${{ parameters.gitlabHost }}:${{ parameters.orgName }}/${{ parameters.repoName }}-gitops.git + quayOrgName: ${{ parameters.quayOrgName }} + quayRepoName: ${{ parameters.quayRepoName }} + convertToFlat: true + targetPath: workflow + - id: publishWorkflow + name: Publishing to the Workflow Repository + action: publish:gitlab + input: + allowedHosts: ["${{ parameters.gitlabHost }}"] + description: ${{ parameters.description }} + repoUrl: ${{ parameters.gitlabHost }}?owner=${{ parameters.orgName }}&repo=${{ parameters.repoName }} + defaultBranch: main + sourcePath: workflow + + - id: createProjectAccessToken + name: Create a Project Access Token to the workflow Repository + action: gitlab:projectAccessToken:create + input: + projectId: ${{ parameters.orgName }}/${{ parameters.repoName }} + repoUrl: ${{ parameters.gitlabHost }}?owner=${{ parameters.orgName }}&repo=${{ parameters.repoName }} + name: PROJECT_ACCESS_TOKEN + scopes: + [api, read_api, create_runner, read_repository, write_repository] + + - id: createAccessTokenVariable + name: Create a Project Variable to hold the Token + action: gitlab:projectVariable:create + input: + repoUrl: ${{ parameters.gitlabHost }}?owner=${{ parameters.orgName }}&repo=${{ parameters.repoName }} + projectId: ${{ parameters.orgName }}/${{ parameters.repoName }} + key: PROJECT_ACCESS_TOKEN + value: ${{ steps.createProjectAccessToken.output.access_token }} + variableType: env_var + raw: false + masked: true + + - id: register + name: Registering the Catalog Info Component + action: catalog:register + input: + repoContentsUrl: ${{ steps.publishWorkflow.output.repoContentsUrl }} + catalogInfoPath: /catalog-info.yaml + - id: gitopsCodeTemplate + name: Generating the GitOps Component and Catalog Info Component + action: fetch:template + if: ${{ parameters.CI == 'tekton_argocd' }} + input: + url: ../../gitops + values: + workflowId: ${{ parameters.workflowId }} + namespace: ${{ parameters.namespace }} + argocdNamespace: ${{ parameters.argocdNamespace }} + orgName: ${{ parameters.orgName }} + repoName: ${{ parameters.repoName }}-gitops + owner: ${{ parameters.owner }} + system: ${{ parameters.system }} + applicationType: workflow-project + description: ${{ parameters.description }} + sourceControl: gitlab.com + lifecycle: development + gitUrl: git@${{ parameters.gitlabHost }}:${{ parameters.orgName }}/${{ parameters.repoName }}.git + gitOpsUrl: git@${{ parameters.gitlabHost }}:${{ parameters.orgName }}/${{ parameters.repoName }}-gitops.git + persistencePSQLSecretName: ${{ parameters.persistencePSQLSecretName }} + persistencePSQLUserKey: ${{ parameters.persistencePSQLUserKey }} + persistencePSQLPasswordKey: ${{ parameters.persistencePSQLPasswordKey }} + persistencePSQLServiceName: ${{ parameters.persistencePSQLServiceName }} + persistencePSQLServiceNamespace: ${{ parameters.persistencePSQLServiceNamespace }} + persistencePSQLServicePort: ${{ parameters.persistencePSQLServicePort }} + persistencePSQLDatabaseName: ${{ parameters.persistencePSQLDatabaseName }} + persistencePSQLDatabaseSchema: ${{ parameters.workflowId }} + quayOrgName: ${{ parameters.quayOrgName }} + quayRepoName: ${{ parameters.quayRepoName }} + gitHost: ${{ parameters.gitlabHost }} + targetPath: gitops + - id: renameFilesForPersistence + if: ${{ parameters.CI == 'tekton_argocd' }} + action: fs:rename + name: Rename files for persistence + input: + files: + - from: gitops/kustomize/base/sonataflow-patch-persistence.yaml + to: gitops/kustomize/base/sonataflow-patch.yaml + overwrite: true + - id: publishGitOps + if: ${{ parameters.CI == 'tekton_argocd' }} + name: Publishing to the GitOps Code Repository + action: publish:gitlab + input: + allowedHosts: ["${{ parameters.gitlabHost }}"] + description: Configuration repository for ${{ parameters.orgName }}/${{ parameters.repoName }} + repoUrl: ${{ parameters.gitlabHost }}?owner=${{ parameters.orgName }}&repo=${{ parameters.repoName }}-gitops + defaultBranch: main + sourcePath: gitops + - id: registerGitOps + if: ${{ parameters.CI == 'tekton_argocd' }} + name: Registering the GitOps Catalog Info Component + action: catalog:register + input: + repoContentsUrl: ${{ steps.publishGitOps.output.repoContentsUrl }} + catalogInfoPath: /catalog-info.yaml + output: + links: + - title: Bootstrap the GitOps Resources + icon: github + url: ${{ steps.publishWorkflow.output.remoteUrl }}-gitops/tree/main/bootstrap + - title: Open the Source Code Repository + icon: github + url: ${{ steps.publishWorkflow.output.remoteUrl }} + - title: Open the Catalog Info Component + icon: catalog + entityRef: ${{ steps.register.output.entityRef }} + # If quayConfig is not populated, the Quay URL link will not appear. + - title: Quay Repository + icon: dashboard + url: ${{ steps['createQuayRepository'].output.repositoryUrl }} diff --git a/scaffolder-templates/gitlab-workflows/build/.gitlab-ci.yml b/scaffolder-templates/gitlab-workflows/build/.gitlab-ci.yml new file mode 100644 index 0000000..38b7bdc --- /dev/null +++ b/scaffolder-templates/gitlab-workflows/build/.gitlab-ci.yml @@ -0,0 +1,33 @@ +stages: + - wait + - update + +wait_for_populated_variable: + # A tag can be set according to your Gitlab runner configuration, for example: + # tags: + # - shared-podman + stage: wait + image: ubuntu:latest + script: | + sleep 5 + +update_pipelinerun: + # tags: + # - shared-podman + stage: update + image: ubuntu:latest + script: | + apt-get update && apt-get install -y git + git config --global http.sslVerify "false" + COMMIT_AUTHOR_EMAIL=$(git log -1 --pretty=format:'%ae') + COMMIT_AUTHOR_NAME=$(git log -1 --pretty=format:'%an') + COMMIT_ID=$(git rev-parse --short HEAD) + git config --global user.email "$COMMIT_AUTHOR_EMAIL" + git config --global user.name "$COMMIT_AUTHOR_NAME" + echo "PROJECT_ACCESS_TOKEN is set to: $PROJECT_ACCESS_TOKEN" + git remote set-url origin https://token:$PROJECT_ACCESS_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH.git + cd argocd + sed "s/__COMMIT_ID__/$COMMIT_ID/g" pipelinerun.template > pipelinerun.yaml + git add pipelinerun.yaml + git commit -m "Updated PipelineRun with commit id $COMMIT_ID" + git push origin HEAD:main -o ci.skip diff --git a/scaffolder-templates/gitops/bootstrap/README.md b/scaffolder-templates/gitops/bootstrap/README.md index 65c0e19..3f421f6 100644 --- a/scaffolder-templates/gitops/bootstrap/README.md +++ b/scaffolder-templates/gitops/bootstrap/README.md @@ -7,11 +7,17 @@ Before applying the manifests, there is a need to replace the `__REPLACE_SSH_PRI Either manually edit the file or login to the target cluster and run the following command: ``` -git clone https://github.com/${{ values.orgName }}/${{ values.repoName }}.git +# You can change the Git host to the one you are using, for example, github.com, gitlab.cee.redhat.com, gitlab.gitlab, etc. + +git clone https://${{ values.gitHost}}/${{ values.orgName }}/${{ values.repoName }}.git cd ${{ values.repoName }}/bootstrap -# Optionally, if edited the file manually -SSH_PRIVATE_KEY=$(oc get secrets -n orchestrator-gitops git-ssh-credentials -o jsonpath='{.data.id_rsa}') +# Optionally, if edited the file manually, run the following commands. +{% if values.gitHost == "github.com" %} +SSH_PRIVATE_KEY=$(oc get secrets -n orchestrator-gitops github-ssh-credentials -o jsonpath='{.data.id_rsa}') +{% else %} +SSH_PRIVATE_KEY=$(oc get secrets -n orchestrator-gitops gitlab-ssh-credentials -o jsonpath='{.data.id_rsa}') +{% endif %} sed -i "s/__REPLACE_SSH_PRIVATE_KEY__/$SSH_PRIVATE_KEY/" ${{values.workflowId}}-argocd-repo.yaml kubectl apply -f . @@ -20,9 +26,9 @@ kubectl apply -f . **Note:** If you're not logged into the repository, you need to provide a personal access token (PAT) as part of the clone URL. ``` -git clone https://@github.com/${{ values.orgName }}/${{ values.repoName }}.git +git clone https://@${{ values.gitHost }}/${{ values.orgName }}/${{ values.repoName }}.git ``` Replace `` with your personal access token. Ensure the token has the necessary permissions to access the repository. -If you encounter issues with the clone, refer to [GitHub's troubleshooting documentation](https://docs.github.com/en/repositories/creating-and-managing-repositories/troubleshooting-cloning-errors) for assistance. +If you encounter issues with the clone, refer to [GitHub's troubleshooting documentation](https://docs.github.com/en/repositories/creating-and-managing-repositories/troubleshooting-cloning-errors), or to the [corresponding gitlab documentation](https://docs.gitlab.com/ee/user/project/repository/) for assistance. diff --git a/scaffolder-templates/gitops/catalog-info.yaml b/scaffolder-templates/gitops/catalog-info.yaml index dcc35f8..5eebb02 100644 --- a/scaffolder-templates/gitops/catalog-info.yaml +++ b/scaffolder-templates/gitops/catalog-info.yaml @@ -9,6 +9,7 @@ metadata: backstage.io/kubernetes-namespace: ${{ values.namespace }} backstage.io/kubernetes-id: ${{ values.workflowId }} github.com/project-slug: ${{ values.orgName }}/${{ values.repoName }} + gitlab.com/project-slug: ${{ values.orgName }}/${{ values.repoName }} spec: type: ${{ values.applicationType }} system: ${{ values.system }} diff --git a/scaffolder-templates/advanced-workflow/skeleton/.mvn/wrapper/.gitignore b/scaffolder-templates/skeletons/advanced-workflow-skeleton/.mvn/wrapper/.gitignore similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/.mvn/wrapper/.gitignore rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/.mvn/wrapper/.gitignore diff --git a/scaffolder-templates/advanced-workflow/skeleton/.mvn/wrapper/MavenWrapperDownloader.java b/scaffolder-templates/skeletons/advanced-workflow-skeleton/.mvn/wrapper/MavenWrapperDownloader.java similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/.mvn/wrapper/MavenWrapperDownloader.java rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/.mvn/wrapper/MavenWrapperDownloader.java diff --git a/scaffolder-templates/advanced-workflow/skeleton/.mvn/wrapper/maven-wrapper.properties b/scaffolder-templates/skeletons/advanced-workflow-skeleton/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/.mvn/wrapper/maven-wrapper.properties rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/.mvn/wrapper/maven-wrapper.properties diff --git a/scaffolder-templates/advanced-workflow/skeleton/LICENSE b/scaffolder-templates/skeletons/advanced-workflow-skeleton/LICENSE similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/LICENSE rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/LICENSE diff --git a/scaffolder-templates/advanced-workflow/skeleton/README.md b/scaffolder-templates/skeletons/advanced-workflow-skeleton/README.md similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/README.md rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/README.md diff --git a/scaffolder-templates/advanced-workflow/skeleton/catalog-info.yaml b/scaffolder-templates/skeletons/advanced-workflow-skeleton/catalog-info.yaml similarity index 89% rename from scaffolder-templates/advanced-workflow/skeleton/catalog-info.yaml rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/catalog-info.yaml index 3a4baa2..542d102 100644 --- a/scaffolder-templates/advanced-workflow/skeleton/catalog-info.yaml +++ b/scaffolder-templates/skeletons/advanced-workflow-skeleton/catalog-info.yaml @@ -9,6 +9,7 @@ metadata: backstage.io/kubernetes-id: ${{ values.workflowId }}-ci janus-idp.io/tekton: ${{ values.workflowId }} github.com/project-slug: ${{ values.orgName }}/${{ values.repoName }} + gitlab.com/project-slug: ${{ values.orgName }}/${{ values.repoName }} spec: type: ${{ values.applicationType }} system: ${{ values.system }} diff --git a/scaffolder-templates/advanced-workflow/skeleton/input.json b/scaffolder-templates/skeletons/advanced-workflow-skeleton/input.json similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/input.json rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/input.json diff --git a/scaffolder-templates/advanced-workflow/skeleton/mvnw b/scaffolder-templates/skeletons/advanced-workflow-skeleton/mvnw similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/mvnw rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/mvnw diff --git a/scaffolder-templates/advanced-workflow/skeleton/mvnw.cmd b/scaffolder-templates/skeletons/advanced-workflow-skeleton/mvnw.cmd similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/mvnw.cmd rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/mvnw.cmd diff --git a/scaffolder-templates/advanced-workflow/skeleton/pom.xml b/scaffolder-templates/skeletons/advanced-workflow-skeleton/pom.xml similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/pom.xml rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/pom.xml diff --git a/scaffolder-templates/advanced-workflow/skeleton/src/main/docker/Dockerfile.jvm b/scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/docker/Dockerfile.jvm similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/src/main/docker/Dockerfile.jvm rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/docker/Dockerfile.jvm diff --git a/scaffolder-templates/advanced-workflow/skeleton/src/main/docker/Dockerfile.legacy-jar b/scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/docker/Dockerfile.legacy-jar similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/src/main/docker/Dockerfile.legacy-jar rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/docker/Dockerfile.legacy-jar diff --git a/scaffolder-templates/advanced-workflow/skeleton/src/main/docker/Dockerfile.native b/scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/docker/Dockerfile.native similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/src/main/docker/Dockerfile.native rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/docker/Dockerfile.native diff --git a/scaffolder-templates/advanced-workflow/skeleton/src/main/docker/Dockerfile.native-micro b/scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/docker/Dockerfile.native-micro similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/src/main/docker/Dockerfile.native-micro rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/docker/Dockerfile.native-micro diff --git a/scaffolder-templates/advanced-workflow/skeleton/src/main/java/${{values.groupId}}/${{values.artifactId}}/SampleAssessment.java b/scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/java/${{values.groupId}}/${{values.artifactId}}/SampleAssessment.java similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/src/main/java/${{values.groupId}}/${{values.artifactId}}/SampleAssessment.java rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/java/${{values.groupId}}/${{values.artifactId}}/SampleAssessment.java diff --git a/scaffolder-templates/advanced-workflow/skeleton/src/main/java/${{values.groupId}}/${{values.artifactId}}/WorkflowOption.java b/scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/java/${{values.groupId}}/${{values.artifactId}}/WorkflowOption.java similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/src/main/java/${{values.groupId}}/${{values.artifactId}}/WorkflowOption.java rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/java/${{values.groupId}}/${{values.artifactId}}/WorkflowOption.java diff --git a/scaffolder-templates/advanced-workflow/skeleton/src/main/java/${{values.groupId}}/${{values.artifactId}}/WorkflowOptions.java b/scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/java/${{values.groupId}}/${{values.artifactId}}/WorkflowOptions.java similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/src/main/java/${{values.groupId}}/${{values.artifactId}}/WorkflowOptions.java rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/java/${{values.groupId}}/${{values.artifactId}}/WorkflowOptions.java diff --git a/scaffolder-templates/advanced-workflow/skeleton/src/main/resources/application-dev.properties b/scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/resources/application-dev.properties similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/src/main/resources/application-dev.properties rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/resources/application-dev.properties diff --git a/scaffolder-templates/advanced-workflow/skeleton/src/main/resources/application.properties b/scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/resources/application.properties similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/src/main/resources/application.properties rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/resources/application.properties diff --git a/scaffolder-templates/advanced-workflow/skeleton/src/main/resources/schemas/${{values.artifactId}}-input-schema.json b/scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/resources/schemas/${{values.artifactId}}-input-schema.json similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/src/main/resources/schemas/${{values.artifactId}}-input-schema.json rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/resources/schemas/${{values.artifactId}}-input-schema.json diff --git a/scaffolder-templates/advanced-workflow/skeleton/src/main/resources/schemas/${{values.artifactId}}-workflow-result-schema.json b/scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/resources/schemas/${{values.artifactId}}-workflow-result-schema.json similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/src/main/resources/schemas/${{values.artifactId}}-workflow-result-schema.json rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/resources/schemas/${{values.artifactId}}-workflow-result-schema.json diff --git a/scaffolder-templates/advanced-workflow/skeleton/src/main/resources/specs/dataindex.yaml b/scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/resources/specs/dataindex.yaml similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/src/main/resources/specs/dataindex.yaml rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/resources/specs/dataindex.yaml diff --git a/scaffolder-templates/advanced-workflow/skeleton/src/main/resources/template.sw.yaml b/scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/resources/template.sw.yaml similarity index 100% rename from scaffolder-templates/advanced-workflow/skeleton/src/main/resources/template.sw.yaml rename to scaffolder-templates/skeletons/advanced-workflow-skeleton/src/main/resources/template.sw.yaml diff --git a/scaffolder-templates/basic-workflow/skeleton/.mvn/wrapper/.gitignore b/scaffolder-templates/skeletons/basic-workflow-skeleton/.mvn/wrapper/.gitignore similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/.mvn/wrapper/.gitignore rename to scaffolder-templates/skeletons/basic-workflow-skeleton/.mvn/wrapper/.gitignore diff --git a/scaffolder-templates/basic-workflow/skeleton/.mvn/wrapper/MavenWrapperDownloader.java b/scaffolder-templates/skeletons/basic-workflow-skeleton/.mvn/wrapper/MavenWrapperDownloader.java similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/.mvn/wrapper/MavenWrapperDownloader.java rename to scaffolder-templates/skeletons/basic-workflow-skeleton/.mvn/wrapper/MavenWrapperDownloader.java diff --git a/scaffolder-templates/basic-workflow/skeleton/.mvn/wrapper/maven-wrapper.properties b/scaffolder-templates/skeletons/basic-workflow-skeleton/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/.mvn/wrapper/maven-wrapper.properties rename to scaffolder-templates/skeletons/basic-workflow-skeleton/.mvn/wrapper/maven-wrapper.properties diff --git a/scaffolder-templates/basic-workflow/skeleton/LICENSE b/scaffolder-templates/skeletons/basic-workflow-skeleton/LICENSE similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/LICENSE rename to scaffolder-templates/skeletons/basic-workflow-skeleton/LICENSE diff --git a/scaffolder-templates/basic-workflow/skeleton/README.md b/scaffolder-templates/skeletons/basic-workflow-skeleton/README.md similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/README.md rename to scaffolder-templates/skeletons/basic-workflow-skeleton/README.md diff --git a/scaffolder-templates/basic-workflow/skeleton/catalog-info.yaml b/scaffolder-templates/skeletons/basic-workflow-skeleton/catalog-info.yaml similarity index 89% rename from scaffolder-templates/basic-workflow/skeleton/catalog-info.yaml rename to scaffolder-templates/skeletons/basic-workflow-skeleton/catalog-info.yaml index 3a4baa2..542d102 100644 --- a/scaffolder-templates/basic-workflow/skeleton/catalog-info.yaml +++ b/scaffolder-templates/skeletons/basic-workflow-skeleton/catalog-info.yaml @@ -9,6 +9,7 @@ metadata: backstage.io/kubernetes-id: ${{ values.workflowId }}-ci janus-idp.io/tekton: ${{ values.workflowId }} github.com/project-slug: ${{ values.orgName }}/${{ values.repoName }} + gitlab.com/project-slug: ${{ values.orgName }}/${{ values.repoName }} spec: type: ${{ values.applicationType }} system: ${{ values.system }} diff --git a/scaffolder-templates/basic-workflow/skeleton/input.json b/scaffolder-templates/skeletons/basic-workflow-skeleton/input.json similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/input.json rename to scaffolder-templates/skeletons/basic-workflow-skeleton/input.json diff --git a/scaffolder-templates/basic-workflow/skeleton/mvnw b/scaffolder-templates/skeletons/basic-workflow-skeleton/mvnw similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/mvnw rename to scaffolder-templates/skeletons/basic-workflow-skeleton/mvnw diff --git a/scaffolder-templates/basic-workflow/skeleton/mvnw.cmd b/scaffolder-templates/skeletons/basic-workflow-skeleton/mvnw.cmd similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/mvnw.cmd rename to scaffolder-templates/skeletons/basic-workflow-skeleton/mvnw.cmd diff --git a/scaffolder-templates/basic-workflow/skeleton/pom.xml b/scaffolder-templates/skeletons/basic-workflow-skeleton/pom.xml similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/pom.xml rename to scaffolder-templates/skeletons/basic-workflow-skeleton/pom.xml diff --git a/scaffolder-templates/basic-workflow/skeleton/src/main/docker/Dockerfile.jvm b/scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/docker/Dockerfile.jvm similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/src/main/docker/Dockerfile.jvm rename to scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/docker/Dockerfile.jvm diff --git a/scaffolder-templates/basic-workflow/skeleton/src/main/docker/Dockerfile.legacy-jar b/scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/docker/Dockerfile.legacy-jar similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/src/main/docker/Dockerfile.legacy-jar rename to scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/docker/Dockerfile.legacy-jar diff --git a/scaffolder-templates/basic-workflow/skeleton/src/main/docker/Dockerfile.native b/scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/docker/Dockerfile.native similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/src/main/docker/Dockerfile.native rename to scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/docker/Dockerfile.native diff --git a/scaffolder-templates/basic-workflow/skeleton/src/main/docker/Dockerfile.native-micro b/scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/docker/Dockerfile.native-micro similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/src/main/docker/Dockerfile.native-micro rename to scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/docker/Dockerfile.native-micro diff --git a/scaffolder-templates/basic-workflow/skeleton/src/main/resources/application-dev.properties b/scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/resources/application-dev.properties similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/src/main/resources/application-dev.properties rename to scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/resources/application-dev.properties diff --git a/scaffolder-templates/basic-workflow/skeleton/src/main/resources/application.properties b/scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/resources/application.properties similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/src/main/resources/application.properties rename to scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/resources/application.properties diff --git a/scaffolder-templates/basic-workflow/skeleton/src/main/resources/assessment-template.sw.yaml b/scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/resources/assessment-template.sw.yaml similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/src/main/resources/assessment-template.sw.yaml rename to scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/resources/assessment-template.sw.yaml diff --git a/scaffolder-templates/basic-workflow/skeleton/src/main/resources/infrastructure-template.sw.yaml b/scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/resources/infrastructure-template.sw.yaml similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/src/main/resources/infrastructure-template.sw.yaml rename to scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/resources/infrastructure-template.sw.yaml diff --git a/scaffolder-templates/basic-workflow/skeleton/src/main/resources/schemas/${{values.artifactId}}-input-schema.json b/scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/resources/schemas/${{values.artifactId}}-input-schema.json similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/src/main/resources/schemas/${{values.artifactId}}-input-schema.json rename to scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/resources/schemas/${{values.artifactId}}-input-schema.json diff --git a/scaffolder-templates/basic-workflow/skeleton/src/main/resources/schemas/${{values.artifactId}}-workflow-result-schema.json b/scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/resources/schemas/${{values.artifactId}}-workflow-result-schema.json similarity index 100% rename from scaffolder-templates/basic-workflow/skeleton/src/main/resources/schemas/${{values.artifactId}}-workflow-result-schema.json rename to scaffolder-templates/skeletons/basic-workflow-skeleton/src/main/resources/schemas/${{values.artifactId}}-workflow-result-schema.json