46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
apiVersion: tekton.dev/v1beta1
|
|
kind: Task
|
|
metadata:
|
|
name: build-docker-image
|
|
namespace: tekton-demo
|
|
spec:
|
|
workspaces:
|
|
- name: docker-config
|
|
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)
|
|
|
|
# ✅ 디버깅 Step 추가
|
|
- name: show-docker-config
|
|
image: alpine
|
|
script: |
|
|
#!/bin/sh
|
|
echo "==== [DEBUG] Docker config 파일 존재 여부 확인 ===="
|
|
ls -al /workspace/docker-config
|
|
echo "==== [DEBUG] Docker config.json 내용 출력 ===="
|
|
cat /workspace/docker-config/config.json || echo "config.json 없음"
|
|
|
|
- name: build-and-push
|
|
image: gcr.io/kaniko-project/executor:latest
|
|
env:
|
|
- name: DOCKER_CONFIG
|
|
value: /workspace/docker-config
|
|
args:
|
|
- --dockerfile=/workspace/source/Dockerfile
|
|
- --context=/workspace/source
|
|
- --destination=$(params.image-url)
|
|
- --insecure |