Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter to devfile and Dockerfiles for maven command and repo #202

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/stack-regression-tests-ol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ jobs:
- name: 'Test: InnerLoop: Maven: Basic'
run: ./test/inner-loop/basic-test.sh ol maven

- name: 'Test: InnerLoop: Maven: Basic with mvnw'
run: ./test/inner-loop/basic-mvnw-test.sh ol maven

- name: 'Test: InnerLoop: Gradle: Basic'
run: ./test/inner-loop/basic-test.sh ol gradle

Expand Down Expand Up @@ -128,4 +131,4 @@ jobs:

- name: 'Test: OuterLoop: Gradle: Docker build with MPH-off SCC-on args'
if: always()
run: ./test/outer-loop/docker-build-mphOff-sccOn-test.sh ol gradle
run: ./test/outer-loop/docker-build-mphOff-sccOn-test.sh ol gradle
5 changes: 4 additions & 1 deletion .github/workflows/stack-regression-tests-wl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ jobs:
- name: 'Test: InnerLoop: Maven: Basic'
run: ./test/inner-loop/basic-test.sh wl maven

- name: 'Test: InnerLoop: Maven: Basic with mvnw'
run: ./test/inner-loop/basic-mvnw-test.sh wl maven

- name: 'Test: InnerLoop: Gradle: Basic'
run: ./test/inner-loop/basic-test.sh wl gradle

Expand Down Expand Up @@ -128,4 +131,4 @@ jobs:

- name: 'Test: OuterLoop: Gradle: Docker build with MPH-off SCC-on args'
if: success() || failure()
run: ./test/outer-loop/docker-build-mphOff-sccOn-test.sh wl gradle
run: ./test/outer-loop/docker-build-mphOff-sccOn-test.sh wl gradle
6 changes: 6 additions & 0 deletions customize-ol.env
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ MAVEN_VERSION="3.8.4"
# Maven version SHA
MAVEN_SHA="a9b2d825eacf2e771ed5d6b0e01398589ac1bfa4171f36154d1b5787879605507802f699da6f7cfc80732a5282fd31b28e4cd6052338cbef0fa1358b48a5e3c8"

# Maven command to be used (mvn/mvnw)
MAVEN_CMD="mvn"

# Location of the local Maven repo to be used
MAVEN_REPO_LOCAL="/mvn/repository"

# Stack image for Maven deployments.
# This image is used to create your inner loop development containers, and also as the base image for the first stage of your outer loop image build.
STACK_IMAGE_MAVEN="icr.io/appcafe/open-liberty-devfile-stack:\{\{liberty-version\}\}"
Expand Down
6 changes: 6 additions & 0 deletions customize-wl.env
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ MAVEN_VERSION="3.8.4"
# Maven version SHA
MAVEN_SHA="a9b2d825eacf2e771ed5d6b0e01398589ac1bfa4171f36154d1b5787879605507802f699da6f7cfc80732a5282fd31b28e4cd6052338cbef0fa1358b48a5e3c8"

# Maven command to be used (mvn/mvnw)
MAVEN_CMD="mvn"

# Location of the local Maven repo to be used
MAVEN_REPO_LOCAL="/mvn/repository"

# Stack image for Maven deployments.
# This image is used to create your inner loop development containers, and also as the base image for the first stage of your outer loop image build.
STACK_IMAGE_MAVEN="icr.io/appcafe/websphere-liberty-devfile-stack:\{\{liberty-version\}\}"
Expand Down
8 changes: 4 additions & 4 deletions src/devfiles/maven/devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ commands:
- id: run
exec:
component: dev
commandLine: mvn -DinstallDirectory={{.WLP_INSTALL_PATH}} -Ddebug=false -DhotTests=true -DcompileWait=3 io.openliberty.tools:liberty-maven-plugin:{{liberty-plugin-version}}:dev
commandLine: {{.MAVEN_CMD}} -DinstallDirectory={{.WLP_INSTALL_PATH}} -Ddebug=false -DhotTests=true -DcompileWait=3 io.openliberty.tools:liberty-maven-plugin:{{liberty-plugin-version}}:dev
workingDir: /projects
hotReloadCapable: true
group:
Expand All @@ -62,7 +62,7 @@ commands:
- id: run-test-off
exec:
component: dev
commandLine: mvn -DinstallDirectory={{.WLP_INSTALL_PATH}} -Ddebug=false io.openliberty.tools:liberty-maven-plugin:{{liberty-plugin-version}}:dev
commandLine: {{.MAVEN_CMD}} -DinstallDirectory={{.WLP_INSTALL_PATH}} -Ddebug=false io.openliberty.tools:liberty-maven-plugin:{{liberty-plugin-version}}:dev
workingDir: /projects
hotReloadCapable: true
group:
Expand All @@ -71,7 +71,7 @@ commands:
- id: debug
exec:
component: dev
commandLine: mvn -DinstallDirectory={{.WLP_INSTALL_PATH}} -DdebugPort=${DEBUG_PORT} io.openliberty.tools:liberty-maven-plugin:{{liberty-plugin-version}}:dev -Dliberty.env.WLP_DEBUG_REMOTE=y
commandLine: {{.MAVEN_CMD}} -DinstallDirectory={{.WLP_INSTALL_PATH}} -DdebugPort=${DEBUG_PORT} io.openliberty.tools:liberty-maven-plugin:{{liberty-plugin-version}}:dev -Dliberty.env.WLP_DEBUG_REMOTE=y
workingDir: /projects
hotReloadCapable: true
group:
Expand All @@ -81,7 +81,7 @@ commands:
# The 'test' command requires an already active container. Multi-module apps require compilation prior to test processing.
exec:
component: dev
commandLine: mvn compiler:compile failsafe:integration-test failsafe:verify
commandLine: {{.MAVEN_CMD}} compiler:compile failsafe:integration-test failsafe:verify
workingDir: /projects
hotReloadCapable: true
group:
Expand Down
13 changes: 7 additions & 6 deletions src/image/maven/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN yum install --disableplugin=subscription-manager -y https://dl.fedoraproject
# Maven install
ARG MAVEN_VERSION={{.MAVEN_VERSION}}
ARG SHA={{.MAVEN_SHA}}
ARG MAVEN_REPO_LOCAL={{.MAVEN_REPO_LOCAL}}
ARG BASE_URL=https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/

RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
Expand Down Expand Up @@ -50,7 +51,7 @@ ENV LIBERTY_RUNTIME_VERSION={{.LIBERTY_RUNTIME_VERSION}}
ENV LIBERTY_RUNTIME_ARTIFACTID={{.LIBERTY_RUNTIME_ARTIFACTID}}
ENV LIBERTY_RUNTIME_GROUPID={{.LIBERTY_RUNTIME_GROUPID}}

RUN umask -S u=rwx,g=rwx,o=rx; mvn -B -e -DserverName=tmp -Dmaven.repo.local=/mvn/repository -Dliberty.runtime.version=${LIBERTY_RUNTIME_VERSION} -Dliberty.runtime.artifactid=${LIBERTY_RUNTIME_ARTIFACTID} -Dliberty.runtime.groupid=${LIBERTY_RUNTIME_GROUPID} -DskipITs=true install
RUN umask -S u=rwx,g=rwx,o=rx; mvn -B -e -DserverName=tmp -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dliberty.runtime.version=${LIBERTY_RUNTIME_VERSION} -Dliberty.runtime.artifactid=${LIBERTY_RUNTIME_ARTIFACTID} -Dliberty.runtime.groupid=${LIBERTY_RUNTIME_GROUPID} -DskipITs=true install

# A hack maybe but there's quite a few dependencies that only are detected when dev mode is executed, due to use of mojo executor, etc.
#
Expand All @@ -72,15 +73,15 @@ RUN umask -S u=rwx,g=rwx,o=rx; mvn -B -e -DserverName=tmp -Dmaven.repo.local=/mv
#
# Done sleeping

RUN nohup bash -c "umask -S u=rwx,g=rwx,o=rx; mvn -B -e -DserverName=tmp -Dmaven.repo.local=/mvn/repository -Dliberty.runtime.version=${LIBERTY_RUNTIME_VERSION} -Dliberty.runtime.artifactid=${LIBERTY_RUNTIME_ARTIFACTID} -Dliberty.runtime.groupid=${LIBERTY_RUNTIME_GROUPID} io.openliberty.tools:liberty-maven-plugin:{{.LIBERTY_MAVEN_PLUGIN_VERSION}}:dev -DhotTests=true &" \
RUN nohup bash -c "umask -S u=rwx,g=rwx,o=rx; mvn -B -e -DserverName=tmp -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dliberty.runtime.version=${LIBERTY_RUNTIME_VERSION} -Dliberty.runtime.artifactid=${LIBERTY_RUNTIME_ARTIFACTID} -Dliberty.runtime.groupid=${LIBERTY_RUNTIME_GROUPID} io.openliberty.tools:liberty-maven-plugin:{{.LIBERTY_MAVEN_PLUGIN_VERSION}}:dev -DhotTests=true &" \
&& sleep 600 \
&& echo && echo "Done sleeping" && echo

# Cache dependencies associated with the previous major version of the microprofile APIs and OL microprofile features.
RUN umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=/mvn/repository -Dtransitive=true -Dartifact=io.openliberty.features:microProfile-3.3:${LIBERTY_RUNTIME_VERSION}:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=/mvn/repository -Dtransitive=true -Dartifact=org.eclipse.microprofile:microprofile:3.3:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=/mvn/repository -Dtransitive=true -Dartifact=io.openliberty.features:microProfile-4.0:${LIBERTY_RUNTIME_VERSION}:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=/mvn/repository -Dtransitive=true -Dartifact=org.eclipse.microprofile:microprofile:4.0:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get
RUN umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dtransitive=true -Dartifact=io.openliberty.features:microProfile-3.3:${LIBERTY_RUNTIME_VERSION}:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dtransitive=true -Dartifact=org.eclipse.microprofile:microprofile:3.3:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dtransitive=true -Dartifact=io.openliberty.features:microProfile-4.0:${LIBERTY_RUNTIME_VERSION}:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dtransitive=true -Dartifact=org.eclipse.microprofile:microprofile:4.0:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get

# Delete the server, users will create their own server
RUN rm -rf /stacks/java-openliberty/primer/jaxrs/target/liberty/wlp/usr/servers/tmp
Expand Down
13 changes: 7 additions & 6 deletions stack/open-liberty/image/maven/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN yum install --disableplugin=subscription-manager -y https://dl.fedoraproject
# Maven install
ARG MAVEN_VERSION=3.8.4
ARG SHA=a9b2d825eacf2e771ed5d6b0e01398589ac1bfa4171f36154d1b5787879605507802f699da6f7cfc80732a5282fd31b28e4cd6052338cbef0fa1358b48a5e3c8
ARG MAVEN_REPO_LOCAL=/mvn/repository
ARG BASE_URL=https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/

RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
Expand Down Expand Up @@ -50,7 +51,7 @@ ENV LIBERTY_RUNTIME_VERSION=21.0.0.12
ENV LIBERTY_RUNTIME_ARTIFACTID=openliberty-runtime
ENV LIBERTY_RUNTIME_GROUPID=io.openliberty

RUN umask -S u=rwx,g=rwx,o=rx; mvn -B -e -DserverName=tmp -Dmaven.repo.local=/mvn/repository -Dliberty.runtime.version=${LIBERTY_RUNTIME_VERSION} -Dliberty.runtime.artifactid=${LIBERTY_RUNTIME_ARTIFACTID} -Dliberty.runtime.groupid=${LIBERTY_RUNTIME_GROUPID} -DskipITs=true install
RUN umask -S u=rwx,g=rwx,o=rx; mvn -B -e -DserverName=tmp -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dliberty.runtime.version=${LIBERTY_RUNTIME_VERSION} -Dliberty.runtime.artifactid=${LIBERTY_RUNTIME_ARTIFACTID} -Dliberty.runtime.groupid=${LIBERTY_RUNTIME_GROUPID} -DskipITs=true install

# A hack maybe but there's quite a few dependencies that only are detected when dev mode is executed, due to use of mojo executor, etc.
#
Expand All @@ -72,15 +73,15 @@ RUN umask -S u=rwx,g=rwx,o=rx; mvn -B -e -DserverName=tmp -Dmaven.repo.local=/mv
#
# Done sleeping

RUN nohup bash -c "umask -S u=rwx,g=rwx,o=rx; mvn -B -e -DserverName=tmp -Dmaven.repo.local=/mvn/repository -Dliberty.runtime.version=${LIBERTY_RUNTIME_VERSION} -Dliberty.runtime.artifactid=${LIBERTY_RUNTIME_ARTIFACTID} -Dliberty.runtime.groupid=${LIBERTY_RUNTIME_GROUPID} io.openliberty.tools:liberty-maven-plugin:3.5.1:dev -DhotTests=true &" \
RUN nohup bash -c "umask -S u=rwx,g=rwx,o=rx; mvn -B -e -DserverName=tmp -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dliberty.runtime.version=${LIBERTY_RUNTIME_VERSION} -Dliberty.runtime.artifactid=${LIBERTY_RUNTIME_ARTIFACTID} -Dliberty.runtime.groupid=${LIBERTY_RUNTIME_GROUPID} io.openliberty.tools:liberty-maven-plugin:3.5.1:dev -DhotTests=true &" \
&& sleep 600 \
&& echo && echo "Done sleeping" && echo

# Cache dependencies associated with the previous major version of the microprofile APIs and OL microprofile features.
RUN umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=/mvn/repository -Dtransitive=true -Dartifact=io.openliberty.features:microProfile-3.3:${LIBERTY_RUNTIME_VERSION}:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=/mvn/repository -Dtransitive=true -Dartifact=org.eclipse.microprofile:microprofile:3.3:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=/mvn/repository -Dtransitive=true -Dartifact=io.openliberty.features:microProfile-4.0:${LIBERTY_RUNTIME_VERSION}:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=/mvn/repository -Dtransitive=true -Dartifact=org.eclipse.microprofile:microprofile:4.0:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get
RUN umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dtransitive=true -Dartifact=io.openliberty.features:microProfile-3.3:${LIBERTY_RUNTIME_VERSION}:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dtransitive=true -Dartifact=org.eclipse.microprofile:microprofile:3.3:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dtransitive=true -Dartifact=io.openliberty.features:microProfile-4.0:${LIBERTY_RUNTIME_VERSION}:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dtransitive=true -Dartifact=org.eclipse.microprofile:microprofile:4.0:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get

# Delete the server, users will create their own server
RUN rm -rf /stacks/java-openliberty/primer/jaxrs/target/liberty/wlp/usr/servers/tmp
Expand Down
13 changes: 7 additions & 6 deletions stack/websphere-liberty/image/maven/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN yum install --disableplugin=subscription-manager -y https://dl.fedoraproject
# Maven install
ARG MAVEN_VERSION=3.8.4
ARG SHA=a9b2d825eacf2e771ed5d6b0e01398589ac1bfa4171f36154d1b5787879605507802f699da6f7cfc80732a5282fd31b28e4cd6052338cbef0fa1358b48a5e3c8
ARG MAVEN_REPO_LOCAL=/mvn/repository
ARG BASE_URL=https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/

RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
Expand Down Expand Up @@ -50,7 +51,7 @@ ENV LIBERTY_RUNTIME_VERSION=21.0.0.12
ENV LIBERTY_RUNTIME_ARTIFACTID=wlp-javaee8
ENV LIBERTY_RUNTIME_GROUPID=com.ibm.websphere.appserver.runtime

RUN umask -S u=rwx,g=rwx,o=rx; mvn -B -e -DserverName=tmp -Dmaven.repo.local=/mvn/repository -Dliberty.runtime.version=${LIBERTY_RUNTIME_VERSION} -Dliberty.runtime.artifactid=${LIBERTY_RUNTIME_ARTIFACTID} -Dliberty.runtime.groupid=${LIBERTY_RUNTIME_GROUPID} -DskipITs=true install
RUN umask -S u=rwx,g=rwx,o=rx; mvn -B -e -DserverName=tmp -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dliberty.runtime.version=${LIBERTY_RUNTIME_VERSION} -Dliberty.runtime.artifactid=${LIBERTY_RUNTIME_ARTIFACTID} -Dliberty.runtime.groupid=${LIBERTY_RUNTIME_GROUPID} -DskipITs=true install

# A hack maybe but there's quite a few dependencies that only are detected when dev mode is executed, due to use of mojo executor, etc.
#
Expand All @@ -72,15 +73,15 @@ RUN umask -S u=rwx,g=rwx,o=rx; mvn -B -e -DserverName=tmp -Dmaven.repo.local=/mv
#
# Done sleeping

RUN nohup bash -c "umask -S u=rwx,g=rwx,o=rx; mvn -B -e -DserverName=tmp -Dmaven.repo.local=/mvn/repository -Dliberty.runtime.version=${LIBERTY_RUNTIME_VERSION} -Dliberty.runtime.artifactid=${LIBERTY_RUNTIME_ARTIFACTID} -Dliberty.runtime.groupid=${LIBERTY_RUNTIME_GROUPID} io.openliberty.tools:liberty-maven-plugin:3.5.1:dev -DhotTests=true &" \
RUN nohup bash -c "umask -S u=rwx,g=rwx,o=rx; mvn -B -e -DserverName=tmp -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dliberty.runtime.version=${LIBERTY_RUNTIME_VERSION} -Dliberty.runtime.artifactid=${LIBERTY_RUNTIME_ARTIFACTID} -Dliberty.runtime.groupid=${LIBERTY_RUNTIME_GROUPID} io.openliberty.tools:liberty-maven-plugin:3.5.1:dev -DhotTests=true &" \
&& sleep 600 \
&& echo && echo "Done sleeping" && echo

# Cache dependencies associated with the previous major version of the microprofile APIs and OL microprofile features.
RUN umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=/mvn/repository -Dtransitive=true -Dartifact=io.openliberty.features:microProfile-3.3:${LIBERTY_RUNTIME_VERSION}:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=/mvn/repository -Dtransitive=true -Dartifact=org.eclipse.microprofile:microprofile:3.3:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=/mvn/repository -Dtransitive=true -Dartifact=io.openliberty.features:microProfile-4.0:${LIBERTY_RUNTIME_VERSION}:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=/mvn/repository -Dtransitive=true -Dartifact=org.eclipse.microprofile:microprofile:4.0:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get
RUN umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dtransitive=true -Dartifact=io.openliberty.features:microProfile-3.3:${LIBERTY_RUNTIME_VERSION}:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dtransitive=true -Dartifact=org.eclipse.microprofile:microprofile:3.3:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dtransitive=true -Dartifact=io.openliberty.features:microProfile-4.0:${LIBERTY_RUNTIME_VERSION}:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
&& umask -S u=rwx,g=rwx,o=rx; mvn -B -e -Dmaven.repo.local=${MAVEN_REPO_LOCAL} -Dtransitive=true -Dartifact=org.eclipse.microprofile:microprofile:4.0:pom -DrepoUrl=https://repo1.maven.org/maven2/ org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get

# Delete the server, users will create their own server
RUN rm -rf /stacks/java-openliberty/primer/jaxrs/target/liberty/wlp/usr/servers/tmp
Expand Down
58 changes: 58 additions & 0 deletions test/inner-loop/basic-mvnw-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

# Basic inner loop test using the devfile-stack-intro application.
echo -e "\n> Basic inner loop test"

# Variables.
RUNTIME="$1"
BUILD_TYPE="$2"
BASE_DIR=$(pwd)
RUNTIME_DIR="open-liberty"
WLP_INSTALL_PATH="/opt/ol/wlp"

mkdir inner-loop-test-dir
cd inner-loop-test-dir

echo -e "\n> Clone devfile-stack-intro project"
git clone https://github.com/OpenLiberty/devfile-stack-intro.git
cd devfile-stack-intro
mvn -N io.takari:maven:0.7.7:wrapper

echo -e "\n> Process build tool specific actions"
if [ "$RUNTIME" = "wl" ]; then
RUNTIME_DIR="websphere-liberty"
WLP_INSTALL_PATH="/opt/ibm/wlp"
fi

if [ "$BUILD_TYPE" = "gradle" ]; then
cp "${BASE_DIR}"/stack/"${RUNTIME_DIR}"/devfiles/gradle/devfile.yaml devfile.yaml
WLP_INSTALL_PATH=/projects/build/wlp
else
cp "${BASE_DIR}"/stack/"${RUNTIME_DIR}"/devfiles/maven/devfile.yaml devfile.yaml
sed -i 's/mvn/\.\/mvnw/' devfile.yaml
fi

# This is a workaround to avoid surefire fork failures when running
# the GHA test suite.
# Issue #138 has been opened to track and address this
# add the -DforkCount arg to the odo test cmd only for this run
echo -e "\n> Modifying the odo test command"
sed -i 's/failsafe:integration-test/-DforkCount=0 failsafe:integration-test/' devfile.yaml

echo -e "\n Updated devfile contents:"
cat devfile.yaml

echo -e "\n> Base Inner loop test run"
BASE_WORK_DIR="$BASE_DIR" \
COMP_NAME=my-ol-component \
PROJ_NAME=inner-loop-test \
LIBERTY_SERVER_LOGS_DIR_PATH="${WLP_INSTALL_PATH}"/usr/servers/defaultServer/logs \
"${BASE_DIR}"/test/inner-loop/base-inner-loop.sh

rc="$?"
if [ "$rc" -ne 0 ]; then
exit 12
fi

echo -e "\n> Cleanup: Delete created directories"
cd "$BASE_DIR"; rm -rf inner-loop-test-dir
Loading