Jenkinsfile 511 Bytes
Newer Older
FabiusE's avatar
FabiusE committed
1
node {
FabiusE's avatar
FabiusE committed
2 3 4 5
    def app
    stage('Clone repository'){
        checkout scm
    }
FabiusE's avatar
FabiusE committed
6

FabiusE's avatar
FabiusE committed
7 8 9
    stage('Build image'){
        app = docker.build("fabiuse/reactdocker")
    }
FabiusE's avatar
FabiusE committed
10

FabiusE's avatar
FabiusE committed
11 12 13
    stage('Test image'){
        app.inside {
            sh 'echo "Tests passed"'
FabiusE's avatar
FabiusE committed
14
        }
FabiusE's avatar
FabiusE committed
15
    }
FabiusE's avatar
FabiusE committed
16 17 18 19 20

    stage('Push image'){
        docker.withRegistry('','docker-hub-credentials'){
            app.push("latest")
        }
FabiusE's avatar
FabiusE committed
21 22
    }

FabiusE's avatar
FabiusE committed
23
    
FabiusE's avatar
FabiusE committed
24
    stage('Deploy') {
FabiusE's avatar
FabiusE committed
25
        {
FabiusE's avatar
FabiusE committed
26
            sh 'kubectl version'
FabiusE's avatar
FabiusE committed
27
        }
FabiusE's avatar
FabiusE committed
28 29
    }    
}