34 lines
865 B
YAML
34 lines
865 B
YAML
# 02-task-build.yaml
|
|
apiVersion: tekton.dev/v1beta1
|
|
kind: Task
|
|
metadata:
|
|
name: build-docker-image
|
|
namespace: tekton-demo
|
|
spec:
|
|
params:
|
|
- name: git-url
|
|
type: string
|
|
- name: git-revision
|
|
type: string
|
|
default: "main"
|
|
- name: image-url
|
|
type: string
|
|
steps:
|
|
- name: git-clone
|
|
image: alpine/git
|
|
script: |
|
|
#!/bin/sh
|
|
set -e
|
|
git clone $(params.git-url) /workspace/source
|
|
cd /workspace/source
|
|
git checkout $(params.git-revision)
|
|
- name: build-and-push
|
|
image: gcr.io/kaniko-project/executor:latest
|
|
env:
|
|
- name: DOCKER_CONFIG
|
|
value: /tekton/home/.docker/
|
|
args:
|
|
- --dockerfile=/workspace/source/Dockerfile
|
|
- --context=/workspace/source
|
|
- --destination=harbor.icurfer.com/open/tekton-demo:latest
|
|
- --insecure |