This commit is contained in:
병준 박 2025-04-15 13:13:16 +00:00
parent d361e5fd7d
commit 92de2fa452
9 changed files with 28 additions and 28 deletions

View File

@ -33,7 +33,7 @@ spec:
description: Build context path (relative to workshop)
workspaces:
- name: source
- name: shared
description: Source code workspace
- name: docker-dot-credentials
description: Workspace containing config.json (as Secret)
@ -45,7 +45,7 @@ spec:
steps:
- name: prepare-docker-auth
image: alpine:3.21.3
workingDir: /workspace/source/$(params.workshop)
workingDir: /workspace/shared/$(params.workshop)
env:
- name: HOME
value: /workspace/shared/$(params.home)
@ -64,7 +64,7 @@ spec:
- name: kaniko-build
image: gcr.io/kaniko-project/executor:v1.23.2
workingDir: $(workspaces.source.path)/$(params.workshop)
workingDir: $(workspaces.shared.path)/$(params.workshop)
env:
- name: DOCKER_CONFIG
value: /tekton/home/.docker

View File

@ -24,7 +24,7 @@ spec:
description: Node.js image (e.g., node:18-slim)
workspaces:
- name: source
- name: shared
description: Git-cloned source code with Nx monorepo
results:
@ -36,7 +36,7 @@ spec:
steps:
- name: lint-and-test
image: $(params.nodejsImageName)
workingDir: /workspace/source/$(params.workshop)
workingDir: /workspace/shared/$(params.workshop)
env:
- name: HOME
value: /workspace/shared/$(params.home)

View File

@ -21,7 +21,7 @@ spec:
default: "node:slim"
description: Node.js image (e.g., node:23-slim)
workspaces:
- name: source
- name: shared
description: Git-cloned source code
results:
- name: version
@ -29,7 +29,7 @@ spec:
steps:
- name: verify-tag-version
image: $(params.nodejsImageName)
workingDir: /workspace/source/$(params.workshop)
workingDir: /workspace/shared/$(params.workshop)
env:
- name: HOME
value: /workspace/shared/$(params.home)

View File

@ -20,7 +20,7 @@ spec:
description: Python version to use
workspaces:
- name: source
- name: shared
description: Workspace containing the cloned Git repository
results:
@ -30,7 +30,7 @@ spec:
steps:
- name: build-package
image: $(params.pythonImageName)
workingDir: /workspace/source/$(params.workshop)
workingDir: /workspace/shared/$(params.workshop)
env:
- name: HOME
value: /workspace/shared/$(params.home)
@ -67,7 +67,7 @@ spec:
fi
echo "📂 Checking built artifacts..."
BUILD_PATH="/workspace/source/$(params.workshop)/dist"
BUILD_PATH="/workspace/shared/$(params.workshop)/dist"
echo -n "$BUILD_PATH" > /tekton/results/build-artifact-path
if [ -d "$BUILD_PATH" ] && [ -n "$(ls -A "$BUILD_PATH")" ]; then

View File

@ -11,7 +11,7 @@ spec:
- name: workshop
type: string
description: workshop within the repo where the source code is located
description: workshop within the repo where the shared code is located
default: ""
- name: pythonImageName
@ -36,13 +36,13 @@ spec:
description: Exit code returned by pylint (0=clean, non-zero=issues)
workspaces:
- name: source
- name: shared
description: Workspace containing the cloned Git repository
steps:
- name: run-pylint
image: $(params.pythonImageName)
workingDir: /workspace/source/$(params.workshop)
workingDir: /workspace/shared/$(params.workshop)
env:
- name: HOME
value: /workspace/shared/$(params.home)
@ -70,7 +70,7 @@ spec:
echo "🧪 Running Pylint (JSON report)..."
set +e
REPORT_FILE="/workspace/source/pylint-report.json"
REPORT_FILE="/workspace/shared/pylint-report.json"
if [ -f pyproject.toml ]; then
poetry run pylint $(params.pylint-args) --output-format=json . > "$REPORT_FILE"

View File

@ -23,13 +23,13 @@ spec:
default: https://upload.pypi.org/legacy/
workspaces:
- name: source
- name: shared
description: Workspace containing the built artifacts
steps:
- name: upload-to-pypi
image: $(params.pythonImageName)
workingDir: /workspace/source
workingDir: /workspace/shared
env:
- name: HOME
value: /workspace/shared/$(params.home)

View File

@ -20,13 +20,13 @@ spec:
default: "python:3.11-slim"
workspaces:
- name: source
- name: shared
description: Workspace containing the cloned Git repository from git-clone-checkout
steps:
- name: install-dependencies
image: $(params.pythonImageName)
workingDir: /workspace/source/$(params.workshop)
workingDir: /workspace/shared/$(params.workshop)
env:
- name: HOME
value: /workspace/shared/$(params.home)
@ -59,17 +59,17 @@ spec:
echo "🧪 Running tests..."
set +e
if [ -f pyproject.toml ]; then
poetry run pytest --verbose --junitxml=/workspace/source/pytest-results.xml
poetry run pytest --verbose --junitxml=/workspace/shared/pytest-results.xml
else
pytest --verbose --junitxml=/workspace/source/pytest-results.xml
pytest --verbose --junitxml=/workspace/shared/pytest-results.xml
fi
TEST_EXIT_CODE=$?
set -e
echo "📄 Checking test results..."
if [ -f /workspace/source/pytest-results.xml ]; then
if [ -f /workspace/shared/pytest-results.xml ]; then
echo "Test results:"
cat /workspace/source/pytest-results.xml
cat /workspace/shared/pytest-results.xml
else
echo "❌ No test results found"
exit 1

View File

@ -24,8 +24,8 @@ spec:
default: "python:3.11-slim"
workspaces:
- name: source
description: Source code workspace (includes pyproject.toml)
- name: shared
description: shared code workspace (includes pyproject.toml)
results:
- name: version
@ -34,7 +34,7 @@ spec:
steps:
- name: verify-tag
image: $(params.pythonImageName)
workingDir: /workspace/source/$(params.workshop)
workingDir: /workspace/shared/$(params.workshop)
script: |
#!/usr/bin/env bash
set -e

View File

@ -23,8 +23,8 @@ spec:
description: SonarQube project key
workspaces:
- name: source
description: Workspace with source code (e.g. from git-clone)
- name: shared
description: Workspace with shared code (e.g. from git-clone)
- name: sonar-auth
description: |
@ -33,7 +33,7 @@ spec:
steps:
- name: sonar-scan
image: sonarsource/sonar-scanner-cli:5
workingDir: /workspace/source/$(params.workshop)
workingDir: /workspace/shared/$(params.workshop)
script: |
#!/bin/sh
set -e