Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pipeline {
- agent any
- environment {
- SSHPASS = credentials('edmpass')
- }
- stages {
- stage('checkout master'){
- steps {
- checkout([$class: 'GitSCM',
- branches: [[name: '*/master']],
- userRemoteConfigs: [[url: 'https://github.com/wipcamp/12-wippo.git']]
- ])
- }
- }
- stage('build production'){
- options {
- timeout(time: 7, unit: 'MINUTES')
- }
- steps {
- catchError(buildResult: 'SUCCESS',
- message: 'yarn install got aborted. FORCED SUCCESS!') {
- sh 'yarn'
- }
- catchError(buildResult: 'SUCCESS',
- message: 'yarn build got aborted. FORCED SUCCESS!') {
- sh 'yarn build'
- }
- }
- }
- stage('remove production'){
- steps {
- sh """
- set +x
- sshpass -e ssh root@116.204.180.39 'rm -rf /var/www/12-wippo/build'
- """
- }
- }
- stage('deploy production'){
- steps {
- sh """
- set +x
- sshpass -e scp -r build root@116.204.180.39:/var/www/12-wippo
- """
- }
- }
- }
- post {
- always {
- deleteDir()
- }
- success {
- echo "wip12-prod-wippo pipeline successful."
- }
- failure {
- echo "wip12-prod-wippo pipeline failure."
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement