From b77a1f7f3dfdfbf52886bd7d06a4c36e36493899 Mon Sep 17 00:00:00 2001 From: lenape Date: Sun, 29 Jun 2025 16:41:55 +0000 Subject: [PATCH] automated terminal push --- Jenkinsfile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8a362db..7febdb4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -56,8 +56,9 @@ pipeline { // Use Docker for consistent, isolated build environment docker.image(env.BUILD_IMAGE).inside('-e HOME=/tmp -e PIP_CACHE_DIR=/tmp/.pip') { sh ''' - # Configure pip to use CodeArtifact without trying to save global config + # Corporate standard: CodeArtifact primary, PyPI fallback export PIP_INDEX_URL="${CODEART_URL}" + export PIP_EXTRA_INDEX_URL="https://pypi.org/simple/" # Install build dependencies pip install --upgrade setuptools wheel twine @@ -98,7 +99,10 @@ pipeline { script { docker.image(env.BUILD_IMAGE).inside('-e HOME=/tmp -e PIP_CACHE_DIR=/tmp/.pip') { sh ''' + # Corporate standard: CodeArtifact primary, PyPI fallback export PIP_INDEX_URL="${CODEART_URL}" + export PIP_EXTRA_INDEX_URL="https://pypi.org/simple/" + pip install safety safety check --json --output safety-report.json || true ''' @@ -115,7 +119,9 @@ pipeline { script { docker.image(env.BUILD_IMAGE).inside('-e HOME=/tmp -e PIP_CACHE_DIR=/tmp/.pip') { sh ''' + # Corporate standard: CodeArtifact primary, PyPI fallback export PIP_INDEX_URL="${CODEART_URL}" + export PIP_EXTRA_INDEX_URL="https://pypi.org/simple/" # Install test dependencies if they exist if [ -f requirements-test.txt ]; then @@ -135,8 +141,12 @@ pipeline { } post { always { - // Publish test results - publishTestResults testResultsPattern: 'test-results.xml' + // Publish test results if they exist + script { + if (fileExists('test-results.xml')) { + publishTestResults testResultsPattern: 'test-results.xml' + } + } } } }