You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.1 KiB
Groovy
44 lines
1.1 KiB
Groovy
pipeline {
|
|
agent {
|
|
kubernetes {
|
|
yaml """\
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: 'jenkins-slave'
|
|
namespace: 'your-namespace'
|
|
spec:
|
|
containers:
|
|
- name: dind
|
|
image: swr.eu-de.otc.t-systems.com/base-image/docker:dind
|
|
tty: true
|
|
imagePullPolicy: Always
|
|
imagePullSecrets:
|
|
- name: default-secret
|
|
env:
|
|
- name: PASS
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: docker-reg
|
|
key: docker-reg
|
|
""".stripIndent()
|
|
}
|
|
}
|
|
stages {
|
|
stage('Build Docker Image') {
|
|
steps {
|
|
container('dind') {
|
|
|
|
echo 'FOO is ${env.BUILD_NUMBER}'
|
|
sh """
|
|
image="swr.eu-de.otc.t-systems.com/omnia-test/test-build:latest"
|
|
docker login ${PASS} swr.eu-de.otc.t-systems.com
|
|
docker build -t ${image} .
|
|
docker push ${image}
|
|
"""
|
|
milestone(1)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |