From b927a34a11e528c201c00ac136ef49ecda933a2a Mon Sep 17 00:00:00 2001 From: BAK BYEONG JUN Date: Tue, 15 Apr 2025 12:56:01 +0000 Subject: [PATCH] init --- tasks/pyversion/task.yaml | 15 ++++++++------- tasks/secret-home/task.yaml | 7 ++++++- tasks/sonarqube-analysis/taks.yaml | 14 +++++++------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/tasks/pyversion/task.yaml b/tasks/pyversion/task.yaml index fb5aa2a..7c987f4 100644 --- a/tasks/pyversion/task.yaml +++ b/tasks/pyversion/task.yaml @@ -4,9 +4,14 @@ metadata: name: pyversion spec: params: - - name: subdirectory + - name: home type: string - description: Subdirectory within the repo where the source code is located + description: home directory + default: "" + + - name: workshop + type: string + description: workshop within the repo where the source code is located default: "" - name: ref @@ -29,15 +34,11 @@ spec: steps: - name: verify-tag image: $(params.pythonImageName) - workingDir: /workspace/source + workingDir: /workspace/source/$(params.workshop) script: | #!/usr/bin/env bash set -e - if [ -n "$(params.subdirectory)" ]; then - cd "$(params.subdirectory)" - fi - echo "🔍 Extracting tag from Git ref..." FULL_REF="$(params.ref)" TAG_FROM_REF=$(basename "$FULL_REF") # → v0.2.0 diff --git a/tasks/secret-home/task.yaml b/tasks/secret-home/task.yaml index 0f770de..e776d9c 100644 --- a/tasks/secret-home/task.yaml +++ b/tasks/secret-home/task.yaml @@ -9,6 +9,11 @@ spec: description: home directory default: "" + - name: workshop + type: string + description: workshop directory + default: "" + - name: keys type: string description: | @@ -23,7 +28,7 @@ spec: steps: - name: extract image: python:3.11-slim - workingDir: /workspace/shared/$(params.subdirectory) + workingDir: /workspace/shared/$(params.workshop) env: - name: HOME value: /workspace/shared/$(params.home) diff --git a/tasks/sonarqube-analysis/taks.yaml b/tasks/sonarqube-analysis/taks.yaml index 548936a..dfb8f0b 100644 --- a/tasks/sonarqube-analysis/taks.yaml +++ b/tasks/sonarqube-analysis/taks.yaml @@ -4,10 +4,14 @@ metadata: name: sonarqube-analysis spec: params: - - name: subdirectory + - name: home type: string default: "" - description: Subdirectory within workspace containing the source (if any) + description: home directory + - name: workshop + type: string + default: "" + description: workshop within workspace containing the source (if any) - name: sonarHostUrl type: string @@ -29,15 +33,11 @@ spec: steps: - name: sonar-scan image: sonarsource/sonar-scanner-cli:5 - workingDir: /workspace/source + workingDir: /workspace/source/$(params.workshop) script: | #!/bin/sh set -e - if [ -n "$(params.subdirectory)" ]; then - cd "$(params.subdirectory)" - fi - SONAR_TOKEN=$(cat /workspace/sonar-auth/token) echo "📡 Running SonarQube analysis on project $(params.projectKey)..."