diff --git a/.tekton/pipeline.yaml b/.tekton/pipeline.yaml index 9dca8ed..b1a0b4d 100644 --- a/.tekton/pipeline.yaml +++ b/.tekton/pipeline.yaml @@ -16,6 +16,10 @@ spec: description: Name of the application name: APP_NAME type: string + - default: "image-registry.openshift-image-registry.svc:5000/$(context.pipelineRun.namespace)/$(params.APP_NAME):latest" + description: The name of the image to build + name: IMAGE_NAME + type: string tasks: - name: git-clone params: @@ -57,5 +61,100 @@ spec: workspaces: - name: output workspace: shopcarts-pipeline-workspace + - name: test + params: + - name: PYTEST_ARGS + value: [] + - name: SECRET_NAME + value: postgres-creds + - name: SECRET_KEY + value: database_uri + runAfter: + - git-clone + taskRef: + kind: Task + name: pytest-env + workspaces: + - name: source + workspace: shopcarts-pipeline-workspace + - name: buildah + params: + - name: IMAGE + value: $(params.IMAGE_NAME) + - name: BUILDER_IMAGE + value: "registry.redhat.io/rhel8/buildah@sha256:b48f410efa0ff8ab0db6ead420a5d8d866d64af846fece5efb185230d7ecf591" + - name: STORAGE_DRIVER + value: vfs + - name: DOCKERFILE + value: ./Dockerfile + - name: CONTEXT + value: . + - name: TLSVERIFY + value: "true" + - name: FORMAT + value: oci + - name: BUILD_EXTRA_ARGS + value: "" + - name: PUSH_EXTRA_ARGS + value: "" + - name: SKIP_PUSH + value: "false" + runAfter: + - test + - pylint + taskRef: + kind: ClusterTask + name: buildah + workspaces: + - name: source + workspace: shopcarts-pipeline-workspace + - name: pylint + params: + - name: image + value: "docker.io/python:3.11-slim" + - name: path + value: service + - name: args + value: [] + - name: requirements_file + value: requirements.txt + runAfter: + - git-clone + taskRef: + kind: Task + name: pylint + workspaces: + - name: source + workspace: shopcarts-pipeline-workspace + - name: deploy-image + params: + - name: image_name + value: $(params.IMAGE_NAME) + - name: manifest_dir + value: k8s + runAfter: + - buildah + taskRef: + kind: Task + name: deploy-image + workspaces: + - name: source + workspace: shopcarts-pipeline-workspace + - name: behave + params: + - name: BASE_URL + value: "https://shopcarts-whykay-01-dev.apps.sandbox-m4.g2pi.p1.openshiftapps.com" + - name: WAIT_SECONDS + value: "60" + - name: DRIVER + value: chrome + runAfter: + - deploy-image + taskRef: + kind: Task + name: behave + workspaces: + - name: source + workspace: shopcarts-pipeline-workspace workspaces: - name: shopcarts-pipeline-workspace