Olaf Bohlen
2020-07-07 fe3b2622644d70bb8b2b3c46e225e4e8b4dae63d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
pipeline {
    triggers {
    pollSCM ('H/3 * * * *')
    }
    options {
    buildDiscarder (logRotator (numToKeepStr: '5', artifactNumToKeepStr: '5'))
    disableConcurrentBuilds()
    }
    agent {
    node {
        label 'nodejs'
    }
    }
    stages {
    stage ('Validate configuration resources') {
        steps {
        sh 'oc apply --dry-run -k config'
        }
    }
    stage ('Apply resources') {
        when {
        branch 'master'
        }
        steps {
        sh 'oc apply -k config'
        sh 'oc wait co/authentication --for condition=Progressing --timeout 15s || true'
        sh 'oc rollout status deployment/oauth-openshift -n openshift-authentication -w --timeout 360s'
        }
    }
    stage ('Verify test user') {
        when {
        branch 'master'
        }
        steps {
        sh 'oc login -u testuser -p redhat123 --insecure-skip-tls-verify https://kubernetes.default.svc:443'
        sh 'oc new-project test-testuser || true'
        }
    }
    }
}