Jenkins pipeline example
pipeline { agent any environment { FRONTEND_SRC = 'frontend/dist/*' FRONTEND_DEST = '/var/www/myapp-front' BACKEND_SRC = 'backend/target/app.jar' BACKEND_DEST = '/opt/myapp/backend' } parameters { string(name: 'FRONTEND_BRANCH' , defaultValue: 'main' , description: 'Select Frontend branch to deploy' ) string(name: 'BACKEND_BRANCH' , defaultValue: 'main' , description: 'Select Backend branch to deploy' ) choice(name: 'TARGET_MACHINE' , choices: [ 'root@192.168.0.101' , 'root@192.168.0.102' , 'root@192.168.0.103' ], description: 'Select target machine to deploy' ) } stages { stage( 'Checkout Frontend' ) { steps { dir( 'frontend' ) { git branch: params . FRONTEND_BRANCH, url: 'git@your-repo-frontend.git' ...
