Compare commits
9 Commits
59f141302f
...
main
Author | SHA1 | Date | |
---|---|---|---|
92a45d7d14 | |||
820da6acb1 | |||
b941f2dcb0 | |||
cb0ee48bd1 | |||
391d705142 | |||
4e6ad9f276 | |||
61e5636f5a | |||
77e8f2f792 | |||
3e496fa339 |
@ -15,7 +15,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: tekton-demo
|
- name: tekton-demo
|
||||||
image: harbor.icurfer.com/open/tekton-demo:0.1
|
image: harbor.icurfer.com/open/tekton-demo@sha256:87a0df2bc8c27c0eca46387a11f99b0d71df50d6da3ded3c45c57d0d59368c83
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Tekton Demo</title>
|
<title>Tekton Demo-</title>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
font-family: 'Segoe UI', Tahoma, sans-serif;
|
font-family: 'Segoe UI', Tahoma, sans-serif;
|
||||||
|
@ -6,8 +6,8 @@ metadata:
|
|||||||
namespace: tekton-demo
|
namespace: tekton-demo
|
||||||
secrets:
|
secrets:
|
||||||
- name: harbor-dockerconfig # Harbor 인증용 Secret
|
- name: harbor-dockerconfig # Harbor 인증용 Secret
|
||||||
imagePullSecrets:
|
# imagePullSecrets:
|
||||||
- name: harbor-dockerconfig # Docker 인증 정보 사용
|
# - name: harbor-dockerconfig # Docker 인증 정보 사용
|
||||||
|
|
||||||
---
|
---
|
||||||
# Tekton 파이프라인 실행 및 리소스 접근 권한(Role)
|
# Tekton 파이프라인 실행 및 리소스 접근 권한(Role)
|
||||||
|
@ -7,7 +7,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: docker-config
|
- name: docker-config
|
||||||
params:
|
params: # 변수 선언부
|
||||||
- name: git-url
|
- name: git-url
|
||||||
type: string
|
type: string
|
||||||
- name: git-revision
|
- name: git-revision
|
||||||
|
@ -9,4 +9,6 @@ spec:
|
|||||||
- name: git-url
|
- name: git-url
|
||||||
value: $(body.repository.clone_url)
|
value: $(body.repository.clone_url)
|
||||||
- name: git-revision
|
- 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
|
name: docker-build-template
|
||||||
namespace: tekton-demo
|
namespace: tekton-demo
|
||||||
spec:
|
spec:
|
||||||
params:
|
params: # 변수선언
|
||||||
- name: git-url
|
- name: git-url
|
||||||
- name: git-revision
|
- name: git-revision
|
||||||
|
- name: commit-sha
|
||||||
resourcetemplates:
|
resourcetemplates:
|
||||||
- apiVersion: tekton.dev/v1beta1
|
- apiVersion: tekton.dev/v1beta1
|
||||||
kind: PipelineRun
|
kind: PipelineRun
|
||||||
@ -17,13 +18,13 @@ spec:
|
|||||||
serviceAccountName: tekton-build-sa
|
serviceAccountName: tekton-build-sa
|
||||||
pipelineRef:
|
pipelineRef:
|
||||||
name: docker-build-pipeline
|
name: docker-build-pipeline
|
||||||
params:
|
params: # 변수 할당
|
||||||
- name: git-url
|
- name: git-url
|
||||||
value: $(tt.params.git-url)
|
value: $(tt.params.git-url)
|
||||||
- name: git-revision
|
- name: git-revision
|
||||||
value: $(tt.params.git-revision)
|
value: $(tt.params.git-revision)
|
||||||
- name: image-url
|
- name: image-url
|
||||||
value: harbor.icurfer.com/open/tekton-demo:0.1
|
value: harbor.icurfer.com/open/tekton-demo:$(tt.params.commit-sha)
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: docker-config
|
- name: docker-config
|
||||||
secret:
|
secret:
|
||||||
|
@ -8,7 +8,13 @@ spec:
|
|||||||
serviceAccountName: tekton-build-sa
|
serviceAccountName: tekton-build-sa
|
||||||
triggers:
|
triggers:
|
||||||
- name: gitea-trigger
|
- name: gitea-trigger
|
||||||
|
interceptors:
|
||||||
|
- cel:
|
||||||
|
filter: "header.match('X-Gitea-Event', 'push')"
|
||||||
|
overlays:
|
||||||
|
- key: shortsha
|
||||||
|
expression: "body.head_commit.id.truncate(7)"
|
||||||
bindings:
|
bindings:
|
||||||
- ref: docker-build-binding # ✅ 수정
|
- ref: docker-build-binding
|
||||||
template:
|
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