automated terminal push
This commit is contained in:
30
Jenkinsfile
vendored
30
Jenkinsfile
vendored
@@ -56,12 +56,15 @@ pipeline {
|
||||
// Use Docker for consistent, isolated build environment
|
||||
docker.image(env.BUILD_IMAGE).inside('-e HOME=/tmp -e PIP_CACHE_DIR=/tmp/.pip') {
|
||||
sh '''
|
||||
# Add local bin to PATH
|
||||
export PATH="/tmp/.local/bin:$PATH"
|
||||
|
||||
# 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
|
||||
pip install --user --upgrade setuptools wheel twine
|
||||
|
||||
# Build the package
|
||||
python3 setup.py sdist bdist_wheel
|
||||
@@ -99,11 +102,14 @@ pipeline {
|
||||
script {
|
||||
docker.image(env.BUILD_IMAGE).inside('-e HOME=/tmp -e PIP_CACHE_DIR=/tmp/.pip') {
|
||||
sh '''
|
||||
# Add local bin to PATH
|
||||
export PATH="/tmp/.local/bin:$PATH"
|
||||
|
||||
# Corporate standard: CodeArtifact primary, PyPI fallback
|
||||
export PIP_INDEX_URL="${CODEART_URL}"
|
||||
export PIP_EXTRA_INDEX_URL="https://pypi.org/simple/"
|
||||
|
||||
pip install safety
|
||||
pip install --user safety
|
||||
safety check --json --output safety-report.json || true
|
||||
'''
|
||||
}
|
||||
@@ -119,20 +125,24 @@ pipeline {
|
||||
script {
|
||||
docker.image(env.BUILD_IMAGE).inside('-e HOME=/tmp -e PIP_CACHE_DIR=/tmp/.pip') {
|
||||
sh '''
|
||||
# Add local bin to PATH
|
||||
export PATH="/tmp/.local/bin:$PATH"
|
||||
|
||||
# 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
|
||||
pip install -r requirements-test.txt
|
||||
pip install --user -r requirements-test.txt
|
||||
fi
|
||||
|
||||
# Install the built package for testing
|
||||
pip install dist/*.whl
|
||||
pip install --user dist/*.whl
|
||||
|
||||
# Run tests if they exist
|
||||
if [ -f pytest.ini ] || [ -d tests ]; then
|
||||
pip install --user pytest
|
||||
python -m pytest --junitxml=test-results.xml || true
|
||||
fi
|
||||
'''
|
||||
@@ -144,7 +154,7 @@ pipeline {
|
||||
// Publish test results if they exist
|
||||
script {
|
||||
if (fileExists('test-results.xml')) {
|
||||
publishTestResults testResultsPattern: 'test-results.xml'
|
||||
junit 'test-results.xml'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,6 +166,16 @@ pipeline {
|
||||
script {
|
||||
docker.image(env.BUILD_IMAGE).inside('-e HOME=/tmp') {
|
||||
sh '''
|
||||
# Add local bin to PATH
|
||||
export PATH="/tmp/.local/bin:$PATH"
|
||||
|
||||
# Corporate standard: CodeArtifact primary, PyPI fallback
|
||||
export PIP_INDEX_URL="${CODEART_URL}"
|
||||
export PIP_EXTRA_INDEX_URL="https://pypi.org/simple/"
|
||||
|
||||
# Install twine
|
||||
pip install --user twine
|
||||
|
||||
# Configure twine for CodeArtifact in /tmp
|
||||
cat > /tmp/.pypirc <<EOF
|
||||
[distutils]
|
||||
|
Reference in New Issue
Block a user