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

Remove jib from apps-generator plugin #548

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
12 changes: 5 additions & 7 deletions .github/workflows/apps-plugin-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
milestoneVersion:
description: "Milestone version (no dash, eg. 'M1')"
required: true

env:
MAVEN_THREADS: '-T 0.5C'

jobs:
build_deploy_milestone:
if: ${{ github.repository == 'spring-cloud/stream-applications' }}
Expand All @@ -21,8 +17,8 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
java-version: 8
distribution: liberica
- uses: jvalkeal/setup-maven@v1
with:
maven-version: 3.8.8
Expand All @@ -39,6 +35,7 @@ jobs:
restore-keys: |
${{ runner.os }}-m2-
- name: Configure JFrog Cli
shell: bash
run: |
jfrog rt mvnc \
--server-id-resolve=repo.spring.io \
Expand All @@ -50,9 +47,10 @@ jobs:
echo JFROG_CLI_BUILD_NAME=spring-cloud-dataflow-apps-plugin-main-milestone >> $GITHUB_ENV
echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV
- name: Build and Publish
shell: bash
run: |
jfrog rt mvn build-helper:parse-version versions:set \
-gs settings.xml \
-s settings.xml \
-Pstagingmilestone \
-DprocessAllModules=true \
-DgenerateBackupPoms=false \
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/apps-plugin-next-dev-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
java-version: 8
distribution: liberica
- uses: jvalkeal/setup-maven@v1
with:
maven-version: 3.8.8
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
-B
jfrog rt build-clean
mvn clean
jfrog rt mvn -gs settings.xml install -DskipTests -B
jfrog rt mvn -s settings.xml install -DskipTests -B
jfrog rt build-publish
- name: Commit next snapshot version changes
uses: jvalkeal/[email protected]
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/apps-plugin-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: 'CI - PR'

on:
pull_request:
paths-ignore:
- 'applications/**'
- 'stream-applications-build/**'
- 'stream-applications-release-train/**'

env:
MAIN_PATH: 'build-dir'
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_THREADS: 'true'
jobs:
build:
if: github.repository == 'spring-cloud/stream-applications'
runs-on: ubuntu-latest
defaults:
run:
working-directory: spring-cloud-dataflow-apps-plugin
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 8
distribution: liberica
- uses: jvalkeal/setup-maven@v1
with:
maven-version: 3.8.8
maven-mirror: 'https://dlcdn.apache.org/maven/maven-3/'
- uses: jfrog/setup-jfrog-cli@v3
with:
version: 1.46.4
env:
JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-
- name: Build and Publish
shell: bash
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: |
./mvnw -s settings.xml -B install
- name: Capture Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: test-results
path: '**/target/surefire-reports/**/*.*'
retention-days: 7
if-no-files-found: ignore
- name: Clean cache
run: |
find ~/.m2/repository -type d -name '*SNAPSHOT' | xargs rm -fr
8 changes: 3 additions & 5 deletions .github/workflows/apps-plugin-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Apps Plugin (Release)
on:
workflow_dispatch:

env:
MAVEN_THREADS: '-T 0.5C'

jobs:
build_deploy_release:
Expand All @@ -17,8 +15,8 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
java-version: 8
distribution: liberica
- uses: jvalkeal/setup-maven@v1
with:
maven-version: 3.8.8
Expand Down Expand Up @@ -52,7 +50,7 @@ jobs:
- name: Build and Publish
run: |
jfrog rt mvn build-helper:parse-version versions:set \
-gs settings.xml \
-s settings.xml \
-Pstagingrelease \
-DprocessAllModules=true \
-DgenerateBackupPoms=false \
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/apps-plugin-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
java-version: 8
distribution: liberica
- uses: jvalkeal/setup-maven@v1
with:
maven-version: 3.8.8
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Build and Publish
run: |
jfrog rt build-clean
jfrog rt mvn -gs settings.xml -B install
jfrog rt mvn -s settings.xml -B install
jfrog rt build-publish
- name: Capture Test Results
if: ${{ always() }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: 'CI - PR'

on:
pull_request:
paths-ignore:
- 'spring-cloud-dataflow-apps-plugin/**'

env:
MAIN_PATH: 'build-dir'
Expand Down Expand Up @@ -29,7 +31,7 @@ jobs:
if: ${{ github.base_ref != 'main' }}
uses: actions/setup-java@v1
with:
java-version: ${{ needs.parameters.outputs.jdk_build }}
java-version: '8'
- name: 'Configure: Install GraalVM'
if: ${{ github.base_ref == 'main' }}
uses: graalvm/setup-graalvm@v1
Expand All @@ -52,6 +54,8 @@ jobs:
- name: 'Action: verify changed modules'
shell: bash
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
VERBOSE: ${{ github.debug && 'true' || '' }}
run: |
PR=$(echo "${{ github.ref_name }}" | grep -o '[[:digit:]]*')
Expand Down
2 changes: 1 addition & 1 deletion spring-cloud-dataflow-apps-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-apps-plugin-parent</artifactId>
<version>1.0.15-SNAPSHOT</version>
<version>1.1.0-SNAPSHOT</version>
<name>spring-cloud-dataflow-apps-plugin-parent</name>
<description>Spring Cloud Dataflow Apps Plugin Parent</description>
<packaging>pom</packaging>
Expand Down
27 changes: 27 additions & 0 deletions spring-cloud-dataflow-apps-plugin/settings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
<settings>
<servers>
<server>
<id>repo.spring.io</id>
<username>${env.ARTIFACTORY_USERNAME}</username>
<password>${env.ARTIFACTORY_PASSWORD}</password>
</server>
<server>
<id>spring-snapshots</id>
<username>${env.ARTIFACTORY_USERNAME}</username>
<password>${env.ARTIFACTORY_PASSWORD}</password>
</server>
<server>
<id>spring-milestones</id>
<username>${env.ARTIFACTORY_USERNAME}</username>
<password>${env.ARTIFACTORY_PASSWORD}</password>
</server>
<server>
<id>spring-staging</id>
<username>${env.ARTIFACTORY_USERNAME}</username>
<password>${env.ARTIFACTORY_PASSWORD}</password>
</server>
<server>
<id>spring-releases</id>
<username>${env.ARTIFACTORY_USERNAME}</username>
<password>${env.ARTIFACTORY_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>pr</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-apps-plugin-parent</artifactId>
<version>1.0.15-SNAPSHOT</version>
<version>1.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
Expand Down Expand Up @@ -76,10 +77,12 @@ public class ConfigurationMetadataDocumentationMojo extends AbstractMojo {

static final String CONFIGURATION_PROPERTIES_END_TAG = "//end::configuration-properties[]";

private static final Map<String, String> APPTYPE_TO_FUNCTIONTYPE = Map.of(
"source", "supplier",
"processor", "function",
"sink", "consumer");
private static final Map<String, String> APPTYPE_TO_FUNCTIONTYPE = new HashMap<>();
static {
APPTYPE_TO_FUNCTIONTYPE.put("source", "supplier");
APPTYPE_TO_FUNCTIONTYPE.put("processor", "function");
APPTYPE_TO_FUNCTIONTYPE.put("sink", "consumer");
}

private BootApplicationConfigurationMetadataResolver metadataResolver = new BootApplicationConfigurationMetadataResolver(
imageName -> null);
Expand Down Expand Up @@ -166,8 +169,8 @@ private void handleExternalLinkToFunctionsCatalog(Artifact artifact, PrintWriter
String appName = artifactId.substring(0, artifactId.lastIndexOf('-'));
String appType = artifactId.substring(artifactId.lastIndexOf('-') + 1);
String functionType = APPTYPE_TO_FUNCTIONTYPE.get(appType);
String functionName = "spring-%s-%s".formatted(appName, functionType);
String url = "https://github.com/spring-cloud/spring-functions-catalog/tree/main/%s/%s#configuration-options[See Spring Functions Catalog for configuration options].".formatted(functionType, functionName);
String functionName = String.format("spring-%s-%s", appName, functionType);
String url = String.format("https://github.com/spring-cloud/spring-functions-catalog/tree/main/%s/%s#configuration-options[See Spring Functions Catalog for configuration options].", functionType, functionName);
out.println(url);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-apps-plugin-parent</artifactId>
<version>1.0.15-SNAPSHOT</version>
<version>1.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand All @@ -19,7 +19,7 @@
<maven.version>3.9.2</maven.version>
<maven.plugin.version>3.9.0</maven.plugin.version>
<jmustache.version>1.15</jmustache.version>
<spring.version>6.0.8</spring.version>
<spring.version>5.3.36</spring.version>
<commons.io.version>2.12.0</commons.io.version>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,22 @@ public void execute() throws MojoFailureException, MojoExecutionException {
this.global.getApplication().getFunctionDefinition() : this.application.getFunctionDefinition();
app.setFunctionDefinition(applicationFunctionDefinition); //TODO is applicationFunctionDefinition required?

String appBootPluginConfiguration = StringUtils.hasText(this.application.getBootPluginConfiguration()) ?
this.application.getBootPluginConfiguration() : this.global.getApplication().getBootPluginConfiguration();
app.setBootPluginConfiguration(appBootPluginConfiguration);

String appBootExecution = StringUtils.hasText(this.application.getBootExecution()) ?
this.application.getBootExecution() : this.global.getApplication().getBootExecution();
app.setBootExecution(appBootExecution);

Boolean skipNativeTests = this.application.skipNativeTests != null ? this.application.skipNativeTests :
this.global.application.skipNativeTests != null ? this.global.application.skipNativeTests : Boolean.FALSE;
app.setSkipNativeTests(skipNativeTests);

String nativeConfiguration = StringUtils.hasText(this.application.getNativeConfiguration()) ? this.application.getNativeConfiguration() :
this.global.getApplication().getNativeConfiguration();
app.setNativeConfiguration(nativeConfiguration);

String metadataMavenPluginVersion = StringUtils.isEmpty(this.application.getMetadata().getMavenPluginVersion()) ?
this.global.getApplication().getMetadata().getMavenPluginVersion() : this.application.getMetadata().getMavenPluginVersion();
if (StringUtils.isEmpty(metadataMavenPluginVersion)) {
Expand Down Expand Up @@ -306,8 +322,6 @@ else if (StringUtils.hasText(this.global.getApplication().getContainerImage().ge
})
.collect(Collectors.toList());

app.setBootPluginConfiguration(this.application.getBootPluginConfiguration());

// ----------------------------------------------------------------------------------------------------------
// Project Generator
// ----------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -465,6 +479,9 @@ public static class Application {
private final Maven maven = new Maven();

private String bootPluginConfiguration;
private String bootExecution;
private Boolean skipNativeTests;
private String nativeConfiguration;

public String getBootPluginConfiguration() {
return bootPluginConfiguration;
Expand All @@ -474,6 +491,30 @@ public void setBootPluginConfiguration(String bootPluginConfiguration) {
this.bootPluginConfiguration = bootPluginConfiguration;
}

public String getBootExecution() {
return bootExecution;
}

public void setBootExecution(String bootExecution) {
this.bootExecution = bootExecution;
}

public Boolean getSkipNativeTests() {
return skipNativeTests;
}

public void setSkipNativeTests(Boolean skipNativeTests) {
this.skipNativeTests = skipNativeTests;
}

public String getNativeConfiguration() {
return nativeConfiguration;
}

public void setNativeConfiguration(String nativeConfiguration) {
this.nativeConfiguration = nativeConfiguration;
}

public Map<String, String> getProperties() {
return properties;
}
Expand Down Expand Up @@ -631,7 +672,7 @@ public static class ContainerImage {
/**
* Base images to be used by the target container image.
*/
private String baseImage;
private String baseImage = "${project.artifactId}";

/**
* Enable or disable the inclusion of application's metadata into the image's labels.
Expand Down
Loading
Loading