Joplin/Jenkinsfile
Adam Outler 021f6de0bd
Some checks failed
Updates/Joplin/pipeline/head There was a failure building this commit
Update Jenkinsfile
2025-04-02 23:06:19 +00:00

30 lines
1.2 KiB
Groovy

pipeline {
agent { label 'Wrangler1' }
environment {
PROJECT_NAME = 'joplin'
}
stages {
stage('Pull Docker Images') {
steps {
sh 'docker compose pull'
}
}
stage('Deploy') {
steps {
withCredentials([usernamePassword(credentialsId: 'google-email-apps-password', passwordVariable: 'GMAIL_APP_PASSWORD', usernameVariable: 'GMAIL_EMAIL'), usernamePassword(credentialsId: 'ldap-bind-auth-user', passwordVariable: 'BINDPASS', usernameVariable: 'BINDUSER')]) {
sh """
export PG_PASS=\$(openssl rand -base64 48 | tr -dc 'A-Za-z0-9' | head -c32)
BINDUSER=${BINDUSER} \
BINDPASS=${BINDPASS} \
GMAIL_EMAIL=${GMAIL_EMAIL} \
GMAIL_APP_PASSWORD="${GMAIL_APP_PASSWORD}" \
COMPOSE_PROJECT_NAME=${PROJECT_NAME} \
docker compose up -d --force-recreate
echo "ALTER USER joplin WITH PASSWORD '\$PG_PASS';" | docker exec -i postgres psql -U postgres -d postgres
"""
}
}
}
}
}