File size: 903 Bytes
b46c051
 
82aaa1f
b46c051
 
82aaa1f
 
 
 
 
 
b46c051
 
 
 
 
 
 
 
82aaa1f
b46c051
82aaa1f
 
 
 
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
CONTAINER="docker.qualityminds.de/rd/ai-christmas:latest"

podTemplate(containers: [
    containerTemplate(name: 'docker', image: 'docker:24.0.6-dind', args: '--mtu 1400', privileged: true, ttyEnabled: true,
                      resourceRequestCpu: '100m', resourceRequestMemory: '8Gi', resourceLimitMemory: '8Gi')
]) {
    node(POD_LABEL) {
        stage('checkout') {
            checkout scm
        }

        container('docker') {
            stage('docker build') {
                    sh "docker build --tag $CONTAINER ."
            }

            stage('docker push') {
                withCredentials([usernamePassword(credentialsId: 'nexus_jenkins_user', passwordVariable: 'password', usernameVariable: 'user')]) {
                    sh "docker login $QM_DOCKER_REGISTRY -p \$password -u \$user"
                }
                sh "docker push $CONTAINER"
            }
        }
    }
}