test update
This commit is contained in:
@ -6,34 +6,60 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: docker-config
|
- name: docker-config
|
||||||
|
description: Docker registry 인증 정보를 담은 secret
|
||||||
params:
|
params:
|
||||||
- name: git-url
|
- name: git-url
|
||||||
type: string
|
type: string
|
||||||
|
description: Git repository URL
|
||||||
- name: git-revision
|
- name: git-revision
|
||||||
type: string
|
type: string
|
||||||
default: "main"
|
default: "main"
|
||||||
|
description: Git branch or commit
|
||||||
- name: image-url
|
- name: image-url
|
||||||
type: string
|
type: string
|
||||||
|
# description: 최종 Docker 이미지 URL (예: harbor.icurfer.com/open/tekton-demo:latest)
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
# 1. Git Clone
|
||||||
- name: git-clone
|
- name: git-clone
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
script: |
|
script: |
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
echo "==== [INFO] Git 저장소 클론 ===="
|
||||||
git clone $(params.git-url) /workspace/source
|
git clone $(params.git-url) /workspace/source
|
||||||
cd /workspace/source
|
cd /workspace/source
|
||||||
git checkout $(params.git-revision)
|
git checkout $(params.git-revision)
|
||||||
|
echo "==== [INFO] Git checkout 완료 ===="
|
||||||
|
|
||||||
# ✅ 디버깅 Step 추가
|
# 2. Secret 파일 config.json 으로 변환
|
||||||
|
- name: prepare-docker-config
|
||||||
|
image: alpine
|
||||||
|
script: |
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
echo "==== [INFO] Docker config 파일 준비 ===="
|
||||||
|
ls -al /workspace/docker-config
|
||||||
|
if [ -f /workspace/docker-config/.dockerconfigjson ]; then
|
||||||
|
cp /workspace/docker-config/.dockerconfigjson /workspace/docker-config/config.json
|
||||||
|
echo "[INFO] config.json 파일 생성 완료"
|
||||||
|
elif [ -f /workspace/docker-config/config.json ]; then
|
||||||
|
echo "[INFO] config.json 이미 존재함"
|
||||||
|
else
|
||||||
|
echo "[ERROR] Docker config 파일(.dockerconfigjson / config.json) 없음"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3. Debugging - Secret 내용 확인
|
||||||
- name: show-docker-config
|
- name: show-docker-config
|
||||||
image: alpine
|
image: alpine
|
||||||
script: |
|
script: |
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
echo "==== [DEBUG] Docker config 파일 존재 여부 확인 ===="
|
echo "==== [DEBUG] Docker config 파일 리스트 ===="
|
||||||
ls -al /workspace/docker-config
|
ls -al /workspace/docker-config
|
||||||
echo "==== [DEBUG] Docker config.json 내용 출력 ===="
|
echo "==== [DEBUG] Docker config.json 내용 출력 ===="
|
||||||
cat /workspace/docker-config/config.json || echo "config.json 없음"
|
cat /workspace/docker-config/config.json || echo "config.json 없음"
|
||||||
|
|
||||||
|
# 4. Kaniko Build & Push
|
||||||
- name: build-and-push
|
- name: build-and-push
|
||||||
image: gcr.io/kaniko-project/executor:latest
|
image: gcr.io/kaniko-project/executor:latest
|
||||||
env:
|
env:
|
||||||
@ -43,4 +69,4 @@ spec:
|
|||||||
- --dockerfile=/workspace/source/Dockerfile
|
- --dockerfile=/workspace/source/Dockerfile
|
||||||
- --context=/workspace/source
|
- --context=/workspace/source
|
||||||
- --destination=$(params.image-url)
|
- --destination=$(params.image-url)
|
||||||
- --insecure
|
- --insecure
|
||||||
|
|||||||
Reference in New Issue
Block a user