2023-06-19 13:58:25 +02:00
|
|
|
// Intégration de la librairie Cadoles (voir https://forge.cadoles.com/Cadoles/Jenkins)
|
|
|
|
@Library("cadoles") _
|
|
|
|
|
|
|
|
// Utilisation du pipeline partagé pour les applications Symfony de Cadoles
|
|
|
|
// Le nom de l'image Docker passée en paramètre vous permet de préciser l'environnement de test
|
|
|
|
// de votre application Symfony
|
|
|
|
symfonyAppPipeline('ubuntu:22.04', [
|
|
|
|
'hooks': [
|
|
|
|
// Run docker image build, verification and publication stages
|
|
|
|
'postSymfonyAppPipeline': {
|
2023-06-19 16:15:46 +02:00
|
|
|
stage('Build and publish docker images') {
|
|
|
|
steps {
|
|
|
|
make
|
|
|
|
make release
|
|
|
|
}
|
|
|
|
}
|
2023-06-19 13:58:25 +02:00
|
|
|
stage('Build and publish hydra-dispatcher image') {
|
2023-06-19 14:28:01 +02:00
|
|
|
// Retrieve current tag
|
|
|
|
String currentTag = sh(script: 'git tag --points-at HEAD | head -n 1', returnStdout: true).trim()
|
|
|
|
// Retrieve default tag
|
|
|
|
String defaultTag = sh(returnStdout: true, script: 'git describe --always').trim()
|
2023-06-19 16:15:46 +02:00
|
|
|
container.buildAndPublishImage([
|
|
|
|
'imageName': 'reg.cadoles.com/pcaseiro/myapplication-standalone',
|
|
|
|
// Use current tag or default tag if not defined
|
|
|
|
'imageTag': defaultTag,
|
|
|
|
'dockerfile': './misc/images/myapplication-standalone/Dockerfile',
|
|
|
|
'dryRun': false
|
|
|
|
])
|
|
|
|
container.buildAndPublishImage([
|
|
|
|
'imageName': 'reg.cadoles.com/pcaseiro/myapplication-kube',
|
|
|
|
// Use current tag or default tag if not defined
|
|
|
|
'imageTag': defaultTag,
|
|
|
|
'dockerfile': './misc/images/myapplication-kube/Dockerfile',
|
|
|
|
'dryRun': false
|
|
|
|
])
|
2023-06-19 13:58:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
])
|