2020-04-25 18:18:33 +00:00
|
|
|
apiVersion: tekton.dev/v1beta1
|
|
|
|
kind: Pipeline
|
|
|
|
metadata:
|
|
|
|
name: deploy-project
|
|
|
|
namespace: tekton-pipelines
|
|
|
|
spec:
|
|
|
|
params:
|
|
|
|
- name: gitbranch
|
|
|
|
type: string
|
|
|
|
- name: gitrevision
|
|
|
|
type: string
|
|
|
|
- name: projectname
|
|
|
|
type: string
|
|
|
|
- name: isprivate
|
|
|
|
default: "true"
|
|
|
|
type: string
|
|
|
|
- name: dockerregistry
|
|
|
|
type: string
|
|
|
|
description: The Docker registry to push images to
|
2020-05-02 20:17:00 +00:00
|
|
|
default: docker.cluster.fun/private
|
2020-04-25 18:18:33 +00:00
|
|
|
- name: publicdockerregistry
|
|
|
|
type: string
|
|
|
|
description: The Docker registry to push images to
|
2020-05-02 20:17:00 +00:00
|
|
|
default: docker.cluster.fun/averagemarcus
|
2020-04-25 18:18:33 +00:00
|
|
|
- name: imagetag
|
|
|
|
type: string
|
|
|
|
description: The Docker image tag
|
|
|
|
default: latest
|
|
|
|
resources:
|
|
|
|
- name: git-source
|
|
|
|
type: git
|
|
|
|
tasks:
|
|
|
|
- name: build-and-publish-latest
|
|
|
|
taskRef:
|
|
|
|
name: docker-build-and-publish
|
|
|
|
params:
|
|
|
|
- name: IMAGE
|
|
|
|
value: $(params.dockerregistry)/$(params.projectname):$(params.imagetag)
|
|
|
|
resources:
|
|
|
|
inputs:
|
|
|
|
- name: src
|
|
|
|
resource: git-source
|
|
|
|
- name: build-and-publish-sha
|
|
|
|
taskRef:
|
|
|
|
name: docker-build-and-publish
|
|
|
|
params:
|
|
|
|
- name: IMAGE
|
|
|
|
value: $(params.dockerregistry)/$(params.projectname):$(params.gitrevision)
|
|
|
|
resources:
|
|
|
|
inputs:
|
|
|
|
- name: src
|
|
|
|
resource: git-source
|
|
|
|
- name: build-and-publish-public
|
|
|
|
conditions:
|
|
|
|
- conditionRef: is-public-project
|
|
|
|
params:
|
|
|
|
- name: isprivate
|
|
|
|
value: $(params.isprivate)
|
|
|
|
taskRef:
|
|
|
|
name: docker-build-and-publish
|
|
|
|
params:
|
|
|
|
- name: IMAGE
|
|
|
|
value: $(params.publicdockerregistry)/$(params.projectname):$(params.imagetag)
|
|
|
|
resources:
|
|
|
|
inputs:
|
|
|
|
- name: src
|
|
|
|
resource: git-source
|
2020-05-07 20:15:26 +00:00
|
|
|
- name: build-and-publish-sha-public
|
|
|
|
conditions:
|
|
|
|
- conditionRef: is-public-project
|
|
|
|
params:
|
|
|
|
- name: isprivate
|
|
|
|
value: $(params.isprivate)
|
|
|
|
taskRef:
|
|
|
|
name: docker-build-and-publish
|
|
|
|
params:
|
|
|
|
- name: IMAGE
|
|
|
|
value: $(params.publicdockerregistry)/$(params.projectname):$(params.gitrevision)
|
|
|
|
resources:
|
|
|
|
inputs:
|
|
|
|
- name: src
|
|
|
|
resource: git-source
|
2020-05-25 19:49:39 +00:00
|
|
|
- name: make-release-public
|
|
|
|
conditions:
|
|
|
|
- conditionRef: is-public-project
|
|
|
|
params:
|
|
|
|
- name: isprivate
|
|
|
|
value: $(params.isprivate)
|
2020-04-25 18:18:33 +00:00
|
|
|
taskRef:
|
|
|
|
name: make
|
2020-05-07 20:15:26 +00:00
|
|
|
runAfter:
|
|
|
|
- build-and-publish-sha-public
|
2020-04-25 18:18:33 +00:00
|
|
|
params:
|
|
|
|
- name: TARGET
|
|
|
|
value: "release"
|
2020-05-07 20:15:26 +00:00
|
|
|
- name: REPO
|
|
|
|
value: $(params.projectname)
|
|
|
|
- name: PR_ID
|
|
|
|
value: ""
|
|
|
|
- name: SHA
|
|
|
|
value: $(params.gitrevision)
|
2020-04-25 18:18:33 +00:00
|
|
|
resources:
|
|
|
|
inputs:
|
|
|
|
- name: src
|
|
|
|
resource: git-source
|
2020-05-25 19:49:39 +00:00
|
|
|
- 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
|