Advertisement
PandaAcademy

Jenkinsfile_deploy_application

May 28th, 2022 (edited)
1,381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.76 KB | None | 0 0
  1. def frontendImage="pandaacademy/frontend"
  2. def backendImage="pandaacademy/backend"
  3.  
  4. pipeline {
  5.     agent {
  6.         label 'agent'
  7.     }
  8.  
  9.     parameters {
  10.         string(name: 'backendDockerTag', defaultValue: 'latest', description: 'Backend docker image tag')
  11.         string(name: 'frontendDockerTag', defaultValue: 'latest', description: 'Frontend docker image tag')
  12.     }
  13.  
  14.     stages {
  15.         stage('Deploy application') {
  16.             steps {
  17.                 script {
  18.                     withEnv(["FRONTEND_IMAGE=$frontendImage:$frontendDockerTag",
  19.                              "BACKEND_IMAGE=$backendImage:$backendDockerTag"]) {
  20.                             sh "docker-compose up -d"
  21.                     }
  22.                 }
  23.             }
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement