Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
dev 999 B
pipeline {
    agent { label 'node3' }
    tools { nodejs 'node' }
    stages {
        stage('notify') {
            steps {
                script {
                    slack_send_start()
                }
            }
        }
        stage('build') {
            steps {
                sh '''
                npm i
                npm run build:dev
            '''
            }
        }

        stage('copy build') {
            steps {
                sh '''
                sudo rm -rf /var/www/dawn_dev/build
                sudo cp -r build /var/www/dawn_dev
            '''
            }
        }

        stage('restart nginx') {
            steps {
                sh '''
                sudo service nginx restart
            '''
            }
        }
    }

    post {
        success {
            script {
                slack_send_success()
            }
        }
        failure {
            script {
                slack_send_failure()
            }
        }
    }
}