Compare commits
9 Commits
59f141302f
...
main
Author | SHA1 | Date | |
---|---|---|---|
92a45d7d14 | |||
820da6acb1 | |||
b941f2dcb0 | |||
cb0ee48bd1 | |||
391d705142 | |||
4e6ad9f276 | |||
61e5636f5a | |||
77e8f2f792 | |||
3e496fa339 |
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -7,7 +7,7 @@ metadata:
|
||||
spec:
|
||||
workspaces:
|
||||
- name: docker-config
|
||||
params:
|
||||
params: # 변수 선언부
|
||||
- name: git-url
|
||||
type: string
|
||||
- name: git-revision
|
||||
|
@ -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)
|
@ -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:
|
||||
|
@ -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
15
sample-build/apply.py
Normal 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
15
sample-build/delete.py
Normal 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}")
|
Reference in New Issue
Block a user