init
This commit is contained in:
parent
d361e5fd7d
commit
92de2fa452
@ -33,7 +33,7 @@ spec:
|
|||||||
description: Build context path (relative to workshop)
|
description: Build context path (relative to workshop)
|
||||||
|
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: shared
|
||||||
description: Source code workspace
|
description: Source code workspace
|
||||||
- name: docker-dot-credentials
|
- name: docker-dot-credentials
|
||||||
description: Workspace containing config.json (as Secret)
|
description: Workspace containing config.json (as Secret)
|
||||||
@ -45,7 +45,7 @@ spec:
|
|||||||
steps:
|
steps:
|
||||||
- name: prepare-docker-auth
|
- name: prepare-docker-auth
|
||||||
image: alpine:3.21.3
|
image: alpine:3.21.3
|
||||||
workingDir: /workspace/source/$(params.workshop)
|
workingDir: /workspace/shared/$(params.workshop)
|
||||||
env:
|
env:
|
||||||
- name: HOME
|
- name: HOME
|
||||||
value: /workspace/shared/$(params.home)
|
value: /workspace/shared/$(params.home)
|
||||||
@ -64,7 +64,7 @@ spec:
|
|||||||
|
|
||||||
- name: kaniko-build
|
- name: kaniko-build
|
||||||
image: gcr.io/kaniko-project/executor:v1.23.2
|
image: gcr.io/kaniko-project/executor:v1.23.2
|
||||||
workingDir: $(workspaces.source.path)/$(params.workshop)
|
workingDir: $(workspaces.shared.path)/$(params.workshop)
|
||||||
env:
|
env:
|
||||||
- name: DOCKER_CONFIG
|
- name: DOCKER_CONFIG
|
||||||
value: /tekton/home/.docker
|
value: /tekton/home/.docker
|
||||||
|
@ -24,7 +24,7 @@ spec:
|
|||||||
description: Node.js image (e.g., node:18-slim)
|
description: Node.js image (e.g., node:18-slim)
|
||||||
|
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: shared
|
||||||
description: Git-cloned source code with Nx monorepo
|
description: Git-cloned source code with Nx monorepo
|
||||||
|
|
||||||
results:
|
results:
|
||||||
@ -36,7 +36,7 @@ spec:
|
|||||||
steps:
|
steps:
|
||||||
- name: lint-and-test
|
- name: lint-and-test
|
||||||
image: $(params.nodejsImageName)
|
image: $(params.nodejsImageName)
|
||||||
workingDir: /workspace/source/$(params.workshop)
|
workingDir: /workspace/shared/$(params.workshop)
|
||||||
env:
|
env:
|
||||||
- name: HOME
|
- name: HOME
|
||||||
value: /workspace/shared/$(params.home)
|
value: /workspace/shared/$(params.home)
|
||||||
|
@ -21,7 +21,7 @@ spec:
|
|||||||
default: "node:slim"
|
default: "node:slim"
|
||||||
description: Node.js image (e.g., node:23-slim)
|
description: Node.js image (e.g., node:23-slim)
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: shared
|
||||||
description: Git-cloned source code
|
description: Git-cloned source code
|
||||||
results:
|
results:
|
||||||
- name: version
|
- name: version
|
||||||
@ -29,7 +29,7 @@ spec:
|
|||||||
steps:
|
steps:
|
||||||
- name: verify-tag-version
|
- name: verify-tag-version
|
||||||
image: $(params.nodejsImageName)
|
image: $(params.nodejsImageName)
|
||||||
workingDir: /workspace/source/$(params.workshop)
|
workingDir: /workspace/shared/$(params.workshop)
|
||||||
env:
|
env:
|
||||||
- name: HOME
|
- name: HOME
|
||||||
value: /workspace/shared/$(params.home)
|
value: /workspace/shared/$(params.home)
|
||||||
|
@ -20,7 +20,7 @@ spec:
|
|||||||
description: Python version to use
|
description: Python version to use
|
||||||
|
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: shared
|
||||||
description: Workspace containing the cloned Git repository
|
description: Workspace containing the cloned Git repository
|
||||||
|
|
||||||
results:
|
results:
|
||||||
@ -30,7 +30,7 @@ spec:
|
|||||||
steps:
|
steps:
|
||||||
- name: build-package
|
- name: build-package
|
||||||
image: $(params.pythonImageName)
|
image: $(params.pythonImageName)
|
||||||
workingDir: /workspace/source/$(params.workshop)
|
workingDir: /workspace/shared/$(params.workshop)
|
||||||
env:
|
env:
|
||||||
- name: HOME
|
- name: HOME
|
||||||
value: /workspace/shared/$(params.home)
|
value: /workspace/shared/$(params.home)
|
||||||
@ -67,7 +67,7 @@ spec:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "📂 Checking built artifacts..."
|
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
|
echo -n "$BUILD_PATH" > /tekton/results/build-artifact-path
|
||||||
|
|
||||||
if [ -d "$BUILD_PATH" ] && [ -n "$(ls -A "$BUILD_PATH")" ]; then
|
if [ -d "$BUILD_PATH" ] && [ -n "$(ls -A "$BUILD_PATH")" ]; then
|
||||||
|
@ -11,7 +11,7 @@ spec:
|
|||||||
|
|
||||||
- name: workshop
|
- name: workshop
|
||||||
type: string
|
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: ""
|
default: ""
|
||||||
|
|
||||||
- name: pythonImageName
|
- name: pythonImageName
|
||||||
@ -36,13 +36,13 @@ spec:
|
|||||||
description: Exit code returned by pylint (0=clean, non-zero=issues)
|
description: Exit code returned by pylint (0=clean, non-zero=issues)
|
||||||
|
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: shared
|
||||||
description: Workspace containing the cloned Git repository
|
description: Workspace containing the cloned Git repository
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: run-pylint
|
- name: run-pylint
|
||||||
image: $(params.pythonImageName)
|
image: $(params.pythonImageName)
|
||||||
workingDir: /workspace/source/$(params.workshop)
|
workingDir: /workspace/shared/$(params.workshop)
|
||||||
env:
|
env:
|
||||||
- name: HOME
|
- name: HOME
|
||||||
value: /workspace/shared/$(params.home)
|
value: /workspace/shared/$(params.home)
|
||||||
@ -70,7 +70,7 @@ spec:
|
|||||||
|
|
||||||
echo "🧪 Running Pylint (JSON report)..."
|
echo "🧪 Running Pylint (JSON report)..."
|
||||||
set +e
|
set +e
|
||||||
REPORT_FILE="/workspace/source/pylint-report.json"
|
REPORT_FILE="/workspace/shared/pylint-report.json"
|
||||||
|
|
||||||
if [ -f pyproject.toml ]; then
|
if [ -f pyproject.toml ]; then
|
||||||
poetry run pylint $(params.pylint-args) --output-format=json . > "$REPORT_FILE"
|
poetry run pylint $(params.pylint-args) --output-format=json . > "$REPORT_FILE"
|
||||||
|
@ -23,13 +23,13 @@ spec:
|
|||||||
default: https://upload.pypi.org/legacy/
|
default: https://upload.pypi.org/legacy/
|
||||||
|
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: shared
|
||||||
description: Workspace containing the built artifacts
|
description: Workspace containing the built artifacts
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: upload-to-pypi
|
- name: upload-to-pypi
|
||||||
image: $(params.pythonImageName)
|
image: $(params.pythonImageName)
|
||||||
workingDir: /workspace/source
|
workingDir: /workspace/shared
|
||||||
env:
|
env:
|
||||||
- name: HOME
|
- name: HOME
|
||||||
value: /workspace/shared/$(params.home)
|
value: /workspace/shared/$(params.home)
|
||||||
|
@ -20,13 +20,13 @@ spec:
|
|||||||
default: "python:3.11-slim"
|
default: "python:3.11-slim"
|
||||||
|
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: shared
|
||||||
description: Workspace containing the cloned Git repository from git-clone-checkout
|
description: Workspace containing the cloned Git repository from git-clone-checkout
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: install-dependencies
|
- name: install-dependencies
|
||||||
image: $(params.pythonImageName)
|
image: $(params.pythonImageName)
|
||||||
workingDir: /workspace/source/$(params.workshop)
|
workingDir: /workspace/shared/$(params.workshop)
|
||||||
env:
|
env:
|
||||||
- name: HOME
|
- name: HOME
|
||||||
value: /workspace/shared/$(params.home)
|
value: /workspace/shared/$(params.home)
|
||||||
@ -59,17 +59,17 @@ spec:
|
|||||||
echo "🧪 Running tests..."
|
echo "🧪 Running tests..."
|
||||||
set +e
|
set +e
|
||||||
if [ -f pyproject.toml ]; then
|
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
|
else
|
||||||
pytest --verbose --junitxml=/workspace/source/pytest-results.xml
|
pytest --verbose --junitxml=/workspace/shared/pytest-results.xml
|
||||||
fi
|
fi
|
||||||
TEST_EXIT_CODE=$?
|
TEST_EXIT_CODE=$?
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "📄 Checking test results..."
|
echo "📄 Checking test results..."
|
||||||
if [ -f /workspace/source/pytest-results.xml ]; then
|
if [ -f /workspace/shared/pytest-results.xml ]; then
|
||||||
echo "Test results:"
|
echo "Test results:"
|
||||||
cat /workspace/source/pytest-results.xml
|
cat /workspace/shared/pytest-results.xml
|
||||||
else
|
else
|
||||||
echo "❌ No test results found"
|
echo "❌ No test results found"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -24,8 +24,8 @@ spec:
|
|||||||
default: "python:3.11-slim"
|
default: "python:3.11-slim"
|
||||||
|
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: shared
|
||||||
description: Source code workspace (includes pyproject.toml)
|
description: shared code workspace (includes pyproject.toml)
|
||||||
|
|
||||||
results:
|
results:
|
||||||
- name: version
|
- name: version
|
||||||
@ -34,7 +34,7 @@ spec:
|
|||||||
steps:
|
steps:
|
||||||
- name: verify-tag
|
- name: verify-tag
|
||||||
image: $(params.pythonImageName)
|
image: $(params.pythonImageName)
|
||||||
workingDir: /workspace/source/$(params.workshop)
|
workingDir: /workspace/shared/$(params.workshop)
|
||||||
script: |
|
script: |
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
@ -23,8 +23,8 @@ spec:
|
|||||||
description: SonarQube project key
|
description: SonarQube project key
|
||||||
|
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: shared
|
||||||
description: Workspace with source code (e.g. from git-clone)
|
description: Workspace with shared code (e.g. from git-clone)
|
||||||
|
|
||||||
- name: sonar-auth
|
- name: sonar-auth
|
||||||
description: |
|
description: |
|
||||||
@ -33,7 +33,7 @@ spec:
|
|||||||
steps:
|
steps:
|
||||||
- name: sonar-scan
|
- name: sonar-scan
|
||||||
image: sonarsource/sonar-scanner-cli:5
|
image: sonarsource/sonar-scanner-cli:5
|
||||||
workingDir: /workspace/source/$(params.workshop)
|
workingDir: /workspace/shared/$(params.workshop)
|
||||||
script: |
|
script: |
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
Loading…
x
Reference in New Issue
Block a user