diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..e8c4ff8 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,37 @@ +pipeline { +// parameters { +// string defaultValue: '2.462.2-jdk17', name: 'jenkinsTag', trim: true, description: 'Jenkins base image tag to use' +// } + agent { + kubernetes { + yaml """ +apiVersion: v1 +kind: Pod +spec: + containers: + - name: kaniko + image: gcr.io/kaniko-project/executor:latest + imagePullPolicy: Always + command: + - sleep + args: + - 1d + volumeMounts: + - name: kaniko-secret + mountPath: /kaniko/.docker + volumes: + - name: kaniko-secret + secret: + secretName: build-kubix-harbor-registry-credentials +""" + } + } + stages { + stage('Build and Push Image with Kaniko') { + steps { + sh 'echo $PATH' + sh '/kaniko/executor --dockerfile=./Dockerfile --context=dir://. --destination=https://harbor.kubix.siatel.ro/builds/jenkins:${jenkinsTag}-plus' + } + } + } +}