From 85872bc43b6497cc56c729ba425ded8b73402f1f Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Thu, 10 Dec 2020 11:07:14 +0100 Subject: [PATCH] add jenkinsfile --- Jenkinsfile | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000..045f9a12c5 --- /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 -- GitLab