Jenkinsfile 900 Bytes
Newer Older
BorjaEst's avatar
BorjaEst committed
1
pipeline {
BorjaEst's avatar
BorjaEst committed
2
    environment {
3
        registry = "synergyimk/o3skim"
BorjaEst's avatar
BorjaEst committed
4
5
6
        registryCredential = 'dockerhub_id'
    }
    agent any
BorjaEst's avatar
BorjaEst committed
7
    stages {
BorjaEst's avatar
BorjaEst committed
8
9
10
11
12
13
        stage('Image build') {
            steps {
                echo '====================building image===================================='
                script { customImage = docker.build(registry) }
            }
        }
BorjaEst's avatar
BorjaEst committed
14
15
16
        stage('Unit testing') {
            steps {
                echo '====================executing unittest================================'
BorjaEst's avatar
BorjaEst committed
17
18
19
20
21
22
                script { customImage.inside("--entrypoint=''") {sh 'tox'} }
            }
        }
        stage('Docker-hub upload') {
            steps {
                echo '====================uploading docker-hub=============================='
BorjaEst's avatar
BorjaEst committed
23
                script { docker.withRegistry('', registryCredential) { customImage.push() } }
BorjaEst's avatar
BorjaEst committed
24
25
26
27
            }
        }
    }
}