Skip to content

Commit 14d6877

Browse files
committed
Thorntail -> Quarkus
1 parent 0df9b50 commit 14d6877

File tree

158 files changed

+1951
-1493
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+1951
-1493
lines changed

.circleci/config.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,37 +22,38 @@ jobs:
2222
curl -X POST -i -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer $GITTER_TOKEN" \
2323
"https://api.gitter.im/v1/rooms/$GITTER_ROOM_ID/chatMessages" -d \
2424
"{\"text\":\"Automatic message: Hello, new [build]($CIRCLE_BUILD_URL) has started.\"}"
25-
- run: if [[ ! -d ${HOME}/jdk-11.0.9+11 ]];then wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.9%2B11/OpenJDK11U-jdk_x64_linux_hotspot_11.0.9_11.tar.gz;fi;
26-
- run: if [[ ! -d ${HOME}/jdk-11.0.9+11 ]];then tar -xvf OpenJDK11U-jdk_x64_linux_hotspot_11.0.9_11.tar.gz -C ${HOME}/;fi;
25+
- run: if [[ ! -d ${HOME}/jdk-11.0.14.1+1 ]];then wget https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14.1%2B1/OpenJDK11U-jdk_x64_linux_hotspot_11.0.14.1_1.tar.gz;fi;
26+
- run: if [[ ! -d ${HOME}/jdk-11.0.14.1+1 ]];then tar -xvf OpenJDK11U-jdk_x64_linux_hotspot_11.0.14.1_1.tar.gz -C ${HOME}/;fi;
27+
# Don't forget that various severs need maven for testing, e.g. Tomee etc.
2728
- run: if [[ ! -d ${HOME}/apache-maven-3.6.3 ]];then wget https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz;fi;
2829
- run: if [[ ! -d ${HOME}/apache-maven-3.6.3 ]];then tar -xvf apache-maven-3.6.3-bin.tar.gz -C ${HOME}/;fi;
2930
- run:
3031
name: build-fetch
3132
command: |
32-
export PATH=${HOME}/apache-maven-3.6.3/bin:${HOME}/jdk-11.0.9+11/bin:${PATH}; \
33-
export JAVA_HOME=${HOME}/jdk-11.0.9+11/; \
34-
mvn -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 dependency:go-offline -Pthorntail -Dskip.integration.tests=false
33+
export JAVA_HOME=${HOME}/jdk-11.0.14.1+1/; \
34+
mkdir -p ~/.m2/; \
35+
cp ./Container/settings.xml ~/.m2/settings.xml; \
36+
./mvnw dependency:go-offline
3537
- save_cache:
3638
paths:
3739
- ${HOME}/.m2
3840
- ${HOME}/apache-maven-3.6.3
39-
- ${HOME}/jdk-11.0.9+11
41+
- ${HOME}/jdk-11.0.14.1+1
4042
key: v1-dependencies-{{ checksum "pom.xml" }}
4143
- run:
4244
name: package-tests
4345
no_output_timeout: 120000
4446
command: |
45-
export PATH=${HOME}/apache-maven-3.6.3/bin:${HOME}/jdk-11.0.9+11/bin:${PATH}; \
46-
export JAVA_HOME=${HOME}/jdk-11.0.9+11/; \
47+
export PATH=${HOME}/apache-maven-3.6.3/bin:${HOME}/jdk-11.0.14.1+1/bin:${PATH}; \
48+
export JAVA_HOME=${HOME}/jdk-11.0.14.1+1/; \
4749
export WLP_JAR_EXTRACT_DIR=${HOME}; \
48-
mvn -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 clean package -Pthorntail \
50+
./mvnw clean package \
4951
'-Dtest=#w*' '-Dtest=#q*' '-Dtest=#t*' '-Dtest=#k*' '-Dtest=#h*' '-Dtest=#p*' \
50-
-Dskip.integration.tests=false -DSTARTER_TS_WORKSPACE=/dev/shm/
52+
-DSTARTER_TS_WORKSPACE=/dev/shm/
5153
- persist_to_workspace:
5254
root: .
5355
paths:
54-
- ./target/mp-starter-hollow-thorntail.jar
55-
- ./target/mp-starter.war
56+
- ./target/quarkus-app
5657
- ./Container
5758

5859
docker-build:
@@ -64,11 +65,11 @@ jobs:
6465
- run:
6566
name: Prepare files for Docker build
6667
command: |
67-
cp /tmp/workspace/Container . -R && cp /tmp/workspace/target . -R && unzip target/mp-starter-hollow-thorntail.jar -d target/mp-starter-hollow-thorntail
68+
cp /tmp/workspace/Container . -R && cp /tmp/workspace/target . -R
6869
- run:
6970
name: Build Docker image
7071
command: |
71-
docker build -f Container/Dockerfile -t $IMAGE_NAME:master .
72+
docker build -f ./Container/Dockerfile.jvm -t $IMAGE_NAME:master .
7273
- run:
7374
name: Archive built Docker image
7475
command: docker save -o image.tar $IMAGE_NAME

.github/workflows/main.yml

Lines changed: 51 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@ env:
3131

3232
jobs:
3333
run-units:
34-
name: API MicroProfile Starter
35-
runs-on: ubuntu-20.04
34+
name: API and WEB smoke test - ${{ matrix.os }}
35+
runs-on: ${{ matrix.os }}
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
os: [ ubuntu-20.04, windows-2019 ]
3640
steps:
3741
- uses: actions/checkout@v2
3842
with:
@@ -61,23 +65,32 @@ jobs:
6165
with:
6266
maven-version: 3.6.3
6367
- name: Build and run tests for Starter
68+
if: startsWith(matrix.os, 'windows')
69+
run: |
70+
cmd /C mvn --version
71+
cmd /C mvnw.cmd --version
72+
cmd /C java --version
73+
copy Container\settings.xml ~\.m2\settings.xml
74+
cmd /C mvnw.cmd clean verify -Dtest=APIITCase -DSTARTER_TS_WORKSPACE=%RUNNER_TEMP%
75+
shell: cmd
76+
- name: Build and run tests for Starter
77+
if: startsWith(matrix.os, 'ubuntu')
6478
run: |
6579
mvn --version
80+
./mvnw --version
6681
java --version
67-
mvn clean verify -Pthorntail -Dtest=APITest -DSTARTER_TS_WORKSPACE=$RUNNER_TEMP
68-
- name: Prepare failure archive (if maven failed)
69-
if: failure()
70-
shell: bash
71-
run: find . -type d -name '*-reports' -o -name "*.log" | tar -czf test-reports-apitest.tgz -T -
72-
- name: Upload failure Archive (if maven failed)
73-
uses: actions/upload-artifact@v2
74-
if: failure()
82+
mkdir -p ~/.m2/
83+
cp ./Container/settings.xml ~/.m2/settings.xml
84+
./mvnw clean verify -Dtest=APIITCase -DSTARTER_TS_WORKSPACE=$RUNNER_TEMP
85+
- uses: actions/upload-artifact@v3
86+
if: always()
7587
with:
76-
name: test-reports-apitest
77-
path: 'test-reports-apitest.tgz'
88+
name: test-reports-apitest-${{ matrix.os }}
89+
path: |
90+
target/surefire-reports
7891
run-starter:
79-
name: ${{ matrix.runtime }} MicroProfile Starter
80-
runs-on: ubuntu-20.04
92+
name: ${{ matrix.runtime }} - ${{ matrix.os }}
93+
runs-on: ${{ matrix.os }}
8194
strategy:
8295
fail-fast: false
8396
matrix:
@@ -89,6 +102,7 @@ jobs:
89102
'thorntail',
90103
'tomee',
91104
'wildfly' ]
105+
os: [ ubuntu-20.04, windows-2019 ]
92106
steps:
93107
- uses: actions/checkout@v2
94108
with:
@@ -117,17 +131,30 @@ jobs:
117131
with:
118132
maven-version: 3.6.3
119133
- name: Build and run tests for Starter
134+
if: startsWith(matrix.os, 'windows')
135+
# We run only a subset of tests on Windows, the "All" (all examples selected variant)
136+
# Due to notorious instabilities in file locking in ~/.m2 on GitHub Actions runners.
137+
# It might take some of the server's processes to release those locks.
138+
run: |
139+
cmd /C mvn --version
140+
cmd /C mvnw.cmd --version
141+
cmd /C java --version
142+
copy Container\settings.xml ~\.m2\settings.xml
143+
cmd /C mvnw.cmd clean verify -Dtest=TestMatrixITCase#${{ matrix.runtime }}All -DSTARTER_TS_WORKSPACE=%RUNNER_TEMP%
144+
shell: cmd
145+
- name: Build and run tests for Starter
146+
if: startsWith(matrix.os, 'ubuntu')
120147
run: |
121148
mvn --version
149+
./mvnw --version
122150
java --version
123-
mvn clean verify -Pthorntail -Dtest=TestMatrixTest#${{ matrix.runtime }}* -DSTARTER_TS_WORKSPACE=$RUNNER_TEMP
124-
- name: Prepare failure archive (if maven failed)
125-
if: failure()
126-
shell: bash
127-
run: find . -type d -name '*-reports' -o -name "*.log" | tar -czf test-reports-${{ matrix.runtime }}.tgz -T -
128-
- name: Upload failure Archive (if maven failed)
129-
uses: actions/upload-artifact@v2
130-
if: failure()
151+
mkdir -p ~/.m2/
152+
cp ./Container/settings.xml ~/.m2/settings.xml
153+
./mvnw clean verify -Dtest=TestMatrixITCase#${{ matrix.runtime }}* -DSTARTER_TS_WORKSPACE=$RUNNER_TEMP
154+
- uses: actions/upload-artifact@v3
155+
if: always()
131156
with:
132-
name: test-reports-${{ matrix.runtime }}
133-
path: 'test-reports-${{ matrix.runtime }}.tgz'
157+
name: test-reports-${{ matrix.runtime }}-${{ matrix.os }}
158+
path: |
159+
target/surefire-reports
160+
target/archived-logs
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import java.net.*;
21+
import java.io.*;
22+
import java.nio.channels.*;
23+
import java.util.Properties;
24+
25+
public class MavenWrapperDownloader
26+
{
27+
private static final String WRAPPER_VERSION = "3.1.0";
28+
29+
/**
30+
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
31+
*/
32+
private static final String DEFAULT_DOWNLOAD_URL =
33+
"https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/" + WRAPPER_VERSION
34+
+ "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
35+
36+
/**
37+
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to use instead of the
38+
* default one.
39+
*/
40+
private static final String MAVEN_WRAPPER_PROPERTIES_PATH = ".mvn/wrapper/maven-wrapper.properties";
41+
42+
/**
43+
* Path where the maven-wrapper.jar will be saved to.
44+
*/
45+
private static final String MAVEN_WRAPPER_JAR_PATH = ".mvn/wrapper/maven-wrapper.jar";
46+
47+
/**
48+
* Name of the property which should be used to override the default download url for the wrapper.
49+
*/
50+
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
51+
52+
public static void main( String args[] )
53+
{
54+
System.out.println( "- Downloader started" );
55+
File baseDirectory = new File( args[0] );
56+
System.out.println( "- Using base directory: " + baseDirectory.getAbsolutePath() );
57+
58+
// If the maven-wrapper.properties exists, read it and check if it contains a custom
59+
// wrapperUrl parameter.
60+
File mavenWrapperPropertyFile = new File( baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH );
61+
String url = DEFAULT_DOWNLOAD_URL;
62+
if ( mavenWrapperPropertyFile.exists() )
63+
{
64+
FileInputStream mavenWrapperPropertyFileInputStream = null;
65+
try
66+
{
67+
mavenWrapperPropertyFileInputStream = new FileInputStream( mavenWrapperPropertyFile );
68+
Properties mavenWrapperProperties = new Properties();
69+
mavenWrapperProperties.load( mavenWrapperPropertyFileInputStream );
70+
url = mavenWrapperProperties.getProperty( PROPERTY_NAME_WRAPPER_URL, url );
71+
}
72+
catch ( IOException e )
73+
{
74+
System.out.println( "- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'" );
75+
}
76+
finally
77+
{
78+
try
79+
{
80+
if ( mavenWrapperPropertyFileInputStream != null )
81+
{
82+
mavenWrapperPropertyFileInputStream.close();
83+
}
84+
}
85+
catch ( IOException e )
86+
{
87+
// Ignore ...
88+
}
89+
}
90+
}
91+
System.out.println( "- Downloading from: " + url );
92+
93+
File outputFile = new File( baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH );
94+
if ( !outputFile.getParentFile().exists() )
95+
{
96+
if ( !outputFile.getParentFile().mkdirs() )
97+
{
98+
System.out.println( "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath()
99+
+ "'" );
100+
}
101+
}
102+
System.out.println( "- Downloading to: " + outputFile.getAbsolutePath() );
103+
try
104+
{
105+
downloadFileFromURL( url, outputFile );
106+
System.out.println( "Done" );
107+
System.exit( 0 );
108+
}
109+
catch ( Throwable e )
110+
{
111+
System.out.println( "- Error downloading" );
112+
e.printStackTrace();
113+
System.exit( 1 );
114+
}
115+
}
116+
117+
private static void downloadFileFromURL( String urlString, File destination )
118+
throws Exception
119+
{
120+
if ( System.getenv( "MVNW_USERNAME" ) != null && System.getenv( "MVNW_PASSWORD" ) != null )
121+
{
122+
String username = System.getenv( "MVNW_USERNAME" );
123+
char[] password = System.getenv( "MVNW_PASSWORD" ).toCharArray();
124+
Authenticator.setDefault( new Authenticator()
125+
{
126+
@Override
127+
protected PasswordAuthentication getPasswordAuthentication()
128+
{
129+
return new PasswordAuthentication( username, password );
130+
}
131+
} );
132+
}
133+
URL website = new URL( urlString );
134+
ReadableByteChannel rbc;
135+
rbc = Channels.newChannel( website.openStream() );
136+
FileOutputStream fos = new FileOutputStream( destination );
137+
fos.getChannel().transferFrom( rbc, 0, Long.MAX_VALUE );
138+
fos.close();
139+
rbc.close();
140+
}
141+
142+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar

Container/Dockerfile

Lines changed: 0 additions & 11 deletions
This file was deleted.

Container/Dockerfile.CI

Lines changed: 0 additions & 35 deletions
This file was deleted.

Container/Dockerfile.jvm

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM registry.access.redhat.com/ubi8/openjdk-11:1.11
2+
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
3+
COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/
4+
COPY --chown=185 target/quarkus-app/*.jar /deployments/
5+
COPY --chown=185 target/quarkus-app/app/ /deployments/app/
6+
COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/
7+
EXPOSE 8080
8+
USER 185
9+
ENV AB_JOLOKIA_OFF=""
10+
ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
11+
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"

0 commit comments

Comments
 (0)