Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ add Pipelines as Code #285

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
37 changes: 37 additions & 0 deletions .tekton/tasks/tox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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
params:
- name: TOXENV
description: >-
The tox environment to run.
default: "py310"
steps:
- name: tox
image: docker.io/fedorapython/fedora-python-tox:latest
command:
- /bin/bash
env:
- name: TOXENV
value: "$(params.TOXENV)"
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.
65 changes: 65 additions & 0 deletions .tekton/tox-on-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
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-py310
runAfter:
- fetch-repository
taskRef:
name: tox
params:
- name: TOXENV
value: py310
workspaces:
- name: source
workspace: source
- name: tox-py311-pipgit
runAfter:
- fetch-repository
taskRef:
name: tox
params:
- name: TOXENV
value: py311-pipgit
workspaces:
- name: source
workspace: source

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