Procházet zdrojové kódy

Trying yaml for jenkinsfile

Fred Damstra (k8s1) před 2 roky
rodič
revize
4571ac7548
1 změnil soubory, kde provedl 39 přidání a 7 odebrání
  1. 39 7
      Jenkinsfile

+ 39 - 7
Jenkinsfile

@@ -1,12 +1,44 @@
 def label = "update-route53.$BUILD_NUMBER-pipeline"
  
-podTemplate(label: label, containers: [
- containerTemplate(name: 'kaniko', image: 'gcr.io/kaniko-project/executor:debug', command: '/busybox/cat', ttyEnabled: true)
-],
-volumes: [
-   secretVolume(mountPath: '/kaniko/.docker/', secretName: 'kaniko-secret')
-]) {
- node(label) {
+podTemplate(yaml: '''
+              kind: Pod
+              spec:
+                containers:
+                - name: kaniko
+                  image: gcr.io/kaniko-project/executor:v1.9.1
+                  imagePullPolicy: Always
+                  command:
+                  - '/busyboxy/cat'
+                  volumeMounts:
+                  - name: docker-config
+                    mountPath: /kaniko/.docker/
+                dnsPolicy: "None"
+                dnsConfig:
+                  nameservers:
+                    - 10.42.42.239
+                    - 10.42.42.1
+                  searches:
+                    - default.svc.cluster.local
+                    - svc.cluster.local
+                    - cluster.local
+                  options:
+                    - name: ndots
+                      value: "2"
+                    - name: edns0
+                    - name: trust-ad
+                  volumeMounts:
+                    - name: docker-cfg
+                      mountPath: /kaniko/.docker
+                volumes:
+                - name: docker-config
+                  secret:
+                    secretName: docker-regcred
+                    items:
+                        - key: .dockerconfigjson
+                          path: config.json
+'''
+) {
+ node(POD_LABEL) {
    stage('Stage 1: Build with Kaniko') {
      container('kaniko') {
        sh '/kaniko/executor --context="git://git.monkeybox.org/Containers/update-route53#refs/heads/main" \