2021-05-05 11:24:41 +02:00
|
|
|
node {
|
|
|
|
def app
|
|
|
|
|
|
|
|
stage('Clone repository') {
|
|
|
|
/* 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 */
|
|
|
|
|
|
|
|
app = docker.build("thisfro/plantex")
|
|
|
|
}
|
|
|
|
|
|
|
|
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 {
|
2021-05-06 14:07:12 +02:00
|
|
|
// php 'bin/phpunit'
|
|
|
|
sh 'echo "success"'
|
2021-05-05 11:24:41 +02:00
|
|
|
}
|
|
|
|
}
|
2021-05-06 14:59:29 +02:00
|
|
|
|
2021-12-25 14:33:17 +01:00
|
|
|
stage('Push image') {
|
2021-12-25 14:45:49 +01:00
|
|
|
docker.withRegistry('https://hub.thisfro.ch') {
|
2021-12-25 14:43:30 +01:00
|
|
|
app.push("$BUILD_NUMBER")
|
|
|
|
app.push('latest')
|
2021-12-25 14:33:17 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-06 14:59:29 +02:00
|
|
|
stage('Deploy staging') {
|
2021-12-27 15:29:56 +01:00
|
|
|
sh 'cd /opt/containers/pflaenz.li && docker-compose pull && docker-compose up -d'
|
2021-05-06 14:59:29 +02:00
|
|
|
}
|
2021-05-05 11:24:41 +02:00
|
|
|
}
|