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
//Update kubernetes-plugin to 1.7
node('master'){
checkout scm
yamlFromFile = readFile 'pod.yaml' //Read yaml file
}
podTemplate(
name: 'app-users-it',
label: 'app-users-it',
cloud: 'openshift',
yaml: yamlFromFile //Use the yaml read from file
)
{
node('maven'){
stage('Pull source') {
checkout scm //git url: 'https://github.com/bszeti/kubernetes-integration-test.git'
}
dir ("app-users") {
stage('Build app') {
sh "mvn -B -s ../configuration/settings.xml -DskipTests package"
}
stage('Build Image') {
// Requires: minishift config set insecure-registry 172.30.0.0/16
sh "oc new-build --name=app-users --docker-image=registry.access.redhat.com/fuse7/fuse-java-openshift:latest --binary=true --labels=app=app-users || true"
sh 'rm -rf oc-build && mkdir -p oc-build/deployments'
sh 'cp target/*.jar oc-build/deployments'
openshift.withCluster() {
openshift.withProject('myproject') {
openshift.selector('bc', 'app-users').startBuild('--from-dir=oc-build', '--wait=true').logs('-f')
}
}
}
}
}
node('app-users-it') {
stage('Pull source') {
checkout scm
}
dir ("integration-test") {
stage('Prepare test') {
container('mariadb') {
//requires mysql
sh 'sql/setup.sh'
}
container('jnlp') {
//requires curl and python
sh 'mockserver/setup.sh'
}
}
withEnv(['AMQ_USER=test',
'AMQ_PASSWORD=secret']) {
stage('Build and run test') {
try {
sh 'mvn -s ../configuration/settings.xml -B clean test'
} finally {
junit 'target/surefire-reports/*.xml'
}
}
}
}
}
}