deprected .env file baked into docker build and jenkins ci pipeline
LocationBasedServices/smartguide/pipeline/head This commit looks good

This commit is contained in:
2026-11-03 14:32:25 +01:00
parent bf85fbd760
commit 2ef50d9bcf
2 changed files with 11 additions and 3 deletions
Vendored
+6 -2
View File
@@ -17,13 +17,17 @@ pipeline {
stage('Build') {
steps {
sh './gradlew build'
withCredentials([file(credentialsId: 'smartguide-env', variable: 'INSE_ENV_FILE')]) {
sh './gradlew build'
}
}
}
stage('Test') {
steps {
sh './gradlew :service:test'
withCredentials([file(credentialsId: 'smartguide-env', variable: 'INSE_ENV_FILE')]) {
sh './gradlew :service:test'
}
}
}
+5 -1
View File
@@ -31,9 +31,13 @@ task createImage(type: Exec) {
commandLine 'docker', 'build', '--platform', "${targetPlatform}", '-t', "${imagePrefix}-service:${imageVersion}", '.'
}
task test(type: Exec) {
dependsOn createImage
commandLine 'docker', 'run', '--rm', '-e', "DOCKER_DEFAULT_PLATFORM='${targetPlatform}'", '--name', "${imageName}-service-test", "${imagePrefix}-service:${imageVersion}", 'test'
def envFile = System.getenv('INSE_ENV_FILE')
def envArgs = envFile ? ['--env-file', envFile] : []
commandLine(['docker', 'run', '--rm', '-e', "DOCKER_DEFAULT_PLATFORM='${targetPlatform}'"] + envArgs +
['--name', "${imageName}-service-test", "${imagePrefix}-service:${imageVersion}", 'test'])
ignoreExitValue false
}