Skip to content

Commit

Permalink
Build directly
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsauter committed Aug 2, 2018
1 parent c5cdcac commit f7d6789
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
7 changes: 4 additions & 3 deletions Jenkinsfile
Expand Up @@ -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])
Expand All @@ -30,7 +30,7 @@ odsPipeline(
stageBuild(context)
stageScanForSonarqube(context)
stageCreateOpenshiftEnvironment(context)
stageUpdateOpenshiftBuild(context)
stageStartOpenshiftBuild(context)
stageDeployToOpenshift(context)
stageTriggerAllBuilds(context)
}
Expand All @@ -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"
}
}
9 changes: 1 addition & 8 deletions 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

Expand Down

0 comments on commit f7d6789

Please sign in to comment.