Skip to content

Commit

Permalink
Bump versions; fix unit tests on some platforms; add buildx cross pla…
Browse files Browse the repository at this point in the history
…tform testing
  • Loading branch information
jjlauer committed Jan 10, 2025
1 parent 799c45e commit 6b3d64b
Show file tree
Hide file tree
Showing 10 changed files with 192 additions and 18 deletions.
7 changes: 7 additions & 0 deletions .blaze/blaze.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
blaze.dependencies = [
"com.fizzed:blaze-ssh"
"com.fizzed:buildx:1.2.0"
"com.fizzed:jne:4.3.0"
]

java.source.version = 8
49 changes: 40 additions & 9 deletions .blaze/blaze.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@

import com.fizzed.blaze.Config;
import com.fizzed.blaze.Contexts;
import static com.fizzed.blaze.Contexts.fail;
import static com.fizzed.blaze.Systems.exec;
import static com.fizzed.blaze.Systems.which;
import static java.util.Arrays.asList;

import com.fizzed.blaze.Task;
import com.fizzed.buildx.Buildx;
import com.fizzed.buildx.Target;
import org.slf4j.Logger;

import java.nio.file.Path;
import java.util.List;

public class blaze {
private final Logger log = Contexts.logger();
private final Config config = Contexts.config();
Expand Down Expand Up @@ -39,35 +47,58 @@ public void test_deploy() {
public void demo_launcher() {
exec("mvn", "package", "-DskipTests=true", "-am", "-pl", "stork-cli").run();
exec("stork-launcher", "-o", "target/stork-fake", "stork-cli/src/main/launchers")
.path("stork-cli/target/stork/bin")
.workingDir("stork-cli/target/stork/bin")
.run();
}

public void demo_deploy() {
String host = getTestHost(true);
exec("mvn", "package", "-DskipTests=true", "-am", "-pl", "stork-cli").run();
exec("stork-deploy", "-a", "stork-deploy/src/test/resources/fixtures/hello-console-1.2.4.tar.gz", "vagrant+ssh://" + host)
.path("stork-cli/target/stork/bin")
.workingDir("stork-cli/target/stork/bin")
.run();
}

public void demo_hellod() {
exec("mvn", "package", "-DskipTests=true", "-am", "-pl", "stork-demo/stork-demo-hellod").run();
exec("stork-demo-hellod", "--run")
final Path command = which("stork-demo-hellod")
.path("stork-demo/stork-demo-hellod/target/stork/bin")
.arg("8888")
.arg("a")
.arg("b")
.env("EXTRA_JAVA_ARGS", "-Da=1")
.run();
exec(command, "--run")
.run();
}

public void demo_dropwizard() {
exec("mvn", "package", "-DskipTests=true", "-am", "-pl", "stork-demo/stork-demo-dropwizard").run();
exec("stork-demo-dropwizard", "--run")
final Path command = which("stork-demo-dropwizard")
.path("stork-demo/stork-demo-dropwizard/target/stork/bin")
.run();
exec(command, "--run")
.env("EXTRA_JAVA_ARGS", "-Da=1")
.run();
}

private final List<Target> crossTestTargets = asList(
new Target("linux", "x64").setTags("test").setHost("bmh-build-x64-linux-latest"),
new Target("linux", "arm64").setTags("test").setHost("bmh-build-arm64-linux-latest"),
new Target("linux", "riscv64").setTags("test").setHost("bmh-build-riscv64-linux-latest"),
new Target("linux_musl", "x64").setTags("test").setHost("bmh-build-x64-linux-musl-latest"),
new Target("macos", "x64").setTags("test").setHost("bmh-build-x64-macos-latest"),
new Target("macos", "arm64").setTags("test").setHost("bmh-build-arm64-macos-latest"),
new Target("windows", "x64").setTags("test").setHost("bmh-build-x64-windows-latest"),
//new Target("windows", "arm64").setTags("test").setHost("bmh-build-arm64-windows-latest"),
new Target("freebsd", "x64").setTags("test").setHost("bmh-build-x64-freebsd-latest"),
new Target("openbsd", "x64").setTags("test").setHost("bmh-build-x64-openbsd-latest")
);

@Task(order = 53)
public void cross_tests() throws Exception {
new Buildx(crossTestTargets)
.tags("test")
.execute((target, project) -> {
project.action("mvn", "clean", "test")
.run();
});
}

}
79 changes: 79 additions & 0 deletions .blaze/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>blaze</groupId>
<artifactId>stork-blaze</artifactId>
<version>0.0.1</version>

<!--
THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT BY HAND!
Edit or create a <blaze-script>.conf file, and re-run the generate-maven-project command.
-->

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.install.skip>true</maven.install.skip>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
<build>
<sourceDirectory>${project.basedir}</sourceDirectory>
</build>
<dependencies>
<dependency>
<groupId>org.apache.ivy</groupId>
<artifactId>ivy</artifactId>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>blaze-core</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.16.1</version>
</dependency>
<dependency>
<groupId>com.typesafe</groupId>
<artifactId>config</artifactId>
<version>1.4.3</version>
</dependency>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>blaze-ivy</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.13</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.13</version>
</dependency>
<dependency>
<groupId>org.zeroturnaround</groupId>
<artifactId>zt-exec</artifactId>
<version>1.12</version>
</dependency>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>blaze-ssh</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>buildx</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>jne</artifactId>
<version>4.3.0</version>
</dependency>
</dependencies>
</project>
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
target
.vagrant
*.iml
*.iml
.buildx
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

[![Maven Central](https://img.shields.io/maven-central/v/com.fizzed/stork?color=blue&style=flat-square)](https://mvnrepository.com/artifact/com.fizzed/stork)

## Automated Testing

The following Java versions and platforms are tested using GitHub workflows:

[![Java 8](https://img.shields.io/github/actions/workflow/status/fizzed/stork/java8.yaml?branch=master&label=Java%208&style=flat-square)](https://github.com/fizzed/stork/actions/workflows/java8.yaml)
[![Java 11](https://img.shields.io/github/actions/workflow/status/fizzed/stork/java11.yaml?branch=master&label=Java%2011&style=flat-square)](https://github.com/fizzed/stork/actions/workflows/java11.yaml)
[![Java 17](https://img.shields.io/github/actions/workflow/status/fizzed/stork/java17.yaml?branch=master&label=Java%2017&style=flat-square)](https://github.com/fizzed/stork/actions/workflows/java17.yaml)
Expand All @@ -11,6 +15,16 @@
[![MacOS arm64](https://img.shields.io/github/actions/workflow/status/fizzed/stork/macos-arm64.yaml?branch=master&label=MacOS%20arm64&style=flat-square)](https://github.com/fizzed/stork/actions/workflows/macos-arm64.yaml)
[![Windows x64](https://img.shields.io/github/actions/workflow/status/fizzed/stork/windows-x64.yaml?branch=master&label=Windows%20x64&style=flat-square)](https://github.com/fizzed/stork/actions/workflows/windows-x64.yaml)

The following platforms are tested using the [Fizzed, Inc.](http://fizzed.com) build system:

[![Linux arm64](https://img.shields.io/badge/Linux%20arm64-passing-green)](buildx-results.txt)
[![Linux riscv64](https://img.shields.io/badge/Linux%20riscv64-passing-green)](buildx-results.txt)
[![Linux MUSL x64](https://img.shields.io/badge/Linux%20MUSL%20x64-passing-green)](buildx-results.txt)
[![MacOS x64](https://img.shields.io/badge/MacOS%20x64-passing-green)](buildx-results.txt)
[![Windows arm64](https://img.shields.io/badge/Windows%20arm64-passing-green)](buildx-results.txt)
[![FreeBSD x64](https://img.shields.io/badge/FreeBSD%20x64-passing-green)](buildx-results.txt)
[![OpenBSD x64](https://img.shields.io/badge/OpenBSD%20x64-passing-green)](buildx-results.txt)

## Overview

So you've engineered that amazing Java-based application. Then what? Distributing
Expand Down
Binary file modified blaze.jar
Binary file not shown.
16 changes: 16 additions & 0 deletions buildx-results.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Buildx Results
--------------
Cross platform tests use the Buildx project: https://github.com/fizzed/buildx
Commit: 799c45ef004dbde1c096f4bbc200de21526b1f5e
Date: 2025-01-10T22:06:16.765612Z[UTC]

linux-x64 success
linux-arm64 success
linux-riscv64 success
linux_musl-x64 success
macos-x64 success
macos-arm64 success
windows-x64 success
freebsd-x64 success
openbsd-x64 success

25 changes: 18 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>com.fizzed</groupId>
<artifactId>stork</artifactId>
<packaging>pom</packaging>
<version>3.1.4-SNAPSHOT</version>
Expand All @@ -10,7 +9,7 @@
<parent>
<groupId>com.fizzed</groupId>
<artifactId>maven-parent</artifactId>
<version>2.2.1</version>
<version>2.7.0</version>
</parent>

<scm>
Expand All @@ -20,15 +19,14 @@
</scm>

<properties>
<java.version>1.7</java.version>
<java.version>1.8</java.version>
<main.java.package />
<!-- workaround travis ci maven version requirement -->
<maven.enforce.version>3.2.5</maven.enforce.version>
<jackson.version>2.8.1</jackson.version>
<jackson.version>2.14.1</jackson.version>
<slf4j.version>1.7.21</slf4j.version>
<blaze.version>1.0.2</blaze.version>
<crux.version>1.0.40</crux.version>
<gradle.version>4.0</gradle.version>
<blaze.version>1.6.0</blaze.version>
<crux.version>1.0.48</crux.version>
</properties>

<modules>
Expand All @@ -44,6 +42,19 @@
<module>stork-demo/stork-demo-dropwizard</module>
</modules>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<reuseForks>false</reuseForks>
</configuration>
</plugin>
</plugins>
</build>

<dependencyManagement>
<dependencies>

Expand Down
14 changes: 14 additions & 0 deletions stork-demo/stork-demo-dropwizard/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@
<artifactId>logback-classic</artifactId>
<scope>runtime</scope>
</dependency>

<!-- API, java.xml.bind module -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
</dependency>

<!-- Runtime, com.sun.xml.bind module -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
</dependency>

<!-- testing -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ public String execute(int exitValue, Path exe, Map<String,String> environment, S
.args((Object[]) args)
.exitValue(exitValue)
.pipeOutput(captureOutput)
.pipeError(captureOutput);
.pipeError(captureOutput)
.pipeInput(Streamables.nullInput());

if (environment != null) {
for (Map.Entry<String,String> entry : environment.entrySet()) {
Expand Down

0 comments on commit 6b3d64b

Please sign in to comment.