selene-ui/Jenkinsfile

84 lines
3.5 KiB
Plaintext
Raw Normal View History

2019-01-24 21:57:33 +00:00
pipeline {
agent any
stages {
2019-03-02 18:06:20 +00:00
2019-03-02 18:24:17 +00:00
// Deploy to the Test environment
2019-03-02 18:06:20 +00:00
stage('Build for Test Environment') {
when {
branch 'test'
}
2019-01-24 21:57:33 +00:00
steps {
2019-03-02 18:06:20 +00:00
echo 'Building code in the "test" branch...'
sh 'npm install'
sh 'ng build --project shared'
sh 'ng build --project globalnav'
sh 'ng build --project page-not-found'
sh 'ng build --project account --configuration test'
2019-03-02 18:06:20 +00:00
sh 'ng build --project sso --configuration test'
}
}
stage('Deploy to Test Environment') {
when {
branch 'test'
}
steps {
echo 'Deploying to test environment web servers...'
withCredentials([sshUserPrivateKey(credentialsId: '6413826d-79f6-4d03-9902-ee1b73a96efd', keyFileVariable: 'JENKINS_SSH_KEY', passphraseVariable: '', usernameVariable: 'SERVER_USER')]) {
# Deploy account application and its associated libraries
sh 'scp -r dist/shared root@192.81.211.55:/var/www/'
sh 'scp -r dist/globalnav root@192.81.211.55:/var/www/'
sh 'scp -r dist/page-not-found root@192.81.211.55:/var/www/'
sh 'scp -r dist/account root@192.81.211.55:/var/www/'
# Deploy single sign on application and its associated libraries
sh 'scp -r dist/shared root@198.199.90.118:/var/www/'
sh 'scp -r dist/globalnav root@198.199.90.118:/var/www/'
sh 'scp -r dist/page-not-found root@198.199.90.118:/var/www/'
sh 'scp -r dist/sso root@198.199.90.118:/var/www/'
}
2019-01-24 21:57:33 +00:00
}
}
2019-03-02 18:06:20 +00:00
2019-03-02 18:24:17 +00:00
// Deploy to the Production environment
2019-03-02 18:06:20 +00:00
stage('Build for Production Environment') {
when {
branch 'master'
}
2019-01-24 21:57:33 +00:00
steps {
2019-03-02 18:06:20 +00:00
echo 'Building code in the "master" branch...'
sh 'npm install'
sh 'ng build --project shared --prod'
sh 'ng build --project globalnav --prod'
sh 'ng build --project page-not-found'
sh 'ng build --project account --prod'
sh 'ng build --project sso --prod'
2019-01-24 21:57:33 +00:00
}
}
2019-03-02 18:06:20 +00:00
stage('Deploy to Production Environment') {
when {
branch 'master'
}
2019-01-24 21:57:33 +00:00
steps {
2019-03-02 18:06:20 +00:00
echo 'Deploying to production environment web servers...'
2019-01-25 01:24:52 +00:00
withCredentials([sshUserPrivateKey(credentialsId: '6413826d-79f6-4d03-9902-ee1b73a96efd', keyFileVariable: 'JENKINS_SSH_KEY', passphraseVariable: '', usernameVariable: 'SERVER_USER')]) {
2019-03-02 18:24:17 +00:00
// Deploy account application and its associated libraries
2019-03-02 18:06:20 +00:00
sh 'scp -r dist/shared root@???:/var/www/'
sh 'scp -r dist/globalnav root@???:/var/www/'
sh 'scp -r dist/page-not-found root@???:/var/www/'
sh 'scp -r dist/account root@???:/var/www/'
2019-03-02 18:24:17 +00:00
// Deploy single sign on application and its associated libraries
2019-03-02 18:06:20 +00:00
sh 'scp -r dist/shared root@???:/var/www/'
sh 'scp -r dist/globalnav root@???:/var/www/'
sh 'scp -r dist/page-not-found root@???:/var/www/'
sh 'scp -r dist/sso root@???:/var/www/'
}
2019-01-24 21:57:33 +00:00
}
}
2019-03-02 18:06:20 +00:00
2019-01-24 21:57:33 +00:00
}
}