Add multilingual audit CI pipeline + extract mandelblog_content_guard
This commit is contained in:
44
Jenkinsfile
vendored
44
Jenkinsfile
vendored
@@ -9,6 +9,10 @@ pipeline {
|
||||
environment {
|
||||
PYENVPIPELINE_VIRTUALENV = '1'
|
||||
GIT_SSH_COMMAND = 'ssh -o StrictHostKeyChecking=accept-new'
|
||||
STAGING_AUDIT_HOST = 'root@49.12.204.96'
|
||||
STAGING_AUDIT_PROJECT_DIR = '/home/www-mandelstudio/mandelstudio'
|
||||
STAGING_AUDIT_MANAGE = '/var/lib/virtualenv/mandelstudio/bin/manage.py'
|
||||
STAGING_AUDIT_SSH_CREDENTIALS_ID = 'staging-root-ssh'
|
||||
}
|
||||
|
||||
stages {
|
||||
@@ -74,7 +78,7 @@ pipeline {
|
||||
steps {
|
||||
sh '''
|
||||
. .venv/bin/activate
|
||||
python -m compileall -q setup.py mandelstudio
|
||||
python -m compileall -q setup.py mandelstudio mandelblog_content_guard
|
||||
'''
|
||||
}
|
||||
post {
|
||||
@@ -86,6 +90,40 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Deploy Staging') {
|
||||
steps {
|
||||
echo 'Triggering staging deploy for mandelstudio after successful CI build.'
|
||||
build job: 'deploy-project-stg',
|
||||
wait: true,
|
||||
propagate: true,
|
||||
parameters: [string(name: 'PROJECT_NAME', value: 'mandelstudio')]
|
||||
}
|
||||
}
|
||||
stage('Post-Deploy Multilingual Audit') {
|
||||
options {
|
||||
timeout(time: 10, unit: 'MINUTES')
|
||||
}
|
||||
steps {
|
||||
sh 'mkdir -p artifacts'
|
||||
withCredentials([sshUserPrivateKey(credentialsId: env.STAGING_AUDIT_SSH_CREDENTIALS_ID, keyFileVariable: 'STAGING_SSH_KEYFILE')]) {
|
||||
sh './scripts/run_remote_multilingual_audit.sh'
|
||||
}
|
||||
script {
|
||||
int status = sh(script: 'python3 scripts/multilingual_audit_ci.py --json artifacts/multilingual-audit.json', returnStatus: true)
|
||||
if (status == 2) {
|
||||
error('Block-level multilingual issues detected or audit execution failed.')
|
||||
}
|
||||
if (status == 1) {
|
||||
unstable('Warn-level multilingual issues detected.')
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
archiveArtifacts artifacts: 'artifacts/multilingual-audit.json', onlyIfSuccessful: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
@@ -97,10 +135,6 @@ pipeline {
|
||||
. .venv/bin/activate
|
||||
pip install coverage
|
||||
'''
|
||||
echo 'Triggering staging deploy for mandelstudio after successful CI build.'
|
||||
build job: 'deploy-project-stg',
|
||||
wait: false,
|
||||
parameters: [string(name: 'PROJECT_NAME', value: 'mandelstudio')]
|
||||
}
|
||||
failure {
|
||||
emailext subject: "JENKINS-NOTIFICATION: ${currentBuild.currentResult}: Job '${env.JOB_NAME} #${env.BUILD_NUMBER}'",
|
||||
|
||||
Reference in New Issue
Block a user