diff --git a/Makefile b/Makefile index 89d82ecba..06b16c841 100644 --- a/Makefile +++ b/Makefile @@ -25,21 +25,21 @@ check-pipeline-resources: ## wait for all seed resources to be present scripts/check-pipeline-resources.sh .PHONY: seed -seed: check-pipeline-resources ## run the seed pipipeline (test and prod, no pr) +seed: check-pipeline-resources ## run the seed pipeline (build all component, push to all env, no pr) oc create -f charts/datacenter/pipelines/extra/seed-run.yaml .PHONY: build-and-test-iot-anomaly-detection -build-and-test-iot-anomaly-detection: ## run a build and test pipeline iot anomaly detection - oc create -f charts/datacenter/pipelines/extra/build-and-test-run-iot-anomaly-detection.yaml +build-and-test-iot-anomaly-detection: ## run iot anomaly detection pipeline (build, test, push to manuela-tst-all, pr for prod) + oc create -f charts/datacenter/pipelines/extra/build-and-test-iot-anomaly-detection.yaml .PHONY: build-and-test-iot-consumer -build-and-test-iot-consumer: ## run a build and test pipeline iot consumer - oc create -f charts/datacenter/pipelines/extra/build-and-test-run-iot-consumer.yaml +build-and-test-iot-consumer: ## run iot consumer pipeline (build, test, push to manuela-tst-all, pr for prod) + oc create -f charts/datacenter/pipelines/extra/build-and-test-iot-consumer.yaml .PHONY: build-and-test-iot-frontend -build-and-test-iot-frontend: ## run a build and test pipeline iot frontend +build-and-test-iot-frontend: ## run iot frontend pipeline (build, test, push to manuela-tst-all, pr for prod) oc create -f charts/datacenter/pipelines/extra/build-and-test-iot-frontend.yaml .PHONY: build-and-test-iot-software-sensor -build-and-test-iot-software-sensor: ## run a build and test pipeline iot software-sensor +build-and-test-iot-software-sensor: ## run iot software-sensor pipeline (build, test, push to manuela-tst-all, pr for prod) oc create -f charts/datacenter/pipelines/extra/build-and-test-iot-software-sensor.yaml diff --git a/charts/datacenter/pipelines/extra/build-and-test-run-iot-anomaly-detection.yaml b/charts/datacenter/pipelines/extra/build-and-test-iot-anomaly-detection.yaml similarity index 90% rename from charts/datacenter/pipelines/extra/build-and-test-run-iot-anomaly-detection.yaml rename to charts/datacenter/pipelines/extra/build-and-test-iot-anomaly-detection.yaml index 4bc8a9bed..98755749e 100644 --- a/charts/datacenter/pipelines/extra/build-and-test-run-iot-anomaly-detection.yaml +++ b/charts/datacenter/pipelines/extra/build-and-test-iot-anomaly-detection.yaml @@ -24,3 +24,6 @@ spec: - name: build-artifacts persistentVolumeClaim: claimName: build-artifacts-rwo + - name: github-secret + secret: + secretName: gitea-admin-secret diff --git a/charts/datacenter/pipelines/extra/build-and-test-run-iot-consumer.yaml b/charts/datacenter/pipelines/extra/build-and-test-iot-consumer.yaml similarity index 89% rename from charts/datacenter/pipelines/extra/build-and-test-run-iot-consumer.yaml rename to charts/datacenter/pipelines/extra/build-and-test-iot-consumer.yaml index 9182dacf4..e2ea6b8ce 100644 --- a/charts/datacenter/pipelines/extra/build-and-test-run-iot-consumer.yaml +++ b/charts/datacenter/pipelines/extra/build-and-test-iot-consumer.yaml @@ -24,3 +24,6 @@ spec: - name: build-artifacts persistentVolumeClaim: claimName: build-artifacts-rwo + - name: github-secret + secret: + secretName: gitea-admin-secret diff --git a/charts/datacenter/pipelines/extra/build-and-test-iot-frontend.yaml b/charts/datacenter/pipelines/extra/build-and-test-iot-frontend.yaml index 507c22880..18fddc828 100644 --- a/charts/datacenter/pipelines/extra/build-and-test-iot-frontend.yaml +++ b/charts/datacenter/pipelines/extra/build-and-test-iot-frontend.yaml @@ -24,3 +24,6 @@ spec: - name: build-artifacts persistentVolumeClaim: claimName: build-artifacts-rwo + - name: github-secret + secret: + secretName: gitea-admin-secret diff --git a/charts/datacenter/pipelines/extra/build-and-test-iot-software-sensor.yaml b/charts/datacenter/pipelines/extra/build-and-test-iot-software-sensor.yaml index 77d6c6e0b..94fdc7f43 100644 --- a/charts/datacenter/pipelines/extra/build-and-test-iot-software-sensor.yaml +++ b/charts/datacenter/pipelines/extra/build-and-test-iot-software-sensor.yaml @@ -24,3 +24,6 @@ spec: - name: build-artifacts persistentVolumeClaim: claimName: build-artifacts-rwo + - name: github-secret + secret: + secretName: gitea-admin-secret diff --git a/charts/datacenter/pipelines/templates/_helpers.tpl b/charts/datacenter/pipelines/templates/_helpers.tpl new file mode 100644 index 000000000..24a871946 --- /dev/null +++ b/charts/datacenter/pipelines/templates/_helpers.tpl @@ -0,0 +1,293 @@ +{{- define "build-base-images" -}} +- name: buildah-build + taskRef: + name: buildah + runAfter: + - git-clone-ops + - git-clone-dev + workspaces: + - name: gitrepos + workspace: gitrepos + - name: config + workspace: config + params: + - name: TLSVERIFY + value: "false" + - name: PATH_CONTEXT + value: tekton/images/httpd-ionic + - name: TAG + value: latest + - name: OUTPUT_IMAGE_PROVIDER_CONFIGMAPKEY + value: IMAGE_PROVIDER + - name: OUTPUT_IMAGE_ACCOUNT_CONFIGMAPKEY + value: IMAGE_ACCOUNT + - name: OUTPUT_IMAGE_NAME + value: httpd-ionic +{{- end }} {{/* build-base-images */}} + +{{- define "build-iot-component" }} +- name: bump-build-version-{{ .component.component_name }} + displayName: "Bump version for {{ .component.component_name }}" + taskRef: + name: bumpversion + runAfter: + - git-clone-ops + - git-clone-dev + workspaces: + - name: gitrepos + workspace: gitrepos + params: + - name: component_name + value: {{ .component.component_name }} + - name: version_file_path + value: components/{{ .component.component_name }}/VERSION + +- name: s2i-build-{{ .component.component_name }} + displayName: "S2I build IoT {{ .component.component_name }}" + taskRef: + name: s2i + runAfter: + - bump-build-version-{{ .component.component_name }} + workspaces: + - name: gitrepos + workspace: gitrepos + - name: build-artifacts + workspace: build-artifacts + params: + - name: TLSVERIFY + value: "false" + - name: PATH_CONTEXT + value: components/{{ .component.component_name }} + - name: BUILDER_IMAGE + value: {{ .component.builder_image }} + {{- if .component.chained_build_dockerfile }} + - name: CHAINED_BUILD_DOCKERFILE + value: {{ .component.chained_build_dockerfile }} + {{- end }} + - name: TAG + value: $(tasks.bump-build-version-{{ .component.component_name }}.results.image-tag) + - name: OUTPUT_IMAGE + value: image-registry.openshift-image-registry.svc:5000/manuela-tst-all/{{ .component.output_image_name }} + +- name: copy-image-to-remote-registry-{{ .component.component_name }} + displayName: "Copy image to remote registry" + taskRef: + name: skopeo-copy + runAfter: + - s2i-build-{{ .component.component_name }} + workspaces: + - name: config + workspace: config + params: + - name: TAG + value: $(tasks.bump-build-version-{{ .component.component_name }}.results.image-tag) + - name: SOURCE_IMAGE + value: image-registry.openshift-image-registry.svc:5000/manuela-tst-all/{{ .component.output_image_name }} + - name: TARGET_IMAGE_CONFIGMAPKEY + value: {{ .component.configmap_prefix }}_IMAGE + +- name: push-dev-tag-{{ .component.component_name }} + taskRef: + name: github-push + runAfter: + - copy-image-to-remote-registry-{{ .component.component_name }} + workspaces: + - name: gitrepos + workspace: gitrepos + params: + - name: PUSH_FLAGS + value: --tags + +- name: modify-ops-test-iot-component-{{ .component.component_name }} + taskRef: + name: gitops-imagetag + runAfter: + - push-dev-tag-{{ .component.component_name }} + workspaces: + - name: gitrepos + workspace: gitrepos + - name: config + workspace: config + params: + - name: CONFIGMAP_PREFIX + value: {{ .component.configmap_prefix }} + - name: ENVIRONMENT + value: TEST + - name: TAG + value: $(tasks.bump-build-version-{{ .component.component_name }}.results.image-tag) + - name: subdirectory + value: ops + +- name: modify-ops-prod-iot-component-{{ .component.component_name }} + when: + - input: "{{ .seed_prod }}" + operator: in + values: ["true"] + taskRef: + name: gitops-imagetag + runAfter: + - modify-ops-test-iot-component-{{ .component.component_name }} + workspaces: + - name: gitrepos + workspace: gitrepos + - name: config + workspace: config + params: + - name: CONFIGMAP_PREFIX + value: {{ .component.configmap_prefix }} + - name: ENVIRONMENT + value: PROD + - name: TAG + value: $(tasks.bump-build-version-{{ .component.component_name }}.results.image-tag) + - name: subdirectory + value: ops + +- name: commit-ops-{{ .component.component_name }} + taskRef: + name: git-commit + runAfter: + - modify-ops-prod-iot-component-{{ .component.component_name }} + workspaces: + - name: gitrepos + workspace: gitrepos + - name: config + workspace: config + params: + - name: subdirectory + value: ops + +- name: push-ops-{{ .component.component_name }} + taskRef: + name: github-push + runAfter: + - commit-ops-{{ .component.component_name }} + workspaces: + - name: gitrepos + workspace: gitrepos + params: + - name: subdirectory + value: ops + - name: PUSH_FLAGS + value: --all +{{- end }} {{/* build-iot-component */}} + +{{- define "test-all" }} +- name: sensor-broker-test + taskRef: + name: mock + kind: Task + runAfter: + - argocd-sync-application + params: + - name: MESSAGE + value: "succesfully sent messages to broker..." +- name: consumer-broker-test + taskRef: + name: mock + kind: Task + runAfter: + - argocd-sync-application + params: + - name: MESSAGE + value: "succesfully processed messages from broker..." +- name: consumer-frontend-test + taskRef: + name: mock + kind: Task + runAfter: + - argocd-sync-application + params: + - name: MESSAGE + value: "succesfully executed Websocket APIs..." +- name: e2e-test + taskRef: + name: mock + kind: Task + runAfter: + - sensor-broker-test + - consumer-broker-test + - consumer-frontend-test + params: + - name: MESSAGE + value: "e2e testsuite succesfully executed" +{{- end }} + +{{- define "trigger-staging" }} +- name: checkout-staging-branch + taskRef: + name: git-checkout + runAfter: + - e2e-test + workspaces: + - name: gitrepos + workspace: gitrepos + params: + - name: subdirectory + value: ops + - name: BRANCH + value: staging-approval + - name: STARTINGBRANCH + value: {{ .root.global.targetRevision }} +- name: modify-ops-prod + taskRef: + name: gitops-imagetag + runAfter: + - checkout-staging-branch + workspaces: + - name: gitrepos + workspace: gitrepos + - name: config + workspace: config + params: + - name: CONFIGMAP_PREFIX + value: {{ .component.configmap_prefix }} + - name: ENVIRONMENT + value: PROD + - name: TAG + value: $(tasks.bump-build-version-{{ .component.component_name }}.results.image-tag) + - name: subdirectory + value: ops +- name: commit-ops-prod + taskRef: + name: git-commit + runAfter: + - modify-ops-prod + workspaces: + - name: gitrepos + workspace: gitrepos + - name: config + workspace: config + params: + - name: subdirectory + value: ops +- name: push-ops-prod + taskRef: + name: github-push + runAfter: + - commit-ops-prod + workspaces: + - name: gitrepos + workspace: gitrepos + params: + - name: subdirectory + value: ops + - name: PUSH_FLAGS + value: --set-upstream origin staging-approval -f +- name: github-pull-request + taskRef: + name: github-add-pull-request + runAfter: + - push-ops-prod + workspaces: + - name: config + workspace: config + - name: github-secret + workspace: github-secret + params: + - name: GITHUB_REPO_CONFIGMAPKEY + value: GIT_OPS_REPO_PROD_URL + - name: GIT_BRANCH_HEAD + value: staging-approval + - name: GIT_BRANCH_BASE + value: {{ .root.global.targetRevision }} +{{- end }} \ No newline at end of file diff --git a/charts/datacenter/pipelines/templates/pipelines/build-and-test-iot-anomaly-detection.yaml b/charts/datacenter/pipelines/templates/pipelines/build-and-test-iot-anomaly-detection.yaml deleted file mode 100644 index 851a5de41..000000000 --- a/charts/datacenter/pipelines/templates/pipelines/build-and-test-iot-anomaly-detection.yaml +++ /dev/null @@ -1,242 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: build-and-test-iot-anomaly-detection -spec: - workspaces: - - name: gitrepos - - name: config - - name: build-artifacts - - name: argocd-env-secret - params: - - name: DEV_REVISION - type: string - default: {{ .Values.global.git.dev_revision }} - - name: OPS_REVISION - type: string - default: {{ .Values.global.targetRevision }} - - tasks: - - name: git-clone-dev - taskRef: - name: git-clone-with-tags - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: url_configmapkey - value: GIT_DEV_REPO_URL - - name: revision - value: {{ .Values.global.git.dev_revision }} - - name: subdirectory - value: dev - - name: deleteExisting - value: "true" - - - name: git-clone-ops - taskRef: - name: git-clone-with-tags - runAfter: - - git-clone-dev - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: url_configmapkey - value: GIT_OPS_REPO_TEST_URL - - name: revision - value: {{ .Values.global.targetRevision }} - - name: subdirectory - value: ops - - name: deleteExisting - value: "true" - - - name: bump-build-version-iot-anomaly - taskRef: - name: bumpversion - runAfter: - - git-clone-ops - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: component_name - value: iot-anomaly - - name: version_file_path - value: components/iot-anomaly-detection/VERSION - - - name: s2i-build-iot-anomaly - taskRef: - name: s2i - runAfter: - - bump-build-version-iot-anomaly - workspaces: - - name: gitrepos - workspace: gitrepos - - name: build-artifacts - workspace: build-artifacts - params: - - name: TLSVERIFY - value: "false" - - name: PATH_CONTEXT - value: components/iot-anomaly-detection - - name: BUILDER_IMAGE - value: quay.io/hybridcloudpatterns/python-38-rhel7 - - name: TAG - value: $(tasks.bump-build-version-iot-anomaly.results.image-tag) - - name: OUTPUT_IMAGE - value: image-registry.openshift-image-registry.svc:5000/manuela-tst-all/anomaly-detection - - - name: copy-image-to-remote-registry-iot-anomaly - taskRef: - name: skopeo-copy - runAfter: - - s2i-build-iot-anomaly - workspaces: - - name: config - workspace: config - params: - - name: TAG - value: $(tasks.bump-build-version-iot-anomaly.results.image-tag) - - name: SOURCE_IMAGE - value: image-registry.openshift-image-registry.svc:5000/manuela-tst-all/anomaly-detection - - name: TARGET_IMAGE_CONFIGMAPKEY - value: IOT_ANOMALY_IMAGE - - - name: push-dev-tag - taskRef: - name: github-push - runAfter: - - copy-image-to-remote-registry-iot-anomaly - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: PUSH_FLAGS - value: --tags - - - name: modify-ops-test-iot-anomaly - taskRef: - name: gitops-imagetag - runAfter: - - push-dev-tag - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: CONFIGMAP_PREFIX - value: IOT_ANOMALY - - name: ENVIRONMENT - value: TEST - - name: TAG - value: $(tasks.bump-build-version-iot-anomaly.results.image-tag) - - name: subdirectory - value: ops - - - name: commit-ops - taskRef: - name: git-commit - runAfter: - - modify-ops-test-iot-anomaly - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: subdirectory - value: ops - - - name: push-ops - taskRef: - name: github-push - runAfter: - - commit-ops - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: subdirectory - value: ops - - name: PUSH_FLAGS - value: --all - - - name: argocd-sync-application - taskRef: - name: argocd-sync-and-wait - runAfter: - - push-ops - workspaces: - - name: argocd-env-secret - workspace: argocd-env-secret - params: - - name: application-name - value: manuela-test - - name: flags - value: --insecure - - name: revision - value: $(params.OPS_REVISION) - - name: argocd-server - value: "{{ .Values.clusterGroup.name }}-gitops-server.{{ .Values.global.pattern }}-{{ .Values.clusterGroup.name }}.svc" - - - name: test-all - taskRef: - name: tkn - runAfter: - - argocd-sync-application - params: - - name: ARGS - value: - - pipeline - - start - - test-all - - --showlog - - --nocolour - - - name: trigger-staging - taskRef: - name: tkn - runAfter: - - test-all - params: - - name: ARGS - value: - - pipeline - - start - - stage-production - - --showlog - - --nocolour - - --param - - TAG=$(tasks.bump-build-version-iot-anomaly.results.image-tag) - - --param - - CONFIGMAP_PREFIX=IOT_ANOMALY - - --param - - SOURCE_IMAGE=image-registry.openshift-image-registry.svc:5000/manuela-tst-all/anomaly-detection - - --workspace - - name=gitrepos,claimName=gitrepos-rwo - - --workspace - - name=config,config=environment - - --workspace - - name=github-secret,secret=gitea-admin-secret - - - name: cleanup - taskRef: - name: cleanup - runAfter: - - trigger-staging - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: subdirectory - value: dev - - name: COMPONENT_NAME - value: iot-anomaly-detection diff --git a/charts/datacenter/pipelines/templates/pipelines/build-and-test-iot-component.yaml b/charts/datacenter/pipelines/templates/pipelines/build-and-test-iot-component.yaml new file mode 100644 index 000000000..21a8d9180 --- /dev/null +++ b/charts/datacenter/pipelines/templates/pipelines/build-and-test-iot-component.yaml @@ -0,0 +1,93 @@ +{{- range .Values.pipeline_components }} +--- + {{/*- include "build-iot-component" (dict "root" $.Values "component" . "seed_prod" "true") | nindent 4 */}} + {{/*- include "test_include" (dict "root" $.Values "component" . "seed_prod" "true") | nindent 4 */}} + +apiVersion: tekton.dev/v1beta1 +kind: Pipeline +metadata: + name: build-and-test-{{ .component_name }} +spec: + workspaces: + - name: gitrepos + - name: config + - name: build-artifacts + - name: argocd-env-secret + - name: github-secret + tasks: + - name: git-clone-dev + taskRef: + name: git-clone-with-tags + workspaces: + - name: gitrepos + workspace: gitrepos + - name: config + workspace: config + params: + - name: url_configmapkey + value: GIT_DEV_REPO_URL + - name: revision + value: {{ $.Values.global.git.dev_revision }} + - name: subdirectory + value: dev + - name: deleteExisting + value: "true" + + - name: git-clone-ops + taskRef: + name: git-clone-with-tags + workspaces: + - name: gitrepos + workspace: gitrepos + - name: config + workspace: config + params: + - name: url_configmapkey + value: GIT_OPS_REPO_TEST_URL + - name: revision + value: {{ $.Values.global.targetRevision }} + - name: subdirectory + value: ops + - name: deleteExisting + value: "true" + +{{- include "build-iot-component" (dict "root" $.Values "component" . "seed_prod" "false") | nindent 2 }} + + - name: argocd-sync-application + taskRef: + name: argocd-sync-and-wait + runAfter: + - push-ops-{{ .component_name }} + workspaces: + - name: argocd-env-secret + workspace: argocd-env-secret + params: + - name: application-name + value: manuela-test + - name: flags + value: --insecure + - name: revision + value: {{ $.Values.global.targetRevision }} + - name: argocd-server + value: "{{ $.Values.clusterGroup.name }}-gitops-server.{{ $.Values.global.pattern }}-{{ $.Values.clusterGroup.name }}.svc" + +{{- include "test-all" . | nindent 2 }} + +{{- include "trigger-staging" (dict "root" $.Values "component" . ) | nindent 2 }} + + - name: cleanup + taskRef: + name: cleanup + runAfter: + - github-pull-request + workspaces: + - name: gitrepos + workspace: gitrepos + - name: config + workspace: config + params: + - name: subdirectory + value: dev + - name: COMPONENT_NAME + value: {{ .component_name }} +{{- end }} diff --git a/charts/datacenter/pipelines/templates/pipelines/build-and-test-iot-consumer.yaml b/charts/datacenter/pipelines/templates/pipelines/build-and-test-iot-consumer.yaml deleted file mode 100644 index 99a290082..000000000 --- a/charts/datacenter/pipelines/templates/pipelines/build-and-test-iot-consumer.yaml +++ /dev/null @@ -1,242 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: build-and-test-iot-consumer -spec: - workspaces: - - name: gitrepos - - name: config - - name: build-artifacts - - name: argocd-env-secret - params: - - name: DEV_REVISION - type: string - default: {{ .Values.global.git.dev_revision }} - - name: OPS_REVISION - type: string - default: {{ .Values.global.targetRevision }} - - tasks: - - name: git-clone-dev - taskRef: - name: git-clone-with-tags - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: url_configmapkey - value: GIT_DEV_REPO_URL - - name: revision - value: {{ .Values.global.git.dev_revision }} - - name: subdirectory - value: dev - - name: deleteExisting - value: "true" - - - name: git-clone-ops - taskRef: - name: git-clone-with-tags - runAfter: - - git-clone-dev - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: url_configmapkey - value: GIT_OPS_REPO_TEST_URL - - name: revision - value: {{ .Values.global.targetRevision }} - - name: subdirectory - value: ops - - name: deleteExisting - value: "true" - - - name: bump-build-version-iot-consumer - taskRef: - name: bumpversion - runAfter: - - git-clone-ops - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: component_name - value: iot-consumer - - name: version_file_path - value: components/iot-consumer/VERSION - - - name: s2i-build-iot-consumer - taskRef: - name: s2i - runAfter: - - bump-build-version-iot-consumer - workspaces: - - name: gitrepos - workspace: gitrepos - - name: build-artifacts - workspace: build-artifacts - params: - - name: TLSVERIFY - value: "false" - - name: PATH_CONTEXT - value: components/iot-consumer - - name: BUILDER_IMAGE - value: registry.access.redhat.com/rhscl/nodejs-10-rhel7 - - name: TAG - value: $(tasks.bump-build-version-iot-consumer.results.image-tag) - - name: OUTPUT_IMAGE - value: image-registry.openshift-image-registry.svc:5000/manuela-tst-all/messaging - - - name: copy-image-to-remote-registry-iot-consumer - taskRef: - name: skopeo-copy - runAfter: - - s2i-build-iot-consumer - workspaces: - - name: config - workspace: config - params: - - name: TAG - value: $(tasks.bump-build-version-iot-consumer.results.image-tag) - - name: SOURCE_IMAGE - value: image-registry.openshift-image-registry.svc:5000/manuela-tst-all/messaging - - name: TARGET_IMAGE_CONFIGMAPKEY - value: IOT_CONSUMER_IMAGE - - - name: push-dev-tag - taskRef: - name: github-push - runAfter: - - copy-image-to-remote-registry-iot-consumer - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: PUSH_FLAGS - value: --tags - - - name: modify-ops-test-iot-consumer - taskRef: - name: gitops-imagetag - runAfter: - - push-dev-tag - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: CONFIGMAP_PREFIX - value: IOT_CONSUMER - - name: ENVIRONMENT - value: TEST - - name: TAG - value: $(tasks.bump-build-version-iot-consumer.results.image-tag) - - name: subdirectory - value: ops - - - name: commit-ops - taskRef: - name: git-commit - runAfter: - - modify-ops-test-iot-consumer - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: subdirectory - value: ops - - - name: push-ops - taskRef: - name: github-push - runAfter: - - commit-ops - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: subdirectory - value: ops - - name: PUSH_FLAGS - value: --all - - - name: argocd-sync-application - taskRef: - name: argocd-sync-and-wait - runAfter: - - push-ops - workspaces: - - name: argocd-env-secret - workspace: argocd-env-secret - params: - - name: application-name - value: manuela-test - - name: flags - value: --insecure - - name: revision - value: $(params.OPS_REVISION) - - name: argocd-server - value: "{{ .Values.clusterGroup.name }}-gitops-server.{{ .Values.global.pattern }}-{{ .Values.clusterGroup.name }}.svc" - - - name: test-all - taskRef: - name: tkn - runAfter: - - argocd-sync-application - params: - - name: ARGS - value: - - pipeline - - start - - test-all - - --showlog - - --nocolour - - - name: trigger-staging - taskRef: - name: tkn - runAfter: - - test-all - params: - - name: ARGS - value: - - pipeline - - start - - stage-production - - --showlog - - --nocolour - - --param - - TAG=$(tasks.bump-build-version-iot-consumer.results.image-tag) - - --param - - CONFIGMAP_PREFIX=IOT_CONSUMER - - --param - - SOURCE_IMAGE=image-registry.openshift-image-registry.svc:5000/manuela-tst-all/messaging - - --workspace - - name=gitrepos,claimName=gitrepos-rwo - - --workspace - - name=config,config=environment - - --workspace - - name=github-secret,secret=gitea-admin-secret - - - name: cleanup - taskRef: - name: cleanup - runAfter: - - trigger-staging - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: subdirectory - value: dev - - name: COMPONENT_NAME - value: iot-consumer diff --git a/charts/datacenter/pipelines/templates/pipelines/build-and-test-iot-frontend.yaml b/charts/datacenter/pipelines/templates/pipelines/build-and-test-iot-frontend.yaml deleted file mode 100644 index f15d685b6..000000000 --- a/charts/datacenter/pipelines/templates/pipelines/build-and-test-iot-frontend.yaml +++ /dev/null @@ -1,244 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: build-and-test-iot-frontend -spec: - workspaces: - - name: gitrepos - - name: config - - name: build-artifacts - - name: argocd-env-secret - params: - - name: DEV_REVISION - type: string - default: {{ .Values.global.git.dev_revision }} - - name: OPS_REVISION - type: string - default: {{ .Values.global.targetRevision }} - - tasks: - - name: git-clone-dev - taskRef: - name: git-clone-with-tags - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: url_configmapkey - value: GIT_DEV_REPO_URL - - name: revision - value: {{ .Values.global.git.dev_revision }} - - name: subdirectory - value: dev - - name: deleteExisting - value: "true" - - - name: git-clone-ops - taskRef: - name: git-clone-with-tags - runAfter: - - git-clone-dev - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: url_configmapkey - value: GIT_OPS_REPO_TEST_URL - - name: revision - value: {{ .Values.global.targetRevision }} - - name: subdirectory - value: ops - - name: deleteExisting - value: "true" - - - name: bump-build-version-iot-frontend - taskRef: - name: bumpversion - runAfter: - - git-clone-ops - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: component_name - value: iot-frontend - - name: version_file_path - value: components/iot-frontend/VERSION - - - name: s2i-build-iot-frontend - taskRef: - name: s2i - runAfter: - - bump-build-version-iot-frontend - workspaces: - - name: gitrepos - workspace: gitrepos - - name: build-artifacts - workspace: build-artifacts - params: - - name: TLSVERIFY - value: "false" - - name: PATH_CONTEXT - value: components/iot-frontend - - name: BUILDER_IMAGE - value: quay.io/hybridcloudpatterns/ubi8-s2i-web-app - - name: chained_build_dockerfile - value: "FROM quay.io/hybridcloudpatterns/httpd-ionic\nCOPY --from=0 /opt/app-root/output /var/www/html/" - - name: TAG - value: $(tasks.bump-build-version-iot-frontend.results.image-tag) - - name: OUTPUT_IMAGE - value: image-registry.openshift-image-registry.svc:5000/manuela-tst-all/line-dashboard - - - name: copy-image-to-remote-registry-iot-frontend - taskRef: - name: skopeo-copy - runAfter: - - s2i-build-iot-frontend - workspaces: - - name: config - workspace: config - params: - - name: TAG - value: $(tasks.bump-build-version-iot-frontend.results.image-tag) - - name: SOURCE_IMAGE - value: image-registry.openshift-image-registry.svc:5000/manuela-tst-all/line-dashboard - - name: TARGET_IMAGE_CONFIGMAPKEY - value: IOT_FRONTEND_IMAGE - - - name: push-dev-tag - taskRef: - name: github-push - runAfter: - - copy-image-to-remote-registry-iot-frontend - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: PUSH_FLAGS - value: --tags - - - name: modify-ops-test-iot-frontend - taskRef: - name: gitops-imagetag - runAfter: - - push-dev-tag - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: CONFIGMAP_PREFIX - value: IOT_FRONTEND - - name: ENVIRONMENT - value: TEST - - name: TAG - value: $(tasks.bump-build-version-iot-frontend.results.image-tag) - - name: subdirectory - value: ops - - - name: commit-ops - taskRef: - name: git-commit - runAfter: - - modify-ops-test-iot-frontend - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: subdirectory - value: ops - - - name: push-ops - taskRef: - name: github-push - runAfter: - - commit-ops - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: subdirectory - value: ops - - name: PUSH_FLAGS - value: --all - - - name: argocd-sync-application - taskRef: - name: argocd-sync-and-wait - runAfter: - - push-ops - workspaces: - - name: argocd-env-secret - workspace: argocd-env-secret - params: - - name: application-name - value: manuela-test - - name: flags - value: --insecure - - name: revision - value: $(params.OPS_REVISION) - - name: argocd-server - value: "{{ .Values.clusterGroup.name }}-gitops-server.{{ .Values.global.pattern }}-{{ .Values.clusterGroup.name }}.svc" - - - name: test-all - taskRef: - name: tkn - runAfter: - - argocd-sync-application - params: - - name: ARGS - value: - - pipeline - - start - - test-all - - --showlog - - --nocolour - - - name: trigger-staging - taskRef: - name: tkn - runAfter: - - test-all - params: - - name: ARGS - value: - - pipeline - - start - - stage-production - - --showlog - - --nocolour - - --param - - TAG=$(tasks.bump-build-version-iot-frontend.results.image-tag) - - --param - - CONFIGMAP_PREFIX=IOT_FRONTEND - - --param - - SOURCE_IMAGE=image-registry.openshift-image-registry.svc:5000/manuela-tst-all/line-dashboard - - --workspace - - name=gitrepos,claimName=gitrepos-rwo - - --workspace - - name=config,config=environment - - --workspace - - name=github-secret,secret=gitea-admin-secret - - - name: cleanup - taskRef: - name: cleanup - runAfter: - - trigger-staging - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: subdirectory - value: dev - - name: COMPONENT_NAME - value: iot-frontend diff --git a/charts/datacenter/pipelines/templates/pipelines/build-and-test-iot-software-sensor.yaml b/charts/datacenter/pipelines/templates/pipelines/build-and-test-iot-software-sensor.yaml deleted file mode 100644 index e82362d7f..000000000 --- a/charts/datacenter/pipelines/templates/pipelines/build-and-test-iot-software-sensor.yaml +++ /dev/null @@ -1,242 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: build-and-test-iot-software-sensor -spec: - workspaces: - - name: gitrepos - - name: config - - name: build-artifacts - - name: argocd-env-secret - params: - - name: DEV_REVISION - type: string - default: {{ .Values.global.git.dev_revision }} - - name: OPS_REVISION - type: string - default: {{ .Values.global.targetRevision }} - - tasks: - - name: git-clone-dev - taskRef: - name: git-clone-with-tags - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: url_configmapkey - value: GIT_DEV_REPO_URL - - name: revision - value: {{ .Values.global.git.dev_revision }} - - name: subdirectory - value: dev - - name: deleteExisting - value: "true" - - - name: git-clone-ops - taskRef: - name: git-clone-with-tags - runAfter: - - git-clone-dev - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: url_configmapkey - value: GIT_OPS_REPO_TEST_URL - - name: revision - value: {{ .Values.global.targetRevision }} - - name: subdirectory - value: ops - - name: deleteExisting - value: "true" - - - name: bump-build-version-iot-software-sensor - taskRef: - name: bumpversion - runAfter: - - git-clone-ops - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: component_name - value: iot-software-sensor - - name: version_file_path - value: components/iot-software-sensor/VERSION - - - name: s2i-build-iot-software-sensor - taskRef: - name: s2i - runAfter: - - bump-build-version-iot-software-sensor - workspaces: - - name: gitrepos - workspace: gitrepos - - name: build-artifacts - workspace: build-artifacts - params: - - name: TLSVERIFY - value: "false" - - name: PATH_CONTEXT - value: components/iot-software-sensor - - name: BUILDER_IMAGE - value: registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift - - name: TAG - value: $(tasks.bump-build-version-iot-software-sensor.results.image-tag) - - name: OUTPUT_IMAGE - value: image-registry.openshift-image-registry.svc:5000/manuela-tst-all/machine-sensor - - - name: copy-image-to-remote-registry-iot-software-sensor - taskRef: - name: skopeo-copy - runAfter: - - s2i-build-iot-software-sensor - workspaces: - - name: config - workspace: config - params: - - name: TAG - value: $(tasks.bump-build-version-iot-software-sensor.results.image-tag) - - name: SOURCE_IMAGE - value: image-registry.openshift-image-registry.svc:5000/manuela-tst-all/machine-sensor - - name: TARGET_IMAGE_CONFIGMAPKEY - value: IOT_SWSENSOR_IMAGE - - - name: push-dev-tag - taskRef: - name: github-push - runAfter: - - copy-image-to-remote-registry-iot-software-sensor - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: PUSH_FLAGS - value: --tags - - - name: modify-ops-test-iot-software-sensor - taskRef: - name: gitops-imagetag - runAfter: - - push-dev-tag - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: CONFIGMAP_PREFIX - value: IOT_SWSENSOR - - name: ENVIRONMENT - value: TEST - - name: TAG - value: $(tasks.bump-build-version-iot-software-sensor.results.image-tag) - - name: subdirectory - value: ops - - - name: commit-ops - taskRef: - name: git-commit - runAfter: - - modify-ops-test-iot-software-sensor - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: subdirectory - value: ops - - - name: push-ops - taskRef: - name: github-push - runAfter: - - commit-ops - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: subdirectory - value: ops - - name: PUSH_FLAGS - value: --all - - - name: argocd-sync-application - taskRef: - name: argocd-sync-and-wait - runAfter: - - push-ops - workspaces: - - name: argocd-env-secret - workspace: argocd-env-secret - params: - - name: application-name - value: manuela-test - - name: flags - value: --insecure - - name: revision - value: $(params.OPS_REVISION) - - name: argocd-server - value: "{{ .Values.clusterGroup.name }}-gitops-server.{{ .Values.global.pattern }}-{{ .Values.clusterGroup.name }}.svc" - - - name: test-all - taskRef: - name: tkn - runAfter: - - argocd-sync-application - params: - - name: ARGS - value: - - pipeline - - start - - test-all - - --showlog - - --nocolour - - - name: trigger-staging - taskRef: - name: tkn - runAfter: - - test-all - params: - - name: ARGS - value: - - pipeline - - start - - stage-production - - --showlog - - --nocolour - - --param - - TAG=$(tasks.bump-build-version-iot-software-sensor.results.image-tag) - - --param - - CONFIGMAP_PREFIX=IOT_SWSENSOR - - --param - - SOURCE_IMAGE=image-registry.openshift-image-registry.svc:5000/manuela-tst-all/machine-sensor - - --workspace - - name=gitrepos,claimName=gitrepos-rwo - - --workspace - - name=config,config=environment - - --workspace - - name=github-secret,secret=gitea-admin-secret - - - name: cleanup - taskRef: - name: cleanup - runAfter: - - trigger-staging - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: subdirectory - value: dev - - name: COMPONENT_NAME - value: iot-software-sensor diff --git a/charts/datacenter/pipelines/templates/pipelines/build-base-images.yaml b/charts/datacenter/pipelines/templates/pipelines/build-base-images.yaml deleted file mode 100644 index 5cec96192..000000000 --- a/charts/datacenter/pipelines/templates/pipelines/build-base-images.yaml +++ /dev/null @@ -1,66 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: build-base-images -spec: - workspaces: - - name: gitrepos - - name: config - params: - - name: PATH_CONTEXT - type: string - default: tekton/images/httpd-ionic - - name: OUTPUT_IMAGE_PROVIDER_CONFIGMAPKEY - type: string - default: IMAGE_PROVIDER - - name: OUTPUT_IMAGE_ACCOUNT_CONFIGMAPKEY - type: string - default: IMAGE_ACCOUNT - - name: OUTPUT_IMAGE_NAME - type: string - default: httpd-ionic - - name: DEV_REVISION - type: string - default: main - tasks: - - name: git-clone-dev - taskRef: - name: git-clone-with-tags - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: url_configmapkey - value: GIT_DEV_REPO_URL - - name: revision - value: $(params.DEV_REVISION) - - name: subdirectory - value: dev - - name: deleteExisting - value: "true" - - - name: buildah-build - taskRef: - name: buildah - runAfter: - - git-clone-dev - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: TLSVERIFY - value: "false" - - name: PATH_CONTEXT - value: $(params.PATH_CONTEXT) - - name: TAG - value: latest - - name: OUTPUT_IMAGE_PROVIDER_CONFIGMAPKEY - value: $(params.OUTPUT_IMAGE_PROVIDER_CONFIGMAPKEY) - - name: OUTPUT_IMAGE_ACCOUNT_CONFIGMAPKEY - value: $(params.OUTPUT_IMAGE_ACCOUNT_CONFIGMAPKEY) - - name: OUTPUT_IMAGE_NAME - value: $(params.OUTPUT_IMAGE_NAME) diff --git a/charts/datacenter/pipelines/templates/pipelines/iot-component.yaml b/charts/datacenter/pipelines/templates/pipelines/iot-component.yaml deleted file mode 100644 index 8055df3c6..000000000 --- a/charts/datacenter/pipelines/templates/pipelines/iot-component.yaml +++ /dev/null @@ -1,213 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: iot-component -spec: - workspaces: - - name: gitrepos - - name: config - - name: build-artifacts - params: - - name: component_name - type: string - description: Name of IoT component to build - - name: seed_prod_with_tags - type: string - description: Seed tags to prod env - default: 'false' - - name: builder_image - type: string - description: The builder image to use for building the component - - name: chained_build_dockerfile - type: string - description: If a chained build is to be executed, the second part of the DOCKERFILE - default: "" - - name: output_image_name - type: string - description: Name of the output image after build - - name: target_image_configmapkey - type: string - description: Name of key of the target image in the configmap - - name: configmap_prefix - type: string - description: The prefix of the key in the configmap for the component - tasks: - - name: git-clone-dev - taskRef: - name: git-clone-with-tags - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: url_configmapkey - value: GIT_DEV_REPO_URL - - name: revision - value: {{ .Values.global.git.dev_revision }} - - name: subdirectory - value: dev - - name: deleteExisting - value: "true" - - - name: git-clone-ops - taskRef: - name: git-clone-with-tags - runAfter: - - git-clone-dev - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: url_configmapkey - value: GIT_OPS_REPO_TEST_URL - - name: revision - value: {{ .Values.global.targetRevision }} - - name: subdirectory - value: ops - - name: deleteExisting - value: "true" - - - name: bump-build-version-iot-component - displayName: "Bump version for $(params.component_name)" - taskRef: - name: bumpversion - runAfter: - - git-clone-ops - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: component_name - value: $(params.component_name) - - name: version_file_path - value: components/$(params.component_name)/VERSION - - - name: s2i-build-iot-component - displayName: "S2I build IoT $(params.component_name)" - taskRef: - name: s2i - runAfter: - - bump-build-version-iot-component - workspaces: - - name: gitrepos - workspace: gitrepos - - name: build-artifacts - workspace: build-artifacts - params: - - name: TLSVERIFY - value: "false" - - name: PATH_CONTEXT - value: components/$(params.component_name) - - name: BUILDER_IMAGE - value: $(params.builder_image) - - name: CHAINED_BUILD_DOCKERFILE - value: $(params.chained_build_dockerfile) - - name: TAG - value: $(tasks.bump-build-version-iot-component.results.image-tag) - - name: OUTPUT_IMAGE - value: image-registry.openshift-image-registry.svc:5000/manuela-tst-all/$(params.output_image_name) - - - name: copy-image-to-remote-registry - displayName: "Copy image to remote registry" - taskRef: - name: skopeo-copy - runAfter: - - s2i-build-iot-component - workspaces: - - name: config - workspace: config - params: - - name: TAG - value: $(tasks.bump-build-version-iot-component.results.image-tag) - - name: SOURCE_IMAGE - value: image-registry.openshift-image-registry.svc:5000/manuela-tst-all/$(params.output_image_name) - - name: TARGET_IMAGE_CONFIGMAPKEY - value: $(params.target_image_configmapkey) - - - name: push-dev-tag - taskRef: - name: github-push - runAfter: - - copy-image-to-remote-registry - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: PUSH_FLAGS - value: --tags - - - - name: modify-ops-test-iot-component - taskRef: - name: gitops-imagetag - runAfter: - - push-dev-tag - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: CONFIGMAP_PREFIX - value: $(params.configmap_prefix) - - name: ENVIRONMENT - value: TEST - - name: TAG - value: $(tasks.bump-build-version-iot-component.results.image-tag) - - name: subdirectory - value: ops - - - name: modify-ops-prod-iot-component - when: - - input: "$(params.seed_prod_with_tags)" - operator: in - values: ["true"] - taskRef: - name: gitops-imagetag - runAfter: - - modify-ops-test-iot-component - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: CONFIGMAP_PREFIX - value: $(params.configmap_prefix) - - name: ENVIRONMENT - value: PROD - - name: TAG - value: $(tasks.bump-build-version-iot-component.results.image-tag) - - name: subdirectory - value: ops - - - name: commit-ops - taskRef: - name: git-commit - runAfter: - - modify-ops-prod-iot-component - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: subdirectory - value: ops - - - name: push-ops - taskRef: - name: github-push - runAfter: - - commit-ops - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: subdirectory - value: ops - - name: PUSH_FLAGS - value: --all diff --git a/charts/datacenter/pipelines/templates/pipelines/seed.yaml b/charts/datacenter/pipelines/templates/pipelines/seed.yaml index f8d619c59..ebfb7cbf2 100644 --- a/charts/datacenter/pipelines/templates/pipelines/seed.yaml +++ b/charts/datacenter/pipelines/templates/pipelines/seed.yaml @@ -7,191 +7,45 @@ spec: - name: gitrepos - name: config - name: build-artifacts - params: - - name: DEV_REVISION - type: string - default: {{ .Values.global.git.dev_revision }} - - name: OPS_REVISION - type: string - default: {{ .Values.global.targetRevision }} tasks: - - name: build-base-images - taskRef: - name: tkn - kind: Task - params: - - name: ARGS - value: - - pipeline - - start - - build-base-images - - --param - - PATH_CONTEXT=tekton/images/httpd-ionic - - --param - - OUTPUT_IMAGE_PROVIDER_CONFIGMAPKEY=IMAGE_PROVIDER - - --param - - OUTPUT_IMAGE_ACCOUNT_CONFIGMAPKEY=IMAGE_ACCOUNT - - --param - - OUTPUT_IMAGE_NAME=httpd-ionic - - --param - - DEV_REVISION=$(params.DEV_REVISION) - - --workspace - - name=gitrepos,claimName=gitrepos-rwo - - --workspace - - name=config,config=environment - - --workspace - - name=build-artifacts,claimName=build-artifacts-rwo - - --showlog - - --nocolour + - name: git-clone-dev + taskRef: + name: git-clone-with-tags + workspaces: + - name: gitrepos + workspace: gitrepos + - name: config + workspace: config + params: + - name: url_configmapkey + value: GIT_DEV_REPO_URL + - name: revision + value: {{ .Values.global.git.dev_revision }} + - name: subdirectory + value: dev + - name: deleteExisting + value: "true" - - name: seed-iot-anomaly-detection - runAfter: - - build-base-images - taskRef: - name: tkn - kind: Task - params: - - name: ARGS - value: - - pipeline - - start - - iot-component - - --param - - component_name=iot-anomaly-detection - - --param - - seed_prod_with_tags=true - - --param - - builder_image=quay.io/hybridcloudpatterns/python-38-rhel7 - - --param - - chained_build_dockerfile="" - - --param - - output_image_name=anomaly-detection - - --param - - target_image_configmapkey=IOT_ANOMALY_IMAGE - - --param - - configmap_prefix=IOT_ANOMALY - - --workspace - - name=gitrepos,claimName=gitrepos-rwo - - --workspace - - name=config,config=environment - - --workspace - - name=build-artifacts,claimName=build-artifacts-rwo - - --prefix-name - - seed-iot-anomaly-detection - - --showlog - - --nocolour - - --exit-with-pipelinerun-error + - name: git-clone-ops + taskRef: + name: git-clone-with-tags + workspaces: + - name: gitrepos + workspace: gitrepos + - name: config + workspace: config + params: + - name: url_configmapkey + value: GIT_OPS_REPO_TEST_URL + - name: revision + value: {{ $.Values.global.targetRevision }} + - name: subdirectory + value: ops + - name: deleteExisting + value: "true" - - name: seed-iot-consumer - runAfter: - - seed-iot-anomaly-detection - taskRef: - name: tkn - kind: Task - params: - - name: ARGS - value: - - pipeline - - start - - iot-component - - --param - - component_name=iot-consumer - - --param - - seed_prod_with_tags=true - - --param - - builder_image=registry.access.redhat.com/rhscl/nodejs-10-rhel7 - - --param - - chained_build_dockerfile="" - - --param - - output_image_name=messaging - - --param - - target_image_configmapkey=IOT_CONSUMER_IMAGE - - --param - - configmap_prefix=IOT_CONSUMER - - --workspace - - name=gitrepos,claimName=gitrepos-rwo - - --workspace - - name=config,config=environment - - --workspace - - name=build-artifacts,claimName=build-artifacts-rwo - - --prefix-name - - seed-iot-consumer - - --showlog - - --nocolour - - --exit-with-pipelinerun-error - - - name: seed-iot-frontend - runAfter: - - seed-iot-consumer - taskRef: - name: tkn - kind: Task - params: - - name: ARGS - value: - - pipeline - - start - - iot-component - - --param - - component_name=iot-frontend - - --param - - seed_prod_with_tags=true - - --param - - builder_image=quay.io/hybridcloudpatterns/ubi8-s2i-web-app - - --param - - chained_build_dockerfile=FROM quay.io/hybridcloudpatterns/httpd-ionic\nCOPY --from=0 /opt/app-root/output /var/www/html/ - - --param - - output_image_name=line-dashboard - - --param - - target_image_configmapkey=IOT_FRONTEND_IMAGE - - --param - - configmap_prefix=IOT_FRONTEND - - --workspace - - name=gitrepos,claimName=gitrepos-rwo - - --workspace - - name=config,config=environment - - --workspace - - name=build-artifacts,claimName=build-artifacts-rwo - - --prefix-name - - seed-iot-frontend - - --showlog - - --nocolour - - --exit-with-pipelinerun-error - - - name: seed-iot-software-sensor - runAfter: - - seed-iot-frontend - taskRef: - name: tkn - kind: Task - params: - - name: ARGS - value: - - pipeline - - start - - iot-component - - --param - - component_name=iot-software-sensor - - --param - - seed_prod_with_tags=true - - --param - - builder_image=registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift - - --param - - chained_build_dockerfile="" - - --param - - output_image_name=machine-sensor - - --param - - target_image_configmapkey=IOT_SWSENSOR_IMAGE - - --param - - configmap_prefix=IOT_SWSENSOR - - --workspace - - name=gitrepos,claimName=gitrepos-rwo - - --workspace - - name=config,config=environment - - --workspace - - name=build-artifacts,claimName=build-artifacts-rwo - - --prefix-name - - seed-iot-software-sensor - - --showlog - - --nocolour - - --exit-with-pipelinerun-error + {{- include "build-base-images" $ | nindent 4 }} + {{- range .Values.pipeline_components }} + {{- include "build-iot-component" (dict "root" $.Values "component" . "seed_prod" "true") | nindent 4 }} + {{/*- include "test_include" (dict "root" $.Values "component" . "seed_prod" "true") | nindent 4 */}} + {{- end }} \ No newline at end of file diff --git a/charts/datacenter/pipelines/templates/pipelines/stage-production.yaml b/charts/datacenter/pipelines/templates/pipelines/stage-production.yaml deleted file mode 100644 index 27141c45d..000000000 --- a/charts/datacenter/pipelines/templates/pipelines/stage-production.yaml +++ /dev/null @@ -1,133 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: stage-production -spec: - workspaces: - - name: gitrepos - - name: config - - name: github-secret - params: - - name: TAG - type: string - - name: SOURCE_IMAGE - type: string - - name: CONFIGMAP_PREFIX - type: string - - tasks: - - name: git-clone-ops - taskRef: - name: git-clone-with-tags - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: url_configmapkey - value: GIT_OPS_REPO_PROD_URL - - name: revision - value: {{ .Values.global.targetRevision }} - - name: subdirectory - value: ops - - name: deleteExisting - value: "true" - - - name: copy-image-to-remote-registry - taskRef: - name: skopeo-copy - runAfter: - - git-clone-ops - workspaces: - - name: config - workspace: config - params: - - name: TAG - value: $(params.TAG) - - name: SOURCE_IMAGE - value: $(params.SOURCE_IMAGE) - - name: TARGET_IMAGE_CONFIGMAPKEY - value: $(params.CONFIGMAP_PREFIX)_IMAGE - - - name: checkout-staging-branch - taskRef: - name: git-checkout - runAfter: - - copy-image-to-remote-registry - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: subdirectory - value: ops - - name: BRANCH - value: staging-approval - - name: STARTINGBRANCH - value: {{ .Values.global.targetRevision }} - - - name: modify-ops-prod - taskRef: - name: gitops-imagetag - runAfter: - - checkout-staging-branch - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: CONFIGMAP_PREFIX - value: $(params.CONFIGMAP_PREFIX) - - name: ENVIRONMENT - value: PROD - - name: TAG - value: $(params.TAG) - - name: subdirectory - value: ops - - - name: commit-ops-prod - taskRef: - name: git-commit - runAfter: - - modify-ops-prod - workspaces: - - name: gitrepos - workspace: gitrepos - - name: config - workspace: config - params: - - name: subdirectory - value: ops - - - name: push-ops-prod - taskRef: - name: github-push - runAfter: - - commit-ops-prod - workspaces: - - name: gitrepos - workspace: gitrepos - params: - - name: subdirectory - value: ops - - name: PUSH_FLAGS - value: --set-upstream origin staging-approval -f - - - name: github-pull-request - taskRef: - name: github-add-pull-request - runAfter: - - push-ops-prod - workspaces: - - name: config - workspace: config - - name: github-secret - workspace: github-secret - params: - - name: GITHUB_REPO_CONFIGMAPKEY - value: GIT_OPS_REPO_PROD_URL - - name: GIT_BRANCH_HEAD - value: staging-approval - - name: GIT_BRANCH_BASE - value: {{ .Values.global.targetRevision }} diff --git a/charts/datacenter/pipelines/templates/pipelines/test-all.yaml b/charts/datacenter/pipelines/templates/pipelines/test-all.yaml deleted file mode 100644 index 546208ab1..000000000 --- a/charts/datacenter/pipelines/templates/pipelines/test-all.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: test-all -spec: - tasks: - - name: sensor-broker-test - taskRef: - name: mock - kind: Task - params: - - name: MESSAGE - value: "succesfully sent messages to broker..." - - name: consumer-broker-test - taskRef: - name: mock - kind: Task - params: - - name: MESSAGE - value: "succesfully processed messages from broker..." - - name: consumer-frontend-test - taskRef: - name: mock - kind: Task - params: - - name: MESSAGE - value: "succesfully executed Websocket APIs..." - - name: e2e-test - taskRef: - name: mock - kind: Task - runAfter: - - sensor-broker-test - - consumer-broker-test - - consumer-frontend-test - params: - - name: MESSAGE - value: "e2e testsuite succesfully executed" diff --git a/charts/datacenter/pipelines/templates/tasks/tkn.yaml b/charts/datacenter/pipelines/templates/tasks/tkn.yaml deleted file mode 100644 index adea1bba3..000000000 --- a/charts/datacenter/pipelines/templates/tasks/tkn.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Task -metadata: - name: tkn -spec: - params: - - name: tkn-image - description: tkn CLI container image to run this task - default: registry.redhat.io/openshift-pipelines/pipelines-cli-tkn-rhel8:v1.16.1-2 - - name: ARGS - type: array - description: tkn CLI arguments to run - steps: - - name: tkn - image: "$(params.tkn-image)" - command: ["/usr/bin/tkn"] - args: ["$(params.ARGS)"] \ No newline at end of file diff --git a/charts/datacenter/pipelines/values.yaml b/charts/datacenter/pipelines/values.yaml index 7302274ae..72380c73a 100644 --- a/charts/datacenter/pipelines/values.yaml +++ b/charts/datacenter/pipelines/values.yaml @@ -61,3 +61,22 @@ iot_anomaly_detection: yq: image: quay.io/hybridcloudpatterns/yq:latest + +pipeline_components: + - component_name: iot-anomaly-detection + builder_image: quay.io/hybridcloudpatterns/python-38-rhel7 + output_image_name: anomaly-detection + configmap_prefix: IOT_ANOMALY + - component_name: iot-consumer + builder_image: registry.access.redhat.com/rhscl/nodejs-10-rhel7 + output_image_name: messaging + configmap_prefix: IOT_CONSUMER + - component_name: iot-frontend + builder_image: quay.io/hybridcloudpatterns/ubi8-s2i-web-app + chained_build_dockerfile: "FROM quay.io/hybridcloudpatterns/httpd-ionic\\nCOPY --from=0 /opt/app-root/output /var/www/html/" + output_image_name: line-dashboard + configmap_prefix: IOT_FRONTEND + - component_name: iot-software-sensor + builder_image: registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift + output_image_name: machine-sensor + configmap_prefix: IOT_SWSENSOR \ No newline at end of file diff --git a/scripts/check-pipeline-resources.sh b/scripts/check-pipeline-resources.sh index 147fb21eb..8df8e018f 100755 --- a/scripts/check-pipeline-resources.sh +++ b/scripts/check-pipeline-resources.sh @@ -3,7 +3,6 @@ while [ 1 ]; do echo "Waiting for seed resources to be ready in manuela-ci" oc get -n manuela-ci pipeline seed 1>/dev/null 2>/dev/null && \ - oc get -n manuela-ci task tkn 1>/dev/null 2>/dev/null && \ oc get -n manuela-ci secret gitea-admin-secret 1>/dev/null 2>/dev/null && \ oc get -n manuela-ci secret image-registry-credentials 1>/dev/null 2>/dev/null && \ echo "Bootstrap seed now can run" && break; diff --git a/tests/interop/test_pipeline_build_check.py b/tests/interop/test_pipeline_build_check.py index 84e760d85..f80f95cab 100644 --- a/tests/interop/test_pipeline_build_check.py +++ b/tests/interop/test_pipeline_build_check.py @@ -64,10 +64,10 @@ def test_pipeline_build_check(openshift_dyn_client): chart = ( f"{os.environ['HOME']}" + "/validated_patterns/industrial-edge/charts/" - + "datacenter/pipelines/extra/build-and-test-run.yaml" + + "datacenter/pipelines/extra/build-and-test-iot-consumer.yaml" ) else: - chart = "../../charts/datacenter/pipelines/extra/build-and-test-run.yaml" + chart = "../../charts/datacenter/pipelines/extra/build-and-test-iot-consumer.yaml" logger.info(f"Chart: {chart}") diff --git a/tests/interop/test_validate_pipelineruns.py b/tests/interop/test_validate_pipelineruns.py index 634543d2e..adf8fd932 100644 --- a/tests/interop/test_validate_pipelineruns.py +++ b/tests/interop/test_validate_pipelineruns.py @@ -18,8 +18,6 @@ def test_validate_pipelineruns(openshift_dyn_client): expected_pipelines = [ "seed", - "build-base-images", - "iot-component", "build-and-test-iot-anomaly-detection", "build-and-test-iot-consumer", "build-and-test-iot-frontend", @@ -28,11 +26,6 @@ def test_validate_pipelineruns(openshift_dyn_client): expected_pipelineruns = [ "seed-run", - "build-base-images-run", - "seed-iot-anomaly-detection-run", - "seed-iot-consumer-run", - "seed-iot-frontend-run", - "seed-iot-software-sensor-run", ] err_msg = components.validate_pipelineruns(