Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
70 lines (61 sloc) 2.1 KB
//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'
}
}
}
}
}
}
You can’t perform that action at this time.