• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1pipeline {
2  agent {
3    kubernetes {
4      yaml '''
5apiVersion: v1
6kind: Pod
7spec:
8  imagePullSecrets:
9    - name: artifactory-ms-docker
10  containers:
11    - name: dind
12      image: mobile-studio--docker.eu-west-1.artifactory.aws.arm.com/docker:dind
13      tty: true
14      resources:
15        requests:
16          cpu: 2
17          memory: 4Gi
18      securityContext:
19        privileged: true
20      volumeMounts:
21        - name: dind-storage
22          mountPath: /var/lib/docker
23  volumes:
24    - name: dind-storage
25      emptyDir: {}
26'''
27      defaultContainer 'dind'
28    }
29  }
30  environment {
31    ARTIFACTORY_CREDENTIALS = credentials('cepe-artifactory-jenkins')
32  }
33  options {
34    ansiColor('xterm')
35    timestamps()
36  }
37  stages {
38    stage('Build and Push Image') {
39      steps {
40        sh 'docker info'
41        sh '''
42          apk add --no-cache bash curl
43          chmod u+x ./jenkins/build-image.sh
44          ./jenkins/build-image.sh push
45        '''
46      }
47    }
48  }
49}
50