From 8cd72cd8264dd97ba094fccb8fc8c8a880d08475 Mon Sep 17 00:00:00 2001 From: BAK BYEONG JUN Date: Tue, 8 Apr 2025 18:25:41 +0000 Subject: [PATCH] bug fixed --- .devcontainer/devcontainer.json | 46 +++++------ tasks/git-clone-checkout/task.yaml | 51 ++++++------ tasks/git/task.yaml | 126 ----------------------------- tasks/poetry/task.yaml | 3 +- tasks/pypi/task.yaml | 3 +- tasks/pytest/task.yaml | 3 +- 6 files changed, 50 insertions(+), 182 deletions(-) delete mode 100644 tasks/git/task.yaml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f628b97..d88cb13 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -20,29 +20,29 @@ "path": "/bin/zsh" } }, - "yaml.schemas": { - // ⚠️ Tekton은 참고용이며 완전한 스키마 아님 (자동완성 or lint는 제한적) - "https://raw.githubusercontent.com/tektoncd/catalog/main/task/task.yaml": [ - "**/tasks/**/*.yaml" - ], - "https://raw.githubusercontent.com/tektoncd/catalog/main/pipeline/pipeline.yaml": [ - "**/pipelines/**/*.yaml" - ], - "https://json.schemastore.org/kustomization.json": [ - "**/kustomization.yaml" - ] - }, - "yaml.customTags": [ - "!Ref", - "!Sub", - "!GetAtt", - "!Join", - "!If", - "!Equals", - "!Not", - "!And", - "!Or" - ], + // "yaml.schemas": { + // // ⚠️ Tekton은 참고용이며 완전한 스키마 아님 (자동완성 or lint는 제한적) + // "https://raw.githubusercontent.com/tektoncd/catalog/main/task/task.yaml": [ + // "**/tasks/**/*.yaml" + // ], + // "https://raw.githubusercontent.com/tektoncd/catalog/main/pipeline/pipeline.yaml": [ + // "**/pipelines/**/*.yaml" + // ], + // "https://json.schemastore.org/kustomization.json": [ + // "**/kustomization.yaml" + // ] + // }, + // "yaml.customTags": [ + // "!Ref", + // "!Sub", + // "!GetAtt", + // "!Join", + // "!If", + // "!Equals", + // "!Not", + // "!And", + // "!Or" + // ], "yaml.format.enable": true, "yaml.validate": true, "editor.formatOnSave": true diff --git a/tasks/git-clone-checkout/task.yaml b/tasks/git-clone-checkout/task.yaml index d8ebbd6..213ccf8 100644 --- a/tasks/git-clone-checkout/task.yaml +++ b/tasks/git-clone-checkout/task.yaml @@ -1,5 +1,3 @@ ---- - apiVersion: tekton.dev/v1 kind: Task metadata: @@ -78,30 +76,30 @@ spec: - name: clone-checkout image: "$(params.gitInitImage)" env: - - name: HOME - value: "$(params.userHome)" - - name: PARAM_URL - value: $(params.repo-url) - - name: PARAM_REVISION - value: $(params.revision) - - name: PARAM_VERBOSE - value: $(params.verbose) - - name: PARAM_USER_HOME - value: $(params.userHome) - - name: WORKSPACE_OUTPUT_PATH - value: $(workspaces.output.path) - - name: WORKSPACE_SSH_DIRECTORY_BOUND - value: $(workspaces.ssh-directory.bound) - - name: WORKSPACE_SSH_DIRECTORY_PATH - value: $(workspaces.ssh-directory.path) - - name: WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND - value: $(workspaces.basic-auth.bound) - - name: WORKSPACE_BASIC_AUTH_DIRECTORY_PATH - value: $(workspaces.basic-auth.path) - - name: WORKSPACE_SSL_CA_DIRECTORY_BOUND - value: $(workspaces.ssl-ca-directory.bound) - - name: WORKSPACE_SSL_CA_DIRECTORY_PATH - value: $(workspaces.ssl-ca-directory.path) + - name: HOME + value: "$(params.userHome)" + - name: PARAM_URL + value: $(params.repo-url) + - name: PARAM_REVISION + value: $(params.revision) + - name: PARAM_VERBOSE + value: $(params.verbose) + - name: PARAM_USER_HOME + value: $(params.userHome) + - name: WORKSPACE_OUTPUT_PATH + value: $(workspaces.output.path) + - name: WORKSPACE_SSH_DIRECTORY_BOUND + value: $(workspaces.ssh-directory.bound) + - name: WORKSPACE_SSH_DIRECTORY_PATH + value: $(workspaces.ssh-directory.path) + - name: WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND + value: $(workspaces.basic-auth.bound) + - name: WORKSPACE_BASIC_AUTH_DIRECTORY_PATH + value: $(workspaces.basic-auth.path) + - name: WORKSPACE_SSL_CA_DIRECTORY_BOUND + value: $(workspaces.ssl-ca-directory.bound) + - name: WORKSPACE_SSL_CA_DIRECTORY_PATH + value: $(workspaces.ssl-ca-directory.path) script: | #!/usr/bin/env sh set -eu @@ -145,4 +143,3 @@ spec: printf "%s" "${RESULT_COMMITTER_DATE}" > "$(results.committer-date.path)" printf "%s" "${RESULT_SHA}" > "$(results.commit.path)" printf "%s" "${PARAM_URL}" > "$(results.url.path)" - diff --git a/tasks/git/task.yaml b/tasks/git/task.yaml deleted file mode 100644 index 964f821..0000000 --- a/tasks/git/task.yaml +++ /dev/null @@ -1,126 +0,0 @@ ---- -apiVersion: tekton.dev/v1beta1 -kind: Task -metadata: - name: git - labels: - app.kubernetes.io/version: "0.4" - annotations: - tekton.dev/pipelines.minVersion: "0.21.0" - tekton.dev/categories: Git - tekton.dev/tags: git - tekton.dev/displayName: "git" - tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le" -spec: - description: >- - This task can be used to perform git operations. - - Git command that needs to be run can be passed as a script to - the task. This task needs authentication to git in order to push - after the git operation. - - workspaces: - - name: source - description: A workspace that contains the fetched git repository. - - - name: input - optional: true - description: | - An optional workspace that contains the files that need to be added to git. You can - access the workspace from your script using `$(workspaces.input.path)`, for instance: - - cp $(workspaces.input.path)/file_that_i_want . - git add file_that_i_want - # etc - - - name: ssh-directory - optional: true - description: | - A .ssh directory with private key, known_hosts, config, etc. Copied to - the user's home before git commands are executed. Used to authenticate - with the git remote when performing the clone. Binding a Secret to this - Workspace is strongly recommended over other volume types. - - - name: basic-auth - optional: true - description: | - A Workspace containing a .gitconfig and .git-credentials file. These - will be copied to the user's home before any git commands are run. Any - other files in this Workspace are ignored. It is strongly recommended - to use ssh-directory over basic-auth whenever possible and to bind a - Secret to this Workspace over other volume types. - params: - - name: BASE_IMAGE - description: | - The base image for the task. - type: string - default: alpine/git:2.47.2 - - - name: GIT_USER_NAME - type: string - description: | - Git user name for performing git operation. - default: "" - - - name: GIT_USER_EMAIL - type: string - description: | - Git user email for performing git operation. - default: "" - - - name: GIT_SCRIPT - description: The git script to run. - type: string - default: | - git help - - - name: USER_HOME - description: | - Absolute path to the user's home directory. Set this explicitly if you are running the image as a non-root user or have overridden - the gitInitImage param with an image containing custom user configuration. - type: string - default: "/root" - - - name: VERBOSE - description: Log the commands that are executed during `git-clone`'s operation. - type: string - default: "true" - - results: - - name: commit - description: The precise commit SHA after the git operation. - - steps: - - name: git - image: $(params.BASE_IMAGE) - workingDir: $(workspaces.source.path) - script: | - #!/usr/bin/env sh - set -eu - - if [ "$(params.VERBOSE)" = "true" ]; then - set -x - fi - - if [ -f "$(workspaces.basic-auth.path)/.git-credentials" ]; then - cp "$(workspaces.basic-auth.path)/.git-credentials" "$(params.USER_HOME)/.git-credentials" - cp "$(workspaces.basic-auth.path)/.gitconfig" "$(params.USER_HOME)/.gitconfig" - chmod 400 "$(params.USER_HOME)/.git-credentials" - chmod 400 "$(params.USER_HOME)/.gitconfig" - fi - - if [ -n "$(workspaces.ssh-directory.path)" ] && [ -d "$(workspaces.ssh-directory.path)" ]; then - cp -R "$(workspaces.ssh-directory.path)" "$(params.USER_HOME)/.ssh" - chmod 700 "$(params.USER_HOME)/.ssh" - chmod -R 400 "$(params.USER_HOME)/.ssh/*" - fi - - if [ -n "$(params.GIT_USER_NAME)" ] && [ -n "$(params.GIT_USER_EMAIL)" ]; then - git config --global user.name "$(params.GIT_USER_NAME)" - git config --global user.email "$(params.GIT_USER_EMAIL)" - fi - - eval '$(params.GIT_SCRIPT)' - - RESULT_SHA="$(git rev-parse HEAD | tr -d '\n')" - printf "%s" "$RESULT_SHA" > "$(results.commit.path)" \ No newline at end of file diff --git a/tasks/poetry/task.yaml b/tasks/poetry/task.yaml index 93021f7..6a13091 100644 --- a/tasks/poetry/task.yaml +++ b/tasks/poetry/task.yaml @@ -1,5 +1,4 @@ ---- -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: Task metadata: name: poetry diff --git a/tasks/pypi/task.yaml b/tasks/pypi/task.yaml index fbc0629..c3ca4b8 100644 --- a/tasks/pypi/task.yaml +++ b/tasks/pypi/task.yaml @@ -1,5 +1,4 @@ ---- -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: Task metadata: name: pypi diff --git a/tasks/pytest/task.yaml b/tasks/pytest/task.yaml index 70f7614..60f23da 100644 --- a/tasks/pytest/task.yaml +++ b/tasks/pytest/task.yaml @@ -1,5 +1,4 @@ ---- -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: Task metadata: name: pytest