Skip to content

Commit

Permalink
add lint and test to pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
tokotority committed Dec 12, 2023
1 parent 113bd82 commit 76be555
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
45 changes: 44 additions & 1 deletion .tekton/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ spec:
description: The reference (branch or ref)
name: GIT_REF
type: string
- default: '-vvv --processes=1 --run-coverage --minimum-coverage=95'
description: Arguments for green testing
name: GREEN_ARGS
type: string
- default: products
description: Name of the application
name: APP_NAME
Expand Down Expand Up @@ -68,6 +72,44 @@ spec:
- name: output
workspace: pipeline-workspace

- name: pylint
params:
- name: image
value: 'docker.io/rofrano/nyu-devops-base:fa23'
- name: path
value: service
- name: requirements_file
value: requirements.txt
- name: args
value: ["--max-line-length=127"]
- name: pip_conf_file
value: pip.conf
runAfter:
- git-clone
taskRef:
kind: Task
name: pylint
workspaces:
- name: source
workspace: pipeline-workspace

- name: testing
params:
- name: ARGS
value: $(params.GREEN_ARGS)
- name: SECRET_NAME
value: postgres-secret
- name: SECRET_KEY
value: database_uri
runAfter:
- git-clone
taskRef:
kind: Task
name: green
workspaces:
- name: source
workspace: pipeline-workspace

- name: buildah
params:
- name: IMAGE
Expand All @@ -92,7 +134,8 @@ spec:
- name: SKIP_PUSH
value: 'false'
runAfter:
- git-clone
- pylint
- testing
taskRef:
kind: ClusterTask
name: buildah
Expand Down
4 changes: 3 additions & 1 deletion .tekton/tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
default: "database_uri"
steps:
- name: green
image: python:3.11-slim
image: docker.io/rofrano/nyu-devops-base:fa23
workingDir: $(workspaces.source.path)
env:
- name: DATABASE_URI
Expand All @@ -49,8 +49,10 @@ spec:
pip install -qr requirements.txt
echo "***** Running Tests *****"
export PATH=/home/vscode/.local/bin:$PATH
green $(params.ARGS)
---
apiVersion: tekton.dev/v1beta1
kind: Task
Expand Down

0 comments on commit 76be555

Please sign in to comment.