From 1751d4a0e976f1187328edb6864362139ab783b7 Mon Sep 17 00:00:00 2001 From: Araozu Date: Sat, 4 Nov 2023 10:12:55 -0500 Subject: [PATCH] jenkins 3: return of the pipeline --- Jenkinsfile | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 13dfdfa..a5930ef 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,11 +6,12 @@ pipeline { PATH = "/var/lib/jenkins/.cargo/bin:${env.PATH}" } steps { - sh "cd ${env.WORKSPACE}/backend" - 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" + dir("backend") { + 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('Build frontend') { @@ -18,15 +19,15 @@ pipeline { PATH = "/var/lib/jenkins/.nvm/versions/node/v18.18.0/bin:${env.PATH}" } steps { - sh "cd ${env.WORKSPACE}/frontend" - sh "echo VITE_BACKEND_URL=https://system.eegsac.com >> .env.production" - sh "pnpm i" - sh "pnpm build" + dir("frontend") { + sh "echo VITE_BACKEND_URL=https://system.eegsac.com >> .env.production" + sh "pnpm i" + sh "pnpm build" + } } } stage("Create ENV file") { steps { - sh "cd ${env.WORKSPACE}" 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"