54 lines
1.1 KiB
Plaintext
54 lines
1.1 KiB
Plaintext
|
|
pipeline {
|
||
|
|
agent {
|
||
|
|
kubernetes {
|
||
|
|
defaultContainer 'python'
|
||
|
|
yaml """
|
||
|
|
apiVersion: v1
|
||
|
|
kind: Pod
|
||
|
|
spec:
|
||
|
|
containers:
|
||
|
|
- name: python
|
||
|
|
image: python:3.12-slim
|
||
|
|
command:
|
||
|
|
- cat
|
||
|
|
tty: true
|
||
|
|
"""
|
||
|
|
}
|
||
|
|
}
|
||
|
|
environment {
|
||
|
|
PIP_DISABLE_PIP_VERSION_CHECK = '1'
|
||
|
|
PYTHONUNBUFFERED = '1'
|
||
|
|
DEPLOY_BRANCH = 'deploy'
|
||
|
|
}
|
||
|
|
stages {
|
||
|
|
stage('Checkout') {
|
||
|
|
steps {
|
||
|
|
checkout scm
|
||
|
|
}
|
||
|
|
}
|
||
|
|
stage('Install deps') {
|
||
|
|
steps {
|
||
|
|
sh 'pip install --no-cache-dir -r ci/requirements.txt'
|
||
|
|
}
|
||
|
|
}
|
||
|
|
stage('Glue tests') {
|
||
|
|
steps {
|
||
|
|
sh 'pytest -q ci/tests/glue'
|
||
|
|
}
|
||
|
|
}
|
||
|
|
stage('Promote') {
|
||
|
|
steps {
|
||
|
|
withCredentials([usernamePassword(credentialsId: 'gitea-pat', usernameVariable: 'GIT_USER', passwordVariable: 'GIT_TOKEN')]) {
|
||
|
|
sh '''
|
||
|
|
set +x
|
||
|
|
git config user.email "jenkins@bstein.dev"
|
||
|
|
git config user.name "jenkins"
|
||
|
|
git remote set-url origin https://${GIT_USER}:${GIT_TOKEN}@scm.bstein.dev/bstein/titan-iac.git
|
||
|
|
git push origin HEAD:${DEPLOY_BRANCH}
|
||
|
|
'''
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|