From f7d6789a7aa7f890fe6e2db08a11574f3ade70d1 Mon Sep 17 00:00:00 2001 From: Michael Sauter Date: Thu, 2 Aug 2018 11:30:43 +0200 Subject: [PATCH] Build directly --- Jenkinsfile | 7 ++++--- docker/Dockerfile | 9 +-------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3c2ad904..364ffa87 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ node { nexusPassword = env.NEXUS_PASSWORD } -library identifier: 'ods-library@latest', retriever: modernSCM( +library identifier: 'ods-library@feature/direct-oc-builds', retriever: modernSCM( [$class: 'GitSCMSource', remote: sharedLibraryRepository, credentialsId: credentialsId]) @@ -30,7 +30,7 @@ odsPipeline( stageBuild(context) stageScanForSonarqube(context) stageCreateOpenshiftEnvironment(context) - stageUpdateOpenshiftBuild(context) + stageStartOpenshiftBuild(context) stageDeployToOpenshift(context) stageTriggerAllBuilds(context) } @@ -44,7 +44,8 @@ def stageBuild(def context) { } stage('Build') { withEnv(["TAGVERSION=${context.tagversion}", "NEXUS_USERNAME=${context.nexusUsername}", "NEXUS_PASSWORD=${context.nexusPassword}", "NEXUS_HOST=${context.nexusHost}", "JAVA_OPTS=${javaOpts}","GRADLE_TEST_OPTS=${gradleTestOpts}","ENVIRONMENT=${springBootEnv}"]) { - sh "./gradlew clean build --stacktrace --no-daemon uploadArchives" + sh "./gradlew clean build --stacktrace --no-daemon" } + sh "cp build/libs/${context.componentId}-*.jar docker/app.jar" } } diff --git a/docker/Dockerfile b/docker/Dockerfile index aed7e096..719709cd 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,13 +1,6 @@ FROM openjdk:8-jre-alpine -ARG nexusUsername -ARG nexusPassword -ARG nexusHost -ARG projectId -ARG componentId -ARG tagversion -ARG nexusfolder -RUN echo "projectId=${projectId}" && echo "${nexusHost}" && apk add --no-cache --virtual .build-deps curl && curl --fail -o app.jar -v -u ${nexusUsername}:${nexusPassword} ${nexusHost}/repository/candidates/org/opendevstack/${projectId}/${componentId}/${tagversion}/${componentId}-${tagversion}.jar +COPY app.jar app.jar EXPOSE 8080