Skip to content

Commit

Permalink
Merge pull request #92 from CSCI-GA-2820-SP24-003/tekton-pipeline
Browse files Browse the repository at this point in the history
Add tekton pipeline yaml
  • Loading branch information
alexqzh23 authored Apr 29, 2024
2 parents f3db32d + aa34547 commit 66e36c8
Showing 1 changed file with 149 additions and 0 deletions.
149 changes: 149 additions & 0 deletions .tekton/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# Completed cd-pipeline from the OpenShift lab
---
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: cd-pipeline
spec:
workspaces:
- name: pipeline-workspace
params:
- name: GIT_REPO
description: The URL to the git repo
type: string
- name: GIT_REF
description: The reference (branch or ref)
type: string
default: master
- name: APP_NAME
description: Name of the application
type: string
default: petshop
- name: IMAGE_NAME
description: The name of the image to build
type: string
default: 'image-registry.openshift-image-registry.svc:5000/$(context.pipelineRun.namespace)/$(params.APP_NAME):latest'
tasks:
- name: git-clone
params:
- name: url
value: $(params.GIT_REPO)
- name: revision
value: $(params.GIT_REF)
- name: refspec
value: ''
- name: submodules
value: 'true'
- name: depth
value: '1'
- name: sslVerify
value: 'true'
- name: crtFileName
value: ca-bundle.crt
- name: subdirectory
value: ''
- name: sparseCheckoutDirectories
value: ''
- name: deleteExisting
value: 'true'
- name: httpProxy
value: ''
- name: httpsProxy
value: ''
- name: noProxy
value: ''
- name: verbose
value: 'true'
- name: gitInitImage
value: >-
registry.redhat.io/openshift-pipelines/pipelines-git-init-rhel8@sha256:1a50511583fc02a27012d17d942e247813404104ddd282d7e26f99765174392c
- name: userHome
value: /home/git
taskRef:
kind: ClusterTask
name: git-clone
workspaces:
- name: output
workspace: pipeline-workspace
- name: linting
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: pipeline-workspace
- name: testing
params:
- name: PYTEST_ARGS
value:
- '--pspec'
- '--cov=service'
- '--cov-fail-under=95'
- 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: 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:
- linting
- testing
taskRef:
kind: ClusterTask
name: buildah
workspaces:
- name: source
workspace: 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: pipeline-workspace

0 comments on commit 66e36c8

Please sign in to comment.