pipeline { agent any stages { stage ("deploy to dev ezway") { when { branch 'staging' } agent { label 'apache && dev' } steps { sh '''cd /var/www/hytha35-sottye/nextcloud/custom_apps sudo su jenkins -c "git stash && git pull origin staging" ''' } } stage ("deploy to prod dv-thanato") { when { branch 'production-dv-thanato' } agent { label 'apache && dev'} steps { input 'Do you approve deployment?' sh ''' ssh -i ${SOTTYE_DVTHANATO_SSHKEY} ${SOTTYE_DVTHANATO_SSHUSER}@${SOTTYE_DVTHANATO_IPSERVER} "cd ${SOTTYE_DVTHANATO_PATH} && git pull origin production-dv-thanato" ''' } } } }