Skip to content

Commit

Permalink
Merge branch 'current' into issue-3851
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem authored Aug 28, 2024
2 parents c3cc937 + 68632e2 commit 8e29856
Show file tree
Hide file tree
Showing 10 changed files with 312 additions and 41 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,4 @@ jobs:
git add .
git commit -a -m "Publishing Maven plugin documentation" || true
git push
41 changes: 41 additions & 0 deletions .github/workflows/docs-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: docs-release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout Piranha
uses: actions/checkout@v3
- name: Checkout Piranha Website
uses: actions/checkout@v3
with:
repository: piranhacloud/piranha-website
token: ${{ secrets.GIT_PASSWORD }}
path: piranha-website
ref: 'gh-pages'
- name: Set up Java 21
uses: actions/setup-java@v3
with:
cache: 'maven'
distribution: 'temurin'
java-version: 21
- name: Build with Maven
run: |
git checkout v${{ github.event.inputs.version }}
cd docs
mvn -B -DskipTests -DskipITs -ntp site
cd ../
rm -rf piranha-website/release || true
mkdir -p piranha-website/release || true
cp -R docs/target/site/* piranha-website/release/
cd piranha-website
git config --global user.email "[email protected]"
git config --global user.name "Automated publish"
git add .
git commit -a -m "Publishing documentation" || true
git push
42 changes: 42 additions & 0 deletions .github/workflows/docs-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: docs-snapshot
on:
push:
paths:
- 'docs/**'
branches:
- 'current'
tags-ignore:
- 'v*'
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout Piranha
uses: actions/checkout@v3
- name: Checkout Piranha Website
uses: actions/checkout@v3
with:
repository: piranhacloud/piranha-website
token: ${{ secrets.GIT_PASSWORD }}
path: piranha-website
ref: 'gh-pages'
- name: Set up Java 21
uses: actions/setup-java@v3
with:
cache: 'maven'
distribution: 'temurin'
java-version: 21
- name: Build with Maven
run: |
cd docs
mvn -B -DskipTests -DskipITs -ntp site
cd ../
rm -rf piranha-website/snapshot || true
mkdir -p piranha-website/snapshot || true
cp -R docs/target/site/* piranha-website/snapshot/
cd piranha-website
git config --global user.email "[email protected]"
git config --global user.name "Automated publish"
git add .
git commit -a -m "Publishing documentation" || true
git push
90 changes: 90 additions & 0 deletions .github/workflows/tck-core-profile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: tck-core-profile
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
annotations:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [ '21' ]
os: [ubuntu-latest]
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@v3
with:
cache: 'maven'
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Setup for TCK
run: mvn -B -DskipTests=true -ntp install
- name: Run TCK
run: |
cd external/tck/coreprofile/annotations
mvn -B -ntp verify
atinject:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [ '21' ]
os: [ubuntu-latest]
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@v3
with:
cache: 'maven'
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Setup for TCK
run: mvn -B -DskipTests=true -ntp install
- name: Run TCK
run: |
cd external/tck/coreprofile/atinject
mvn -B -ntp verify
jsonb:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [ '21' ]
os: [ubuntu-latest]
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@v3
with:
cache: 'maven'
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Setup for TCK
run: mvn -B -DskipTests=true -ntp install
- name: Run TCK
run: |
cd external/tck/coreprofile/jsonb
mvn -B -ntp verify
jsonp:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [ '21' ]
os: [ubuntu-latest]
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@v3
with:
cache: 'maven'
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Setup for TCK
run: mvn -B -DskipTests=true -ntp install
- name: Run TCK
run: |
cd external/tck/coreprofile/jsonp
mvn -B -ntp verify
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.jboss.arquillian.container.spi.client.container.DeployableContainer;
import org.jboss.arquillian.container.spi.client.container.DeploymentException;
import org.jboss.arquillian.container.spi.client.container.LifecycleException;
import org.jboss.arquillian.container.spi.client.protocol.ProtocolDescription;
import org.jboss.arquillian.container.spi.client.protocol.metadata.HTTPContext;
import org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData;
Expand Down Expand Up @@ -89,7 +89,7 @@ public class PiranhaJarContainer implements DeployableContainer<PiranhaJarContai
private File localRepositoryDir = new File(System.getProperty("user.home"), ".m2/repository");

/**
* Stores the process.
* Stores the Piranha process.
*/
private Process process;

Expand All @@ -109,37 +109,14 @@ public void setup(PiranhaJarContainerConfiguration configuration) {
this.configuration = configuration;
}

@Override
public void start() throws LifecycleException {
LOGGER.log(Level.INFO, "Starting server");
}

@Override
public void stop() throws LifecycleException {
LOGGER.log(Level.INFO, "Stopping server");

/*
* Delete the PID file.
*/
File runtimeDirectory = new File(System.getProperty(TMP_DIR));
File pidFile = new File(runtimeDirectory, PID_FILENAME);
if (pidFile.exists()) {
try {
Files.delete(pidFile.toPath());
} catch (IOException ioe) {
LOGGER.log(WARNING, "Unable to delete PID file", ioe);
}
}
}

@Override
public ProtocolDescription getDefaultProtocol() {
return new ProtocolDescription(configuration.getProtocol());
}

@Override
public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException {
LOGGER.log(Level.INFO, "Deploying - " + archive.getName());
LOGGER.log(Level.INFO, "Deploying " + archive.getName());

ProtocolMetaData metadata = new ProtocolMetaData();

Expand All @@ -156,12 +133,12 @@ public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException {
*/
String version = determineVersionToUse();
File piranhaJarFile = getPiranhaJarFile(version);
copyPiranhaCoreProfileJarFile(runtimeDirectory, piranhaJarFile);
copyPiranhaJarFile(runtimeDirectory, piranhaJarFile);

/*
* Start Piranha.
*/
startPiranhaCoreProfile(runtimeDirectory, warFile);
startPiranha(runtimeDirectory, warFile);
} catch (IOException ioe) {
ioe.printStackTrace();
return null;
Expand All @@ -177,7 +154,7 @@ public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException {

@Override
public void undeploy(Archive<?> archive) throws DeploymentException {
LOGGER.log(Level.INFO, "Undeploying - " + archive.getName());
LOGGER.log(Level.INFO, "Undeploying " + archive.getName());

/*
* Delete the PID file.
Expand All @@ -193,11 +170,17 @@ public void undeploy(Archive<?> archive) throws DeploymentException {
}

/*
* Wait for 5 seconds.
* Wait for 5 minutes at the most.
*/
try {
Thread.sleep(5000);
} catch (InterruptedException ie) {
if (process != null && process.isAlive()) {
try {
LOGGER.log(Level.INFO, "Waiting for Piranha to be shutdown");
process.waitFor(5, TimeUnit.MINUTES);
} catch (InterruptedException ie) {
LOGGER.log(Level.WARNING, "Piranha did not shutdown within time alloted");
LOGGER.log(Level.WARNING, "Destroying Piranha process forcibly");
process.destroyForcibly();
}
}

/*
Expand Down Expand Up @@ -329,12 +312,12 @@ private String determineVersionToUse() {
}

/**
* Start and wait for Piranha Core Profile.
* Start Piranha.
*
* @param runtimeDirectory the runtime directory.
* @param warFilename the WAR filename.
*/
private void startPiranhaCoreProfile(
private void startPiranha(
File runtimeDirectory,
File warFilename)
throws IOException {
Expand Down Expand Up @@ -364,15 +347,14 @@ private void startPiranhaCoreProfile(

File pidFile = new File(runtimeDirectory, PID_FILENAME);
int count = 0;
LOGGER.log(Level.INFO, "Waiting for Piranha to be ready ");
LOGGER.log(Level.INFO, "Waiting for Piranha to be ready");
while (!pidFile.exists()) {
try {
Thread.sleep(500);
count++;
LOGGER.log(Level.INFO, ".");
} catch (InterruptedException ie) {
}
if (count == 80) {
if (count == 600) {
LOGGER.log(Level.WARNING, "Warning, PID file not seen!");
break;
}
Expand All @@ -386,12 +368,12 @@ private void startPiranhaCoreProfile(
}

/**
* Copy the Piranha Core Profile JAR file.
* Copy the Piranha JAR file.
*
* @param runtimeDirectory the runtime directory.
* @param zipFile the zip file.
*/
private void copyPiranhaCoreProfileJarFile(File runtimeDirectory, File zipFile) throws IOException {
private void copyPiranhaJarFile(File runtimeDirectory, File zipFile) throws IOException {
if (!runtimeDirectory.exists() && !runtimeDirectory.mkdirs()) {
System.err.println(UNABLE_TO_CREATE_DIRECTORIES);
}
Expand Down
2 changes: 1 addition & 1 deletion arquillian/jarcontainer/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
provides LoadableExtension with PiranhaJarContainerExtension;
requires arquillian.container.spi;
requires arquillian.core.spi;
requires shrinkwrap.api;
requires free.port.finder;
requires shrinkwrap.api;
}
36 changes: 36 additions & 0 deletions docs/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cloud.piranha.docs</groupId>
<version>24.9.0-SNAPSHOT</version>
<artifactId>project</artifactId>
<packaging>pom</packaging>
<name>Piranha</name>
<url>https://github.com/piranhacloud/piranha</url>
<organization>
<name>Piranha Cloud</name>
<url>https://piranha.cloud</url>
</organization>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.20.0</version>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.6.2</version>
<reportSets>
<reportSet/>
</reportSets>
</plugin>
</plugins>
</reporting>
</project>
Loading

0 comments on commit 8e29856

Please sign in to comment.