Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pipeline {
- agent none
- options {
- disableConcurrentBuilds()
- }
- stages {
- stage('init & build') {
- agent {
- docker {
- image 'node:12.14.0'
- args '--volume ${JENKINS_HOME}/workspace/${JOB_NAME}:/workspace'
- }
- }
- stages {
- stage('init') {
- steps {
- git branch: 'develop', url: 'https://github.com/wipcamp/12-game-pr.git'
- sh 'yarn'
- }
- post {
- success {
- echo "${env.JOB_NAME} successfully init!"
- }
- }
- }
- stage('build') {
- steps {
- catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
- sh 'yarn deploy'
- }
- }
- post {
- success {
- echo "${env.JOB_NAME} successfully built!"
- }
- }
- }
- }
- }
- stage('deploy') {
- agent any
- steps {
- sh "ssh ${EDGE_JENKINS_USER}@${EDGE_MACHINE} 'cd /var/www/frontend/; rm -rf 12-game-pr'"
- sh "scp -r build/ ${EDGE_JENKINS_USER}${EDGE_MACHINE}:/var/www/frontend/12-game-pr/"
- }
- post {
- always {
- deleteDir()
- }
- success {
- echo "${env.JOB_NAME} successfully deploy!"
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement