Skip to content

Commit

Permalink
update script and dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
natalie-bernhard committed Dec 6, 2023
2 parents aa23c0b + 1ea325c commit e5b3889
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docker/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ RUN $BUILD_SCRIPTS_DIR/docs_part_2.sh

RUN $BUILD_SCRIPTS_DIR/gzip.sh

RUN mkdir /temp-docs
RUN mv /target/jekyll-webapp/docs /temp-docs
RUN ls /target/jekyll-webapp

#
#
#
Expand All @@ -48,7 +52,18 @@ COPY .mvn /.mvn
COPY pom.xml /
COPY --from=docs --chown=1001:0 /src /src
COPY --from=docs --chown=1001:0 /target /target
# Maven does not need to know about the large amount of files generated by Antora. The antora files only need to be
# correctly placed on the file system so that the openliberty.io application can serve the files to browsers.
# When the Antora files are placed in the /target directory, this forces Maven to deal with too many files.
# Maven will encouter a JVM crash because there are too many files related to docs.

# Part 1: Remove the docs files so Maven does not need to deal with them.
RUN rm -rf /target/jekyll-webapp/docs
# Part 2: Build the Java application
RUN ./mvnw -B -Dhttps.protocols=TLSv1.2 compile war:exploded
# Part 3: Restore the doc files that were previously removed
RUN mkdir target/openliberty-website-1.0-SNAPSHOT/docs
COPY --from=docs --chown=1001:0 /temp-docs/docs /target/openliberty-website-1.0-SNAPSHOT/docs

#
#
Expand Down
15 changes: 15 additions & 0 deletions docker/Dockerfile.staging
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ RUN $BUILD_SCRIPTS_DIR/docs_part_2.sh

RUN $BUILD_SCRIPTS_DIR/gzip.sh

RUN mkdir /temp-docs
RUN mv /target/jekyll-webapp/docs /temp-docs
RUN ls /target/jekyll-webapp

#
#
#
Expand All @@ -45,7 +49,18 @@ COPY .mvn /.mvn
COPY pom.xml /
COPY --from=docs --chown=1001:0 /src /src
COPY --from=docs --chown=1001:0 /target /target
# Maven does not need to know about the large amount of files generated by Antora. The antora files only need to be
# correctly placed on the file system so that the openliberty.io application can serve the files to browsers.
# When the Antora files are placed in the /target directory, this forces Maven to deal with too many files.
# Maven will encouter a JVM crash because there are too many files related to docs.

# Part 1: Remove the docs files so Maven does not need to deal with them.
RUN rm -rf /target/jekyll-webapp/docs
# Part 2: Build the Java application
RUN ./mvnw -B -Dhttps.protocols=TLSv1.2 compile war:exploded
# Part 3: Restore the doc files that were previously removed
RUN mkdir target/openliberty-website-1.0-SNAPSHOT/docs
COPY --from=docs --chown=1001:0 /temp-docs/docs /target/openliberty-website-1.0-SNAPSHOT/docs

#
#
Expand Down
1 change: 1 addition & 0 deletions scripts/build/docs_part_1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ echo "Moving the Antora docs to the jekyll webapp"
timer_start=$(date +%s)
mkdir -p target/jekyll-webapp/docs/
cp -r src/main/content/docs/build/site/. target/jekyll-webapp/
rm -rf src/main/content/docs/build
timer_end=$(date +%s)
echo "Total execution time for copying Antora docs to webapp: '$(date -u --date @$(( $timer_end - $timer_start )) +%H:%M:%S)'"

Expand Down

0 comments on commit e5b3889

Please sign in to comment.