Skip to content

Commit

Permalink
✨ add Pipelines as Code
Browse files Browse the repository at this point in the history
  • Loading branch information
goern committed Aug 15, 2023
1 parent 591a71f commit c7ca87b
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .tekton/repository.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: pipelinesascode.tekton.dev/v1alpha1
kind: Repository
metadata:
name: micropipenv
spec:
url: https://github.com/goern/micropipenv
29 changes: 29 additions & 0 deletions .tekton/tasks/tox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: tox
labels:
app.kubernetes.io/version: "0.1.0"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/tags: python, tox
tekton.dev/displayName: "Tox"
spec:
description: >-
run tox using Fedora-Python
steps:
- name: tox
image: docker.io/fedorapython/fedora-python-tox:latest
command:
- /bin/bash
args:
- -c
- |
set -x
cd /workspace/src
tox
workspaces:
- name: source
mountPath: /workspace/src
description: >-
The workspace containing the source code which needs to be released.
51 changes: 51 additions & 0 deletions .tekton/tox-on-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: tox-on-pr
annotations:
pipelinesascode.tekton.dev/on-event: "[pull_request]"
pipelinesascode.tekton.dev/on-target-branch: "[master]"
pipelinesascode.tekton.dev/task: "[git-clone, .tekton/tasks/tox.yaml]"
pipelinesascode.tekton.dev/max-keep-runs: "5"
spec:
params:
- name: repo_url
value: "{{ repo_url }}"
- name: revision
value: "{{ revision }}"
pipelineSpec:
params:
- name: repo_url
- name: revision
workspaces:
- name: source
tasks:
- name: fetch-repository
taskRef:
name: git-clone
workspaces:
- name: output
workspace: source
params:
- name: url
value: $(params.repo_url)
- name: revision
value: $(params.revision)
- name: tox
runAfter:
- fetch-repository
taskRef:
name: tox
workspaces:
- name: source
workspace: source

workspaces:
- name: source
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi

0 comments on commit c7ca87b

Please # to comment.