eeg_certs/backend/Jenkinsfile

45 lines
1.5 KiB
Groovy

pipeline {
agent any
stages {
stage("Clean workspace") {
cleanWs()
checkout scm
}
stage("Build backend") {
environment {
PATH = "/var/lib/jenkins/.cargo/bin:${env.PATH}"
}
steps {
sh "touch .env"
sh "echo DATABASE_URL=mysql://educa7ls_user:123456789a*@md-89.webhostbox.net:3306/educa7ls_plataforma >> .env"
sh "echo RENIEC_API=apis-token-1.aTSI1U7KEuT-6bbbCguH-4Y8TI6KS73N >> .env"
sh "cargo build --release"
}
}
stage("Prepare docker") {
steps {
dir("docker") {
sh "touch .env"
sh "echo DATABASE_URL=mysql://educa7ls_user:123456789a*@md-89.webhostbox.net:3306/educa7ls_plataforma >> .env"
sh "echo RENIEC_API=apis-token-1.aTSI1U7KEuT-6bbbCguH-4Y8TI6KS73N >> .env"
sh "echo CLASSROOM_URL=https://aulavirtual.eegsac.com >> .env"
sh "echo CLASSROOM_USER=admin >> .env"
sh '''echo CLASSROOM_PASSWORD=YVL1@N4_PaL0-93\\$ >> .env'''
sh "echo RUST_LOG=info >> .env"
}
sh "cp ./target/release/backend ./docker"
}
}
stage("Start docker") {
steps {
dir("docker") {
sh "docker compose stop"
sh "docker compose up --build"
}
}
}
}
}