Added support for releasing private projects

This commit is contained in:
Marcus Noble 2020-05-25 20:49:39 +01:00
parent 58b64b7338
commit 9abc8502d0
2 changed files with 41 additions and 2 deletions

View File

@ -9,3 +9,15 @@ spec:
check: check:
image: alpine image: alpine
script: 'test $(params.isprivate) == false' script: 'test $(params.isprivate) == false'
---
apiVersion: tekton.dev/v1alpha1
kind: Condition
metadata:
name: is-private-project
namespace: tekton-pipelines
spec:
params:
- name: isprivate
check:
image: alpine
script: 'test $(params.isprivate) == true'

View File

@ -80,11 +80,15 @@ spec:
inputs: inputs:
- name: src - name: src
resource: git-source resource: git-source
- name: make-release - name: make-release-public
conditions:
- conditionRef: is-public-project
params:
- name: isprivate
value: $(params.isprivate)
taskRef: taskRef:
name: make name: make
runAfter: runAfter:
- build-and-publish-sha
- build-and-publish-sha-public - build-and-publish-sha-public
params: params:
- name: TARGET - name: TARGET
@ -99,3 +103,26 @@ spec:
inputs: inputs:
- name: src - name: src
resource: git-source resource: git-source
- name: make-release-private
conditions:
- conditionRef: is-private-project
params:
- name: isprivate
value: $(params.isprivate)
taskRef:
name: make
runAfter:
- build-and-publish-sha
params:
- name: TARGET
value: "release"
- name: REPO
value: $(params.projectname)
- name: PR_ID
value: ""
- name: SHA
value: $(params.gitrevision)
resources:
inputs:
- name: src
resource: git-source