diff --git a/infrastructure.yaml.sample b/infrastructure.yaml.sample index 629f439..79d83ad 100644 --- a/infrastructure.yaml.sample +++ b/infrastructure.yaml.sample @@ -17,6 +17,10 @@ spec: value: my-secret-value - name: openshift-dns-zone value: apps.ocp.tld + - name: github-client-id + value: redacted + - name: github-client-secret + value: redacted project: default syncPolicy: automated: diff --git a/infrastructure/templates/devspaces.yaml b/infrastructure/templates/devspaces.yaml new file mode 100644 index 0000000..3f7f6f9 --- /dev/null +++ b/infrastructure/templates/devspaces.yaml @@ -0,0 +1,78 @@ +apiVersion: project.openshift.io/v1 +kind: Project +metadata: + annotations: + argocd.argoproj.io/sync-wave: "0" + openshift.io/description: "" + openshift.io/display-name: "" + labels: + kubernetes.io/metadata.name: openshift-devspaces + name: openshift-devspaces +spec: + finalizers: + - kubernetes +--- +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + annotations: + argocd.argoproj.io/sync-wave: "10" + labels: + operators.coreos.com/devspaces.openshift-operators: "" + name: devspaces + namespace: openshift-operators +spec: + channel: stable + installPlanApproval: Automatic + name: devspaces + source: redhat-operators + sourceNamespace: openshift-marketplace + startingCSV: devspacesoperator.v3.6.0-0.1685320856.p +--- +apiVersion: org.eclipse.che/v2 +kind: CheCluster +metadata: + annotations: + argocd.argoproj.io/sync-wave: "15" + argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true + name: devspaces + namespace: openshift-devspaces +spec: + components: + cheServer: + debug: false + logLevel: INFO + metrics: + enable: true + containerRegistry: {} + devEnvironments: + startTimeoutSeconds: 300 + secondsOfRunBeforeIdling: -1 + maxNumberOfWorkspacesPerUser: -1 + containerBuildConfiguration: + openShiftSecurityContextConstraint: container-build + defaultNamespace: + autoProvision: true + template: -devspaces + secondsOfInactivityBeforeIdling: 1800 + storage: + pvcStrategy: per-user + gitServices: {} + networking: {} +--- +kind: Secret +apiVersion: v1 +metadata: + name: github-oauth-config + namespace: openshift-devspaces + labels: + app.kubernetes.io/part-of: che.eclipse.org + app.kubernetes.io/component: oauth-scm-configuration + annotations: + argocd.argoproj.io/sync-wave: "20" + che.eclipse.org/oauth-scm-server: github + che.eclipse.org/scm-server-endpoint: https://github.com +type: Opaque +stringData: + id: {{ .Value.github-client-id }} + secret: {{ .Value.github-client-secret }} diff --git a/infrastructure/templates/fruits-dev.yaml b/infrastructure/templates/fruits-dev.yaml index 1d19aa9..4bf5aa2 100644 --- a/infrastructure/templates/fruits-dev.yaml +++ b/infrastructure/templates/fruits-dev.yaml @@ -135,3 +135,88 @@ spec: configMap: name: cosign-hook defaultMode: 0755 +--- +apiVersion: tekton.dev/v1beta1 +kind: Pipeline +metadata: + annotations: + argocd.argoproj.io/sync-wave: "20" + labels: + app.kubernetes.io/instance: fruits + app.kubernetes.io/name: fruits + operator.tekton.dev/operand-name: openshift-pipelines-addons + pipeline.openshift.io/runtime: java + pipeline.openshift.io/runtime-version: openjdk-17-ubi8 + pipeline.openshift.io/type: kubernetes + name: fruits + namespace: fruits-dev +spec: + params: + - default: fruits + name: APP_NAME + type: string + - default: 'https://github.com/MAD-Roadshow-France-2023/devspaces' + name: GIT_REPO + type: string + - default: main + name: GIT_REVISION + type: string + - default: >- + image-registry.openshift-image-registry.svc:5000/fruits-dev/fruits + name: IMAGE_NAME + type: string + - default: . + name: PATH_CONTEXT + type: string + - default: openjdk-17-ubi8 + name: VERSION + type: string + tasks: + - name: fetch-repository + params: + - name: url + value: $(params.GIT_REPO) + - name: revision + value: $(params.GIT_REVISION) + - name: subdirectory + value: '' + - name: deleteExisting + value: 'true' + taskRef: + kind: ClusterTask + name: git-clone + workspaces: + - name: output + workspace: workspace + - name: build + params: + - name: IMAGE + value: $(params.IMAGE_NAME) + - name: TLSVERIFY + value: 'false' + - name: PATH_CONTEXT + value: $(params.PATH_CONTEXT) + - name: VERSION + value: $(params.VERSION) + runAfter: + - fetch-repository + taskRef: + kind: ClusterTask + name: s2i-java + workspaces: + - name: source + workspace: workspace + - name: deploy + params: + - name: SCRIPT + value: oc rollout status deploy/$(params.APP_NAME) + runAfter: + - build + taskRef: + kind: ClusterTask + name: openshift-client + workspaces: + - name: workspace + optional: false + resources: [] + finally: [] \ No newline at end of file