Merge pull request #287 from zcash/tekton-docker-build-on-tags

Added Tekton definitions for docker tag builds
This commit is contained in:
Ben Wilson 2020-07-01 13:01:49 -04:00 committed by GitHub
commit 5054cec121
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 94 additions and 0 deletions

View File

@ -0,0 +1,5 @@
# Tekton CI
The configurations in this directory are for automating lightwalletd operations using Tekton.
Currently new tags will trigger a docker build and push to https://hub.docker.com/r/electriccoinco/lightwalletd

View File

@ -0,0 +1,28 @@
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: lightwalletd-tag-pipeline
spec:
resources:
- name: source
type: git
- name: cloudlog
type: cloudEvent
- name: lightwalletd-image
type: image
params:
- name: tagName
tasks:
- name: lightwalletd-build-docker-image
taskRef:
name: build-docker-image-from-git-source
resources:
inputs:
- name: docker-source
resource: source
outputs:
- name: builtImage
resource: lightwalletd-image
- name: notification
resource: cloudlog

View File

@ -0,0 +1,13 @@
---
apiVersion: triggers.tekton.dev/v1alpha1
kind: TriggerBinding
metadata:
name: lightwalletd-tag-binding
spec:
params:
- name: dockerImageName
value: electriccoinco/lightwalletd
- name: tagName
value: $(body.extensions.tag)
- name: gitRepositoryURL
value: $(body.repository.clone_url)

View File

@ -0,0 +1,48 @@
---
apiVersion: triggers.tekton.dev/v1alpha1
kind: TriggerTemplate
metadata:
name: lightwalletd-tag-pipeline-template
spec:
params:
- name: gitRepositoryURL
description: Git repo url
- name: tagName
description: Release tag name
resourcetemplates:
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
generateName: lightwalletd-tag-pipeline-
spec:
serviceAccountName: ecc-tekton
pipelineRef:
name: lightwalletd-tag-pipeline
resources:
- name: source
resourceSpec:
type: git
params:
- name: revision
value: $(params.tagName)
- name: url
value: $(params.gitRepositoryURL)
- name: refspec
value: "+refs/tags/*:refs/remotes/origin/tags/*"
- name: lightwalletd-image
resourceSpec:
type: image
params:
- name: url
value: electriccoinco/lightwalletd:$(params.tagName)
- name: cloudlog
resourceSpec:
type: cloudEvent
params:
- name: targetURI
value: http://cloudlog:8080/inbox
params:
- name: gitRepositoryURL
value: $(params.gitRepositoryURL)
- name: tagName
value: $(params.tagName)