From ea6fa39c7498f5670c73f30e96689615760744fa Mon Sep 17 00:00:00 2001 From: Thomas MENARD <thomas.menard@pasteur.fr> Date: Fri, 13 Apr 2018 14:43:30 +0200 Subject: [PATCH] Add typescript angular compile --- Dockerfile | 7 ++++++- README.md | 2 +- s2i/bin/assemble | 10 +++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index fecaa75..fb54fd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,10 +16,15 @@ LABEL io.k8s.description="Platform for building and running Spring Boot applicat io.openshift.tags="builder,java,java8,maven,maven3,springboot" RUN yum update -y && \ - yum install -y curl && \ + yum install -y curl epel-release && \ yum install -y java-$JAVA_VERSON-openjdk java-$JAVA_VERSON-openjdk-devel && \ yum clean all +RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash - + +RUN yum install nodejs gcc-c++ make && \ + yum clean all && npm install -f @angular/cli + RUN curl -fsSL https://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - -C /usr/share \ && mv /usr/share/apache-maven-$MAVEN_VERSION /usr/share/maven \ && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn diff --git a/README.md b/README.md index a16f951..50ce04a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Spring Boot - Maven 3 - CentOS Docker image +# Spring Boot - Maven 3 + Typescript Angular - CentOS Docker image [](https://travis-ci.org/codecentric/springboot-maven3-centos) diff --git a/s2i/bin/assemble b/s2i/bin/assemble index 8021fb5..61127e8 100755 --- a/s2i/bin/assemble +++ b/s2i/bin/assemble @@ -3,7 +3,15 @@ set -e echo "---> Installing application source" -cp -Rf /tmp/src/. ./ +cp -Rf /tmp/. ./ +echo "---> Cleaning eventually static files hosted in src/...." +rm -rf ./src/main/resources/static/* + +echo "---> Building static files" +cd static +npm install +ng build --prod +mv ./dist/* ../src/main/resources/static/ echo "---> Building Spring Boot application from source" echo "--> # MVN_ARGS = $MVN_ARGS" -- GitLab