66 lines
2.9 KiB
Groovy
66 lines
2.9 KiB
Groovy
#!/usr/bin/env groovy
|
|
|
|
pipeline {
|
|
agent none
|
|
triggers {
|
|
cron('H 2 * * *')
|
|
}
|
|
options {
|
|
disableConcurrentBuilds()
|
|
skipDefaultCheckout(true)
|
|
}
|
|
environment {
|
|
STAGING_AUDIT_PROJECT_NAME = 'mandelstudio'
|
|
STAGING_AUDIT_PROJECT_DIR = '/home/www-mandelstudio/mandelstudio'
|
|
STAGING_AUDIT_MANAGE = '/var/lib/virtualenv/mandelstudio/bin/manage.py'
|
|
}
|
|
stages {
|
|
stage('Checkout') {
|
|
agent { label 'built-in' }
|
|
steps {
|
|
withCredentials([sshUserPrivateKey(credentialsId: 'gitea-ssh', keyFileVariable: 'GIT_KEYFILE')]) {
|
|
sh '''
|
|
export GIT_SSH_COMMAND="ssh -i $GIT_KEYFILE -o StrictHostKeyChecking=accept-new"
|
|
if [ -d .git ]; then
|
|
if git remote get-url origin >/dev/null 2>&1; then
|
|
git remote set-url origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git
|
|
else
|
|
git remote add origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git
|
|
fi
|
|
git fetch --tags --force --progress origin +refs/heads/master:refs/remotes/origin/master
|
|
else
|
|
git clone ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git .
|
|
git fetch --tags --force --progress origin +refs/heads/master:refs/remotes/origin/master
|
|
fi
|
|
git checkout -f refs/remotes/origin/master
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
stage('Nightly Multilingual Audit') {
|
|
agent { label 'built-in' }
|
|
options {
|
|
timeout(time: 10, unit: 'MINUTES')
|
|
}
|
|
steps {
|
|
sh 'mkdir -p artifacts && [ -f artifacts/multilingual-audit.json ] && cp artifacts/multilingual-audit.json artifacts/previous-multilingual-audit.json || true'
|
|
sh './scripts/run_remote_multilingual_audit.sh'
|
|
script {
|
|
int status = sh(script: 'python3 scripts/multilingual_audit_ci.py --json artifacts/multilingual-audit.json --previous-json artifacts/previous-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,artifacts/previous-multilingual-audit.json', onlyIfSuccessful: false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|