Compare commits

..

9 Commits

Author SHA1 Message Date
92a45d7d14 remove trigger test 2025-08-06 11:33:40 +09:00
820da6acb1 test 2025-08-05 15:06:28 +09:00
b941f2dcb0 tag test 2025-08-05 00:54:37 +09:00
cb0ee48bd1 tag test 2025-08-05 00:53:35 +09:00
391d705142 tag test 2025-08-05 00:51:04 +09:00
4e6ad9f276 tag test 2025-08-05 00:45:53 +09:00
61e5636f5a tag test 2025-08-05 00:44:05 +09:00
77e8f2f792 update 2025-08-05 00:38:45 +09:00
3e496fa339 update 2025-08-05 00:30:41 +09:00
9 changed files with 50 additions and 11 deletions

View File

@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: tekton-demo
image: harbor.icurfer.com/open/tekton-demo:0.1
image: harbor.icurfer.com/open/tekton-demo@sha256:87a0df2bc8c27c0eca46387a11f99b0d71df50d6da3ded3c45c57d0d59368c83
imagePullPolicy: Always
ports:
- containerPort: 80

View File

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tekton Demo</title>
<title>Tekton Demo-</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, sans-serif;

View File

@ -6,8 +6,8 @@ metadata:
namespace: tekton-demo
secrets:
- name: harbor-dockerconfig # Harbor 인증용 Secret
imagePullSecrets:
- name: harbor-dockerconfig # Docker 인증 정보 사용
# imagePullSecrets:
# - name: harbor-dockerconfig # Docker 인증 정보 사용
---
# Tekton 파이프라인 실행 및 리소스 접근 권한(Role)

View File

@ -7,7 +7,7 @@ metadata:
spec:
workspaces:
- name: docker-config
params:
params: # 변수 선언부
- name: git-url
type: string
- name: git-revision

View File

@ -9,4 +9,6 @@ spec:
- name: git-url
value: $(body.repository.clone_url)
- name: git-revision
value: $(body.ref)
value: $(body.head_commit.id)
- name: commit-sha
value: $(body.head_commit.id)

View File

@ -5,9 +5,10 @@ metadata:
name: docker-build-template
namespace: tekton-demo
spec:
params:
params: # 변수선언
- name: git-url
- name: git-revision
- name: commit-sha
resourcetemplates:
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
@ -17,13 +18,13 @@ spec:
serviceAccountName: tekton-build-sa
pipelineRef:
name: docker-build-pipeline
params:
params: # 변수 할당
- name: git-url
value: $(tt.params.git-url)
- name: git-revision
value: $(tt.params.git-revision)
- name: image-url
value: harbor.icurfer.com/open/tekton-demo:0.1
value: harbor.icurfer.com/open/tekton-demo:$(tt.params.commit-sha)
workspaces:
- name: docker-config
secret:

View File

@ -8,7 +8,13 @@ spec:
serviceAccountName: tekton-build-sa
triggers:
- name: gitea-trigger
interceptors:
- cel:
filter: "header.match('X-Gitea-Event', 'push')"
overlays:
- key: shortsha
expression: "body.head_commit.id.truncate(7)"
bindings:
- ref: docker-build-binding # ✅ 수정
- ref: docker-build-binding
template:
ref: docker-build-template # ✅ 수정
ref: docker-build-template

15
sample-build/apply.py Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/python3
import os
import sys
import subprocess
yaml_list = [
"02-task-build.yaml",
"05-pipeline-build.yaml",
"06-trigger-binding.yaml",
"07-trigger-template.yaml",
]
for yaml_file in yaml_list:
os.system(f"kubectl apply -f {yaml_file}")

15
sample-build/delete.py Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/python3
import os
import sys
import subprocess
yaml_list = [
"02-task-build.yaml",
"05-pipeline-build.yaml",
"06-trigger-binding.yaml",
"07-trigger-template.yaml",
]
for yaml_file in yaml_list:
os.system(f"kubectl delete -f {yaml_file}")