Preview: Jenkinsfile
Size: 1.27 KB
/var/www/multi-event-cfp.bitkit.dk/httpdocs/Jenkinsfile
pipeline {
agent any
environment {
staging_server = "65.109.239.45"
ssh_port = "6171"
}
stages {
stage('Declarative: Checkout SCM') {
steps {
checkout scm
}
}
stage('Deploy to Remote') {
steps {
sh '''
rsync -avz -e "ssh -p ${ssh_port} -v" --exclude=.git --exclude=Jenkinsfile ${WORKSPACE}/ root@${staging_server}:/var/www/multi-event-cfp.bitkit.dk/httpdocs
'''
}
}
stage('composer install & npm build and more') {
steps {
sh '''
ssh -p ${ssh_port} root@${staging_server} "find /var/www/multi-event-cfp.bitkit.dk/httpdocs -cmin -10 \
! -path /var/www/bwh.wpress.dk/httpdocs/.git \
! -path /var/www/bwh.wpress.dk/httpdocs/kirn.php \
-exec chown -R w-multi-event-cfp:w-multi-event-cfp {} +"
'''
sh "ssh -p ${ssh_port} -v root@${staging_server} 'cd /var/www/multi-event-cfp.bitkit.dk/httpdocs'"
sh "ssh -p ${ssh_port} root@${staging_server} 'cd /var/www/multi-event-cfp.bitkit.dk/httpdocs && npm run production'"
}
}
}
}
Directory Contents
Dirs: 12 × Files: 19