pipeline { agent any stages { stage ("deploy to dev ezway") { when { branch 'staging' } agent { label 'apache && dev' } steps { sh '''cd /var/www/nextcloud/nextcloud/custom_apps sudo su jenkins -c "git stash && git pull origin staging" ''' } } } }