Permalink
Cannot retrieve contributors at this time
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?
kubernetes-integration-test/Jenkinsfile-yaml
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
69 lines (61 sloc)
2.1 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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' | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } |