Browse Source

Reverting jenkinsfile

Fred Damstra (k8s1) 2 years ago
parent
commit
96abea5e00
2 changed files with 61 additions and 41 deletions
  1. 7 41
      Jenkinsfile
  2. 54 0
      Jenkinsfile.withyaml.notworking

+ 7 - 41
Jenkinsfile

@@ -1,46 +1,12 @@
 def label = "update-route53.$BUILD_NUMBER-pipeline"
  
-podTemplate(yaml: '''
-              kind: Pod
-              spec:
-                containers:
-                - name: kaniko
-                  image: gcr.io/kaniko-project/executor:v1.9.1-debug
-                  imagePullPolicy: Always
-                  command:
-                  - sleep
-                  args:
-                  - 99d
-                  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) {
+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) {
    stage('Stage 1: Build with Kaniko') {
      container('kaniko') {
        sh '/kaniko/executor --context="git://git.monkeybox.org/Containers/update-route53#refs/heads/main" \

+ 54 - 0
Jenkinsfile.withyaml.notworking

@@ -0,0 +1,54 @@
+def label = "update-route53.$BUILD_NUMBER-pipeline"
+ 
+podTemplate(yaml: '''
+              kind: Pod
+              spec:
+                containers:
+                - name: kaniko
+                  image: gcr.io/kaniko-project/executor:v1.9.1-debug
+                  imagePullPolicy: Always
+                  command:
+                  - sleep
+                  args:
+                  - 99d
+                  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" \
+               --destination="fdamstra/update-route53:latest" \
+               --insecure \
+               --skip-tls-verify  \
+               -v=debug'
+     }
+   }
+ }
+}