jenkins 3: return of the pipeline

This commit is contained in:
Araozu 2023-11-04 10:12:55 -05:00
parent 40bcb85f83
commit 1751d4a0e9

7
Jenkinsfile vendored
View File

@ -6,27 +6,28 @@ pipeline {
PATH = "/var/lib/jenkins/.cargo/bin:${env.PATH}" PATH = "/var/lib/jenkins/.cargo/bin:${env.PATH}"
} }
steps { steps {
sh "cd ${env.WORKSPACE}/backend" dir("backend") {
sh "touch .env" sh "touch .env"
sh "echo DATABASE_URL=mysql://educa7ls_user:123456789a*@md-89.webhostbox.net:3306/educa7ls_plataforma >> .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 RENIEC_API=apis-token-1.aTSI1U7KEuT-6bbbCguH-4Y8TI6KS73N >> .env"
sh "cargo build --release" sh "cargo build --release"
} }
} }
}
stage('Build frontend') { stage('Build frontend') {
environment { environment {
PATH = "/var/lib/jenkins/.nvm/versions/node/v18.18.0/bin:${env.PATH}" PATH = "/var/lib/jenkins/.nvm/versions/node/v18.18.0/bin:${env.PATH}"
} }
steps { steps {
sh "cd ${env.WORKSPACE}/frontend" dir("frontend") {
sh "echo VITE_BACKEND_URL=https://system.eegsac.com >> .env.production" sh "echo VITE_BACKEND_URL=https://system.eegsac.com >> .env.production"
sh "pnpm i" sh "pnpm i"
sh "pnpm build" sh "pnpm build"
} }
} }
}
stage("Create ENV file") { stage("Create ENV file") {
steps { steps {
sh "cd ${env.WORKSPACE}"
sh "touch .env" sh "touch .env"
sh "echo DATABASE_URL=mysql://educa7ls_user:123456789a*@md-89.webhostbox.net:3306/educa7ls_plataforma >> .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 RENIEC_API=apis-token-1.aTSI1U7KEuT-6bbbCguH-4Y8TI6KS73N >> .env"