diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000000000000000000000000000000000..045f9a12c545f58697bbc1812e309189a72cbdf5 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,55 @@ +pipeline { + agent { + node { + label 'goofy' + } + } + + options { + timeout(time: 1, unit: 'HOURS') + disableConcurrentBuilds() + } + + stages { + stage('client build') { + steps { + sh 'npm --version' + dir('goofy-client') { + sh 'npm install' + sh 'npm run build' + sh 'npm run test' + } + } + } + + stage('server build') { + steps { + container("maven"){ + sh 'mvn --version' + + sh 'mvn clean install' + } + } + } + + stage('openshift deploy') { + steps { + script { + def pom = readMavenPom file: 'pom.xml' + def version = pom.version + + openshift.withCluster() { + openshift.withProject() { + dir('goofy-server') { + openshift.startBuild("goofy-builder", "--from-dir=.", "--follow") + } + + openshift.tag("goofy-builder:latest", "goofy-builder:${env.BRANCH_NAME}-${version}") + openshift.tag("goofy-builder:${env.BRANCH_NAME}-${version}", "sh-kiel-dev/goofy:${env.BRANCH_NAME}-${version}") + } + } + } + } + } + } +} \ No newline at end of file