Skip to content

Commit

Permalink
Merge pull request #16 from kbase/dev-gradle
Browse files Browse the repository at this point in the history
Update dockerfile w/ gradle build & add compose file
  • Loading branch information
MrCreosote authored May 3, 2024
2 parents d41a348 + 8986759 commit 5842f5b
Show file tree
Hide file tree
Showing 16 changed files with 74 additions and 1,017 deletions.
38 changes: 23 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
FROM kbase/sdkbase2:latest AS build

# Multistage Build Setup

RUN cd /tmp && \
git clone https://github.com/kbase/jars

COPY . /tmp/user_profile

# Bypass the makefile, which has perl dependencies, and just use
# the underlying ant compile and ant buildwar
RUN cd /tmp/user_profile && \
ant compile && \
ant buildwar
WORKDIR /tmp/up

# dependencies take a while to D/L, so D/L & cache before the build so code changes don't cause
# a new D/L
# can't glob *gradle because of the .gradle dir
COPY build.gradle gradlew settings.gradle /tmp/up/
COPY gradle/ /tmp/up/gradle/
RUN ./gradlew dependencies

# Now build the code
# copy the deployment dir first since it's unlikely to change often
COPY deployment/ /kb/deployment
COPY jettybase /kb/deployment/jettybase
COPY src /tmp/up/src/
COPY war /tmp/up/war/
RUN ./gradlew war

# Build the deployment directory
ENV DEPL=/kb/deployment/jettybase
RUN mkdir -p $DEPL/webapps
RUN cp /tmp/up/build/libs/user_profile.war $DEPL/webapps/ROOT.war

FROM kbase/kb_jre:latest

# These ARGs values are passed in via the docker build command
ARG BUILD_DATE
ARG VCS_REF
ARG BRANCH=develop

COPY deployment/ /kb/deployment/
COPY jettybase/ /kb/deployment/jettybase/
COPY --from=build /tmp/user_profile/dist/UserProfileService.war /kb/deployment/jettybase/webapps/ROOT.war
COPY --from=build /kb/deployment/ /kb/deployment/

# The BUILD_DATE value seem to bust the docker cache when the timestamp changes, move to
# the end
Expand Down
163 changes: 0 additions & 163 deletions Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ var DEFAULT_URL = "https://ci.kbase.us/services/user_profile/rpc"
var LOC_UP_SPEC = "$rootDir/UserProfile.spec"
var LOC_DOC_HTML = "$rootDir/docshtml"

// TODO NOW update dockerfile
// TODO NOW delete build.xml and Makefile

repositories {
mavenCentral()
}
Expand Down
Loading

0 comments on commit 5842f5b

Please sign in to comment.