mirror of
https://github.com/chillout2k/sos-milter.git
synced 2025-12-12 18:10:18 +00:00
Jenkins declarative pipeline
This commit is contained in:
parent
49babbbf8a
commit
acbd3bfb5d
30
Jenkinsfile
vendored
30
Jenkinsfile
vendored
@ -1,30 +0,0 @@
|
||||
node {
|
||||
def app
|
||||
|
||||
stage('Clone repository') {
|
||||
sh '/usr/bin/env'
|
||||
/* Let's make sure we have the repository cloned to our workspace */
|
||||
checkout scm
|
||||
}
|
||||
|
||||
stage('Build image') {
|
||||
sh '/usr/bin/env'
|
||||
/* This builds the actual image; synonymous to
|
||||
* docker build on the command line */
|
||||
app = docker.build("jenkins/sos-milter")
|
||||
}
|
||||
|
||||
stage('Test image') {
|
||||
/* Ideally, we would run a test framework against our image.
|
||||
* For this example, we're using a Volkswagen-type approach ;-) */
|
||||
app.inside {
|
||||
sh 'echo "Tests passed"'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Push image') {
|
||||
docker.withRegistry('https://dockreg-fra.zwackl.de') {
|
||||
app.push()
|
||||
}
|
||||
}
|
||||
}
|
||||
1
Jenkinsfile
vendored
Symbolic link
1
Jenkinsfile
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
Jenkinsfile.declarative
|
||||
37
Jenkinsfile.declarative
Normal file
37
Jenkinsfile.declarative
Normal file
@ -0,0 +1,37 @@
|
||||
pipeline {
|
||||
agent any
|
||||
def docker_image
|
||||
|
||||
stages {
|
||||
stage('Checkout SCM') {
|
||||
checkout scm
|
||||
}
|
||||
|
||||
stage('Build image') {
|
||||
steps {
|
||||
sh '/usr/bin/env'
|
||||
/* This builds the actual image; synonymous to
|
||||
* docker build on the command line */
|
||||
docker_image = docker.build("jenkins/sos-milter")
|
||||
}
|
||||
}
|
||||
|
||||
stage('Test image') {
|
||||
steps {
|
||||
/* Ideally, we would run a test framework against our image.
|
||||
* For this example, we're using a Volkswagen-type approach ;-) */
|
||||
docker_image.inside {
|
||||
sh 'echo "Tests passed"'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Push image') {
|
||||
steps {
|
||||
docker.withRegistry('https://dockreg-fra.zwackl.de') {
|
||||
docker_image.push()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
29
Jenkinsfile.scripted
Normal file
29
Jenkinsfile.scripted
Normal file
@ -0,0 +1,29 @@
|
||||
node {
|
||||
def docker_image
|
||||
|
||||
stage('Clone repository') {
|
||||
sh '/usr/bin/env'
|
||||
/* Let's make sure we have the repository cloned to our workspace */
|
||||
checkout scm
|
||||
}
|
||||
|
||||
stage('Build image') {
|
||||
/* This builds the actual image; synonymous to
|
||||
* docker build on the command line */
|
||||
docker_image = docker.build("jenkins/sos-milter")
|
||||
}
|
||||
|
||||
stage('Test image') {
|
||||
/* Ideally, we would run a test framework against our image.
|
||||
* For this example, we're using a Volkswagen-type docker_imageroach ;-) */
|
||||
docker_image.inside {
|
||||
sh 'echo "Tests passed"'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Push image') {
|
||||
docker.withRegistry('https://dockreg-fra.zwackl.de') {
|
||||
docker_image.push()
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user