pipeline {

    environment {
        branch = 'master'
        scmUrl = 'git@github.com:GalacticExchange/gex-client-js.git'
    }

    agent {
        docker {
            image 'node:8.9.3'
            //args  '-v ${workspace}:/gex-client-js -w=/gex-client-js'
        }
    }

    stages {



        stage('checkout git') {
            steps {
                git branch: branch, url: scmUrl
            }
        }

        stage('Build') {
            steps {
                sh 'npm install'
                sh 'npm install mocha'
            }
        }
        stage('Test') {
            steps {
                sh 'npm test'
            }
        }
    }

    /*post {
        failure {
            slackSend channel: '#bot_test1',
                      color: 'bad',
                      message: "The pipeline ${currentBuild.fullDisplayName} completed unsuccessfully."
        }
    }*/
}
