diff --git a/tekton/conditions/public-project.yaml b/tekton/conditions/public-project.yaml index 1b8fc42..fd897b9 100644 --- a/tekton/conditions/public-project.yaml +++ b/tekton/conditions/public-project.yaml @@ -9,3 +9,15 @@ spec: check: image: alpine 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' diff --git a/tekton/pipelines/deploy.yaml b/tekton/pipelines/deploy.yaml index 5f274c5..7a496db 100644 --- a/tekton/pipelines/deploy.yaml +++ b/tekton/pipelines/deploy.yaml @@ -80,11 +80,15 @@ spec: inputs: - name: src resource: git-source - - name: make-release + - name: make-release-public + conditions: + - conditionRef: is-public-project + params: + - name: isprivate + value: $(params.isprivate) taskRef: name: make runAfter: - - build-and-publish-sha - build-and-publish-sha-public params: - name: TARGET @@ -99,3 +103,26 @@ spec: inputs: - name: src 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