Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
podTemplate(
label: 'app-users-it',
cloud: 'openshift',
containers: [
//Jenkins agent - a jnlp container is mandatory (or added automatically)
containerTemplate(name: 'jnlp',
image: 'registry.access.redhat.com/openshift3/jenkins-slave-base-rhel7:v3.9',
resourceLimitMemory: '256Mi',
command: '/bin/sh -c',
args: '"umask 0000; /usr/local/bin/run-jnlp-client ${computer.jnlpmac} ${computer.name}"'
),
//Container running the test
containerTemplate(name: 'it',
image: 'fabric8/maven-builder:vd8fbad4',
resourceLimitMemory: '512Mi',
envVars: [
//Manage heap, there are two java processes: maven + surefire
envVar(key: 'JAVA_TOOL_OPTIONS', value: '-Xms128m -Xmx128m')
]),
//App under test
containerTemplate(name: 'app-users',
image: '172.30.1.1:5000/myproject/app-users:latest',
resourceLimitMemory: '512Mi',
envVars: [
envVar(key: 'SPRING_PROFILES_ACTIVE', value: 'k8sit'),
envVar(key: 'SPRING_CLOUD_KUBERNETES_ENABLED', value: 'false')
]),
//DB
containerTemplate(name: 'mariadb',
image: 'registry.access.redhat.com/rhscl/mariadb-102-rhel7:1',
resourceLimitMemory: '256Mi',
envVars: [
envVar(key: 'MYSQL_USER', value: 'myuser'),
envVar(key: 'MYSQL_PASSWORD', value: 'mypassword'),
envVar(key: 'MYSQL_DATABASE', value: 'testdb'),
envVar(key: 'MYSQL_ROOT_PASSWORD', value: 'secret')
]),
//AMQ
containerTemplate(name: 'amq',
image: 'registry.access.redhat.com/jboss-amq-6/amq63-openshift:1.3',
resourceLimitMemory: '256Mi',
envVars: [
envVar(key: 'AMQ_USER', value: 'test'),
envVar(key: 'AMQ_PASSWORD', value: 'secret')
]),
//External API Third party (provided by mockserver)
containerTemplate(name: 'mockserver',
image: 'jamesdbloom/mockserver:mockserver-5.3.0',
resourceLimitMemory: '256Mi',
envVars: [
envVar(key: 'LOG_LEVEL', value: 'INFO'),
envVar(key: 'JVM_OPTIONS', value: '-Xmx128m'),
])
]
)
{
node('app-users-it') {
stage('Pull source') {
checkout scm
}
dir ("integration-test") {
stage('Prepare test') {
container('mariadb') {
//requires mysql
sh 'sql/setup.sh'
}
//requires curl and python
sh 'mockserver/setup.sh'
}
//These env vars are used the tests to send message to users.in queue
withEnv(['AMQ_USER=test',
'AMQ_PASSWORD=secret']) {
stage('Build and run test') {
container('it'){
try {
sh 'mvn -s ../configuration/settings.xml -B clean test'
} finally {
junit 'target/surefire-reports/*.xml'
}
}
}
}
}
}
}