From c8a6b6a1b48a3cc2d0a40717e38790927a5cf843 Mon Sep 17 00:00:00 2001 From: Kuan Fan Date: Thu, 14 Mar 2024 14:51:18 -0700 Subject: [PATCH] remove tekton --- .tekton/README.md | 7 -- .tekton/build-cthub-pr.yaml | 27 ------- .tekton/build-cthub.yaml | 74 ------------------- .tekton/cat-branch-readme.yaml | 76 ------------------- .tekton/cthub-trigger-tb.yaml | 12 --- .tekton/cthub-trigger-tt.yaml | 41 ----------- .tekton/cthub-trigger.yaml | 12 --- .tekton/deploy-cthub.yaml | 59 --------------- .tekton/deployment/frontend-dc.yaml | 106 --------------------------- .tekton/persistent_volume_claim.yaml | 10 --- .tekton/shared-data.yaml | 10 --- .tekton/tasks/apply-manifests.yaml | 25 ------- .tekton/tasks/fetch-repository.yaml | 37 ---------- 13 files changed, 496 deletions(-) delete mode 100644 .tekton/README.md delete mode 100644 .tekton/build-cthub-pr.yaml delete mode 100644 .tekton/build-cthub.yaml delete mode 100644 .tekton/cat-branch-readme.yaml delete mode 100644 .tekton/cthub-trigger-tb.yaml delete mode 100644 .tekton/cthub-trigger-tt.yaml delete mode 100644 .tekton/cthub-trigger.yaml delete mode 100644 .tekton/deploy-cthub.yaml delete mode 100644 .tekton/deployment/frontend-dc.yaml delete mode 100644 .tekton/persistent_volume_claim.yaml delete mode 100644 .tekton/shared-data.yaml delete mode 100644 .tekton/tasks/apply-manifests.yaml delete mode 100644 .tekton/tasks/fetch-repository.yaml diff --git a/.tekton/README.md b/.tekton/README.md deleted file mode 100644 index feb211f2..00000000 --- a/.tekton/README.md +++ /dev/null @@ -1,7 +0,0 @@ -tkn pipeline start build-cthub \ --w name=shared-data,volumeClaimTemplateFile=./shared-data.yaml \ --p repo-url=https://github.com/bcgov/cthub.git \ --p branch=tekton-0.1.0 \ --p frontend-image=image-registry.openshift-image-registry.svc:5000/30b186-tools/cthub-frontend:frontendtekton \ --p backend-image=image-registry.openshift-image-registry.svc:5000/30b186-tools/cthub-backend:backendtekton \ ---use-param-defaults \ No newline at end of file diff --git a/.tekton/build-cthub-pr.yaml b/.tekton/build-cthub-pr.yaml deleted file mode 100644 index 1711048d..00000000 --- a/.tekton/build-cthub-pr.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: PipelineRun -metadata: - name: build-cthub-pr -spec: - pipelineRef: - name: build-cthub - params: - - name: repo-url - value: 'https://github.com/bcgov/cthub.git' - - name: branch - value: tekton3-0.1.0 - - name: frontend-image - value: >- - image-registry.openshift-image-registry.svc:5000/30b186-tools/cthub-frontend:frontendtekton - - name: backend-image - value: >- - image-registry.openshift-image-registry.svc:5000/30b186-tools/cthub-backend:backendtekton - workspaces: - - name: shared-data - volumeClaimTemplate: - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 500Mi \ No newline at end of file diff --git a/.tekton/build-cthub.yaml b/.tekton/build-cthub.yaml deleted file mode 100644 index b63a7ef7..00000000 --- a/.tekton/build-cthub.yaml +++ /dev/null @@ -1,74 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: build-cthub - namespace: 30b186-tools -spec: - params: - - description: the git repo url - name: repo-url - type: string - - description: the git branch name - name: branch - type: string - - description: where the frontend image push to - name: frontend-image - type: string - - description: where the backend image push to - name: backend-image - type: string - tasks: - - name: git-clone - params: - - name: url - value: $(params.repo-url) - - name: revision - value: $(params.branch) - taskRef: - kind: ClusterTask - name: git-clone - workspaces: - - name: output - workspace: shared-data - - name: show-dir - runAfter: - - git-clone - taskRef: - kind: Task - name: show-dir - workspaces: - - name: source - workspace: shared-data - # - name: build-backend - # params: - # - name: PATH_CONTEXT - # value: /workspace/source/django - # - name: IMAGE - # value: $(params.backend-image) - # runAfter: - # - show-dir - # taskRef: - # kind: ClusterTask - # name: s2i-python - # workspaces: - # - name: source - # workspace: shared-data - # - name: build-frontend - # params: - # - name: PATH_CONTEXT - # value: /workspace/source/react - # - name: IMAGE - # value: $(params.frontend-image) - # runAfter: - # - show-dir - # taskRef: - # kind: ClusterTask - # name: s2i-nodejs - # workspaces: - # - name: source - # workspace: shared-data - workspaces: - - description: | - This workspace will receive the cloned git repo and be passed - to the next Task for the repo's README.md file to be read. - name: shared-data diff --git a/.tekton/cat-branch-readme.yaml b/.tekton/cat-branch-readme.yaml deleted file mode 100644 index acd9b9ba..00000000 --- a/.tekton/cat-branch-readme.yaml +++ /dev/null @@ -1,76 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: cat-branch-readme -spec: - description: | - cat-branch-readme takes a git repository and a branch name and - prints the README.md file from that branch. This is an example - Pipeline demonstrating the following: - - Using the git-clone catalog Task to clone a branch - - Passing a cloned repo to subsequent Tasks using a Workspace. - - Ordering Tasks in a Pipeline using "runAfter" so that - git-clone completes before we try to read from the Workspace. - - Using a volumeClaimTemplate Volume as a Workspace. - - Avoiding hard-coded paths by using a Workspace's path - variable instead. - params: - - name: repo-url - type: string - description: The git repository URL to clone from. - - name: branch-name - type: string - description: The git branch to clone. - workspaces: - - name: shared-data - description: | - This workspace will receive the cloned git repo and be passed - to the next Task for the repo's README.md file to be read. - tasks: - - name: fetch-repo - taskRef: - kind: ClusterTask - name: git-clone - workspaces: - - name: output - workspace: shared-data - params: - - name: url - value: $(params.repo-url) - - name: revision - value: $(params.branch-name) - - name: cat-readme - runAfter: ["fetch-repo"] # Wait until the clone is done before reading the readme. - workspaces: - - name: source - workspace: shared-data - taskSpec: - workspaces: - - name: source - steps: - - image: zshusers/zsh:4.3.15 - script: | - #!/usr/bin/env zsh - cat $(workspaces.source.path)/README.md ---- -apiVersion: tekton.dev/v1beta1 -kind: PipelineRun -metadata: - name: git-clone-checking-out-a-branch -spec: - pipelineRef: - name: cat-branch-readme - workspaces: - - name: shared-data - volumeClaimTemplate: - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - params: - - name: repo-url - value: https://github.com/bcgov/cthub.git - - name: branch-name - value: main \ No newline at end of file diff --git a/.tekton/cthub-trigger-tb.yaml b/.tekton/cthub-trigger-tb.yaml deleted file mode 100644 index 914d1a8a..00000000 --- a/.tekton/cthub-trigger-tb.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: triggers.tekton.dev/v1beta1 -kind: TriggerBinding -metadata: - name: cthub-trigger-tb -spec: - params: - - name: repo-url - value: $(body.repository.url) - - name: branch - value: $(body.head_commit.id) - - name: repo-name - value: $(body.repository.name) diff --git a/.tekton/cthub-trigger-tt.yaml b/.tekton/cthub-trigger-tt.yaml deleted file mode 100644 index 1ef7e5e9..00000000 --- a/.tekton/cthub-trigger-tt.yaml +++ /dev/null @@ -1,41 +0,0 @@ -apiVersion: triggers.tekton.dev/v1alpha1 -kind: TriggerTemplate -metadata: - name: cthub-trigger-tt -spec: - params: - - description: the git repo url - name: repo-url - - description: the git branch name - name: branch - - description: the git repo url - name: repo-name - resourcetemplates: - - apiVersion: tekton.dev/v1beta1 - kind: PipelineRun - metadata: - generateName: build-cthub-$(tt.params.repo-name)- - spec: - serviceAccountName: pipeline - pipelineRef: - name: build-cthub - params: - - name: repo-url - value: $(tt.params.repo-url) - - name: branch - value: $(tt.params.branch) - - name: frontend-image - value: >- - image-registry.openshift-image-registry.svc:5000/30b186-tools/cthub-frontend:frontendtekton - - name: backend-image - value: >- - image-registry.openshift-image-registry.svc:5000/30b186-tools/cthub-backend:backendtekton - workspaces: - - name: shared-data - volumeClaimTemplate: - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 500Mi \ No newline at end of file diff --git a/.tekton/cthub-trigger.yaml b/.tekton/cthub-trigger.yaml deleted file mode 100644 index 914d1a8a..00000000 --- a/.tekton/cthub-trigger.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: triggers.tekton.dev/v1beta1 -kind: TriggerBinding -metadata: - name: cthub-trigger-tb -spec: - params: - - name: repo-url - value: $(body.repository.url) - - name: branch - value: $(body.head_commit.id) - - name: repo-name - value: $(body.repository.name) diff --git a/.tekton/deploy-cthub.yaml b/.tekton/deploy-cthub.yaml deleted file mode 100644 index bdc7e13d..00000000 --- a/.tekton/deploy-cthub.yaml +++ /dev/null @@ -1,59 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: deploy-cthub - namespace: 30b186-tools -spec: - params: - - description: the git repo url, https://github.com/bcgov/cthub.git - name: repo-url - type: string - default: https://github.com/bcgov/cthub.git - - description: the git branch name - name: branch - type: string - default: tekton-0.1.0 - - description: where the frontend image push to - name: frontend-image - type: string - default: 'image-registry.openshift-image-registry.svc:5000/30b186-tools/cthub-frontend:frontendtekton' - - description: where the backend image push to - name: backend-image - type: string - default: 'image-registry.openshift-image-registry.svc:5000/30b186-tools/cthub-backend:backendtekton' - - description: The namespace to be deployed on - name: namespace - type: string - default: 30b186-dev - tasks: - - name: git-clone - params: - - name: url - value: $(params.repo-url) - - name: revision - value: $(params.branch) - taskRef: - kind: ClusterTask - name: git-clone - workspaces: - - name: output - workspace: shared-data - - name: apply-manifests - runAfter: - - git-clone - params: - - name: manifest_dir - value: .tekton/deployment/frontend-dc.yaml - - name: namespace - value: $(params.namespace) - taskRef: - kind: Task - name: apply-manifests - workspaces: - - name: source - workspace: shared-data - workspaces: - - description: | - This workspace will receive the cloned git repo and be passed - to the next Task for the repo's README.md file to be read. - name: shared-data diff --git a/.tekton/deployment/frontend-dc.yaml b/.tekton/deployment/frontend-dc.yaml deleted file mode 100644 index 517b3919..00000000 --- a/.tekton/deployment/frontend-dc.yaml +++ /dev/null @@ -1,106 +0,0 @@ -apiVersion: apps.openshift.io/v1 -kind: DeploymentConfig -metadata: - name: cthub-frontend-tekton - annotations: - description: Defines how to deploy the frontend application - creationTimestamp: null -parameters: - - name: FRONTEND_IMAGE_TAG - required: true -spec: - replicas: 1 - revisionHistoryLimit: 10 - selector: - name: cthub-frontend-tekton - strategy: - activeDeadlineSeconds: 21600 - recreateParams: - timeoutSeconds: 600 - resources: {} - type: Recreate - template: - metadata: - creationTimestamp: null - labels: - name: cthub-frontend-tekton - spec: - containers: - - name: frontend - env: - - name: API_BASE - value: "https://cthub-backend-tekton.apps.silver.devops.gov.bc.ca" - - name: ENABLE_KEYCLOAK - value: "true" - - name: KEYCLOAK_CLIENT_ID - valueFrom: - secretKeyRef: - name: cthub-keycloak - key: KEYCLOAK_CLIENT_ID - - name: KEYCLOAK_REALM - valueFrom: - secretKeyRef: - name: cthub-keycloak - key: KEYCLOAK_REALM - - name: KEYCLOAK_URL - valueFrom: - secretKeyRef: - name: cthub-keycloak - key: KEYCLOAK_URL - image: - imagePullPolicy: IfNotPresent - livenessProbe: - failureThreshold: 10 - initialDelaySeconds: 50 - periodSeconds: 10 - successThreshold: 1 - tcpSocket: - port: 3000 - timeoutSeconds: 3 - ports: - - containerPort: 3000 - protocol: TCP - - containerPort: 5002 - protocol: TCP - readinessProbe: - failureThreshold: 10 - initialDelaySeconds: 40 - periodSeconds: 10 - successThreshold: 1 - tcpSocket: - port: 3000 - timeoutSeconds: 3 - resources: - requests: - cpu: 100m - memory: 300Mi - limits: - cpu: 300m - memory: 400Mi - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - dnsPolicy: ClusterFirst - restartPolicy: Always - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 - test: false - triggers: - - imageChangeParams: - automatic: true - containerNames: - - frontend - from: - kind: ImageStreamTag - namspace: 30b186-tools - name: cthub-frontend:${FRONTEND_IMAGE_TAG} - lastTriggeredImage: - type: ImageChange - - type: ConfigChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 diff --git a/.tekton/persistent_volume_claim.yaml b/.tekton/persistent_volume_claim.yaml deleted file mode 100644 index 88de4df9..00000000 --- a/.tekton/persistent_volume_claim.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: source-pvc -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 500Mi \ No newline at end of file diff --git a/.tekton/shared-data.yaml b/.tekton/shared-data.yaml deleted file mode 100644 index e464c99f..00000000 --- a/.tekton/shared-data.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: shared-data -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi \ No newline at end of file diff --git a/.tekton/tasks/apply-manifests.yaml b/.tekton/tasks/apply-manifests.yaml deleted file mode 100644 index 20390ba8..00000000 --- a/.tekton/tasks/apply-manifests.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Task -metadata: - name: apply-manifests -spec: - workspaces: - - name: source - params: - - name: manifest_dir - description: The directory in source that contains yaml manifests - type: string - default: "k8s" - - name: namespace - description: The namespace - type: string - steps: - - name: apply - image: image-registry.openshift-image-registry.svc:5000/openshift/cli:latest - workingDir: /workspace/source - command: ["/bin/bash", "-c"] - args: - - |- - echo Applying manifests in $(inputs.params.manifest_dir) directory - oc apply -f $(inputs.params.manifest_dir) -n $(inputs.params.namespace) - echo ----------------------------------- \ No newline at end of file diff --git a/.tekton/tasks/fetch-repository.yaml b/.tekton/tasks/fetch-repository.yaml deleted file mode 100644 index 54669257..00000000 --- a/.tekton/tasks/fetch-repository.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Task -metadata: - creationTimestamp: '2021-10-09T23:45:57Z' - name: fetch_repository - namespace: 30b186-tools -spec: - params: - - description: url of the git repo for the code of deployment - name: git-url - type: string - - default: master - description: revision to be used from repo of the code for deployment - name: git-revision - type: string - - description: image to be build from the code - name: IMAGE - type: string - tasks: - - name: fetch-repository - params: - - name: url - value: $(params.git-url) - - name: subdirectory - value: '' - - name: deleteExisting - value: 'true' - - name: revision - value: $(params.git-revision) - - name: sslVerify - value: 'false' - taskRef: - kind: ClusterTask - name: git-clone - workspaces: - - name: output - workspace: shared-workspace \ No newline at end of file