Skip to content

Commit

Permalink
Merge pull request #90 from ElaiShalevRH/create-quay-repo
Browse files Browse the repository at this point in the history
added create quay repo + name change to advanced
  • Loading branch information
masayag authored Nov 12, 2024
2 parents a007e6c + da1fd1d commit ab03707
Show file tree
Hide file tree
Showing 27 changed files with 222 additions and 50 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ The documentation templates provide recommended structure and integration docume
In case of `Tekton` CI pipeline, the secrets `OPENSHIFT_SERVER` and `OPENSHIFT_TOKEN` are used by the GitHub action that deploys the Tekton
resources. Please provide organization-level configuration for these secrets and ensure that they can be managed by the newly created repositories according to the visibility options (currently set to `public`).

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.

Expand Down
6 changes: 3 additions & 3 deletions documentation-templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ The assessment workflow project generated from the basic-workflow template is a
### basic-workflow as infrastructure
The infrastructure workflow project generated from the basic-workflow template is a simple workflow that prints out the workflow's data input.

## complex-assessment-workflow
This template allows the user to generate a complex assessment workflow project from the user's inputs collected. It includes:
1. **custom java code** to perform complex operations on the user's inputs. In this case, it evaluates the user's input as string by comparing it to the word `default` to print out the default workflow options or an empty workflow options list from the java code.
## advanced-workflow
This template allows the user to generate an advanced assessment workflow project from the user's inputs collected. It includes:
1. **custom java code** to perform advanced operations on the user's inputs. In this case, it evaluates the user's input as string by comparing it to the word `default` to print out the default workflow options or an empty workflow options list from the java code.
2. **pre-check subflow** to validate whether the workflows in the returned assessment workflow options exist in the workflows service. If there are non-existed workflows in the options, then it removes them from the options and outputs the remaining valid ones to the user.
3. **data output schema validation** to ensure that the returned assessment workflow options list aligns with the expected schema to render options correctly in the UI.
4. **README file** with the prerequisites and instructions to run and test the generated assessment workflow.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: complex-assessment-workflow-bootstrap
title: Complex assessment workflow bootstrap project
description: Bootstrap project for complex assessment serverless workflow using custom java code
name: advanced-workflow-bootstrap
title: Advanced workflow bootstrap project
description: Bootstrap project for an advanced assessment serverless workflow using custom java code
tags:
- orchestrator
- built-in
Expand All @@ -19,14 +19,15 @@ metadata:
icon: techdocs
spec:
owner: janus-orchestrator
type: complex-assessment-workflow-bootstrap
type: advanced-workflow-bootstrap
parameters:
- title: Provide information about the workflow software project
- title: Workflow Software Project
description: Configure the github repository where the Maven software project is located
required:
- orgName
- repoName
- workflowId
- description
- infrastructureWorkflowId
- owner
- system
Expand Down Expand Up @@ -72,7 +73,7 @@ spec:
catalogFilter:
kind:
- System
- title: Provide information about the Build environment
- title: Build Environment
required:
- CI
properties:
Expand Down Expand Up @@ -107,54 +108,120 @@ spec:
type: string
default: orchestrator-gitops
description: Deployment namespace for ArgoCD and Tekton resources
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.
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.
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.
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.
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.
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.
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.
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.
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
- quayOrgName
- quayRepoName
- persistencePSQLSecretName
- persistencePSQLUserKey
- persistencePSQLPasswordKey
Expand All @@ -163,6 +230,18 @@ spec:
- 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
Expand Down Expand Up @@ -292,11 +371,16 @@ spec:
catalogInfoPath: /catalog-info.yaml
output:
links:
- if: ${{ parameters.CI == 'tekton_argocd' }}
title: Bootstrap the GitOps Resources
- title: Bootstrap the GitOps Resources
icon: github
url: https://github.com/${{ parameters.orgName }}/${{ parameters.repoName }}-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 }}
Loading

0 comments on commit ab03707

Please sign in to comment.