Skip to content

Commit

Permalink
[9.100.x-prod] kie-issues#1207: serverless-workflow-diagram-editor ge…
Browse files Browse the repository at this point in the history
…t ECONNREFUSED on bootstrap with a proxy (#21)

* Run partial bootstrap for sonataflow-quarkus-devui only (#13)

* Add empty relativePath to maven-base (#14)

* Add kiegroup repository owner condition (#10)

* mvn-config

* Fixes comment: #19 (comment)

* Exclude @kie-tools/dmn-marshaller-backend-compatibility-tester from the
build
  • Loading branch information
fantonangeli authored May 16, 2024
1 parent 7489665 commit 0716d7f
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 194 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

jobs:
sync-main:
if: github.repository_owner == 'kiegroup'
name: Sync main branch
runs-on: ubuntu-latest

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/upstream-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

jobs:
sync-main-apache:
if: github.repository_owner == 'kiegroup'
name: Sync main-apache branch
runs-on: ubuntu-latest

Expand Down
143 changes: 5 additions & 138 deletions packages/serverless-workflow-diagram-editor/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,144 +20,11 @@
const buildEnv = require("./env");
const { setup } = require("@kie-tools/maven-config-setup-helper");

const fs = require("fs").promises;
const path = require("path");
const download = require("mvn-artifact-download").default;
const AdmZip = require("adm-zip");

const stunner_lienzo_path = "kie-wb-common-stunner/kie-wb-common-stunner-client/kie-wb-common-stunner-lienzo/";
const tempPath = stunner_lienzo_path + "target/external-deps";
const resources_path =
stunner_lienzo_path + "src/main/resources/org/kie/workbench/common/stunner/client/lienzo/resources";

setup(`
-Drevision=${buildEnv.env.swfDiagramEditor.version}
-Duberfire.version=${buildEnv.env.swfDiagramEditor.UBERFIRE__version}
-Dfont_awesome.version=${buildEnv.env.swfDiagramEditor.FONT_AWESOME__version}
-Dgwtbootstrap3.version=${buildEnv.env.swfDiagramEditor.GWTBOOTSTRAP3__version}
-Dbootstrap.version=${buildEnv.env.swfDiagramEditor.BOOTSTRAP__version}
-Danimate_css.version=${buildEnv.env.swfDiagramEditor.ANIMATE_CSS__version}
`);

console.info("[serverless-workflow-diagram-editor] Download maven resources...");

const artifacts = new Map([
[
{
groupId: "org.uberfire",
artifactId: "uberfire-workbench-client-views-patternfly",
version: buildEnv.env.swfDiagramEditor.UBERFIRE__version,
},
[
{
path: "org/uberfire/client/views/static/js/patternfly.min.js",
type: "js",
},
{
path: "org/uberfire/client/views/static/bootstrap-select/js/bootstrap-select.min.js",
type: "js",
},
{
path: "org/uberfire/client/views/static/css/patternfly-additions.min.css",
type: "css",
},
{
path: "org/uberfire/client/views/static/css/patternfly.min.css",
type: "css",
},
{
path: "org/uberfire/client/views/static/uberfire-patternfly.css",
type: "css",
},
],
],
[
{
groupId: "org.webjars",
artifactId: "font-awesome",
version: buildEnv.env.swfDiagramEditor.FONT_AWESOME__version,
},
[
{
path:
"META-INF/resources/webjars/font-awesome/" +
buildEnv.env.swfDiagramEditor.FONT_AWESOME__version +
"/css/font-awesome.min.css",
type: "css",
},
],
],
[
{
groupId: "org.gwtbootstrap3",
artifactId: "gwtbootstrap3",
version: buildEnv.env.swfDiagramEditor.GWTBOOTSTRAP3__version,
},
[
{
path: "org/gwtbootstrap3/client/resource/js/jquery-1.12.4.min.cache.js",
type: "js",
},
{
path: "org/gwtbootstrap3/client/resource/js/gwtbootstrap3.js",
type: "js",
},
],
],
[
{
groupId: "org.webjars",
artifactId: "bootstrap",
version: buildEnv.env.swfDiagramEditor.BOOTSTRAP__version,
},
[
{
path:
"META-INF/resources/webjars/bootstrap/" +
buildEnv.env.swfDiagramEditor.BOOTSTRAP__version +
"/js/bootstrap.min.js",
type: "js",
},
],
],
[
{
groupId: "org.webjars",
artifactId: "animate.css",
version: buildEnv.env.swfDiagramEditor.ANIMATE_CSS__version,
},
[
{
path:
"META-INF/resources/webjars/animate.css/" +
buildEnv.env.swfDiagramEditor.ANIMATE_CSS__version +
"/animate.min.css",
type: "css",
},
],
],
]);

processMavenDependencies();

async function prepareFolders() {
try {
await fs.mkdir(tempPath, { recursive: true });
await fs.mkdir(resources_path + "/js", { recursive: true });
await fs.mkdir(resources_path + "/css", { recursive: true });
} catch (err) {
console.error(err);
}
}

async function processMavenDependencies() {
await prepareFolders(tempPath);
artifacts.forEach((resources, artifact) => {
download(artifact, tempPath).then((jarPath) => {
var zip = new AdmZip(jarPath);
resources.forEach((resource) => {
let fileName = path.basename(resource.path);
if (resource.type === "js") {
zip.extractEntryTo(resource.path, resources_path + "/js/", false, true, false, fileName + ".noproc");
} else if (resource.type === "css") {
zip.extractEntryTo(resource.path, resources_path + "/css/", false, true);
}
});
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,107 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-external-dependencies</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/external-deps</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-workbench-client-views-patternfly</artifactId>
<version>${uberfire.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.webjars</groupId>
<artifactId>font-awesome</artifactId>
<version>${font_awesome.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.gwtbootstrap3</groupId>
<artifactId>gwtbootstrap3</artifactId>
<version>${gwtbootstrap3.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>${bootstrap.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.webjars</groupId>
<artifactId>animate.css</artifactId>
<version>${animate_css.version}</version>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<id>rename-files</id>
<phase>process-resources</phase>
<goals>
<goal>rename</goal>
</goals>
<configuration>
<fileSets>
<fileSet>
<sourceFile>${project.build.directory}/external-deps/org/uberfire/client/views/static/js/patternfly.min.js</sourceFile>
<destinationFile>${project.basedir}/src/main/resources/org/kie/workbench/common/stunner/client/lienzo/resources/js/patternfly.min.js.noproc</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/external-deps/org/uberfire/client/views/static/bootstrap-select/js/bootstrap-select.min.js</sourceFile>
<destinationFile>${project.basedir}/src/main/resources/org/kie/workbench/common/stunner/client/lienzo/resources/js/bootstrap-select.min.js.noproc</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/external-deps/org/gwtbootstrap3/client/resource/js/jquery-1.12.4.min.cache.js</sourceFile>
<destinationFile>${project.basedir}/src/main/resources/org/kie/workbench/common/stunner/client/lienzo/resources/js/jquery-1.12.4.min.cache.js.noproc</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/external-deps/org/gwtbootstrap3/client/resource/js/gwtbootstrap3.js</sourceFile>
<destinationFile>${project.basedir}/src/main/resources/org/kie/workbench/common/stunner/client/lienzo/resources/js/gwtbootstrap3.js.noproc</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/external-deps/META-INF/resources/webjars/bootstrap/${bootstrap.version}/js/bootstrap.min.js</sourceFile>
<destinationFile>${project.basedir}/src/main/resources/org/kie/workbench/common/stunner/client/lienzo/resources/js/bootstrap.min.js.noproc</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/external-deps/org/uberfire/client/views/static/css/patternfly-additions.min.css</sourceFile>
<destinationFile>${project.basedir}/src/main/resources/org/kie/workbench/common/stunner/client/lienzo/resources/css/patternfly-additions.min.css</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/external-deps/org/uberfire/client/views/static/css/patternfly.min.css</sourceFile>
<destinationFile>${project.basedir}/src/main/resources/org/kie/workbench/common/stunner/client/lienzo/resources/css/patternfly.min.css</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/external-deps/org/uberfire/client/views/static/uberfire-patternfly.css</sourceFile>
<destinationFile>${project.basedir}/src/main/resources/org/kie/workbench/common/stunner/client/lienzo/resources/css/uberfire-patternfly.css</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/external-deps/META-INF/resources/webjars/font-awesome/${font_awesome.version}/css/font-awesome.min.css</sourceFile>
<destinationFile>${project.basedir}/src/main/resources/org/kie/workbench/common/stunner/client/lienzo/resources/css/font-awesome.min.css</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/external-deps/META-INF/resources/webjars/animate.css/${animate_css.version}/animate.min.css</sourceFile>
<destinationFile>${project.basedir}/src/main/resources/org/kie/workbench/common/stunner/client/lienzo/resources/css/animate.min.css</destinationFile>
</fileSet>
</fileSets>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down
2 changes: 0 additions & 2 deletions packages/serverless-workflow-diagram-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
"devDependencies": {
"@kie-tools/maven-config-setup-helper": "workspace:*",
"@kie-tools/root-env": "workspace:*",
"adm-zip": "^0.5.10",
"cpr": "^3.0.1",
"mvn-artifact-download": "6.1.1",
"rimraf": "^3.0.2",
"run-script-os": "^1.1.6",
"symlink-dir": "^5.0.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/sonataflow-quarkus-devui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
</goals>
<configuration>
<skip>${skip.ui.build}</skip>
<arguments>-F serverless-workflow-dev-ui-webapp... build:prod</arguments>
<arguments>-F serverless-workflow-dev-ui-webapp... !@kie-tools/dmn-marshaller-backend-compatibility-tester build:prod</arguments>
<environmentVariables>
<KIE_TOOLS_BUILD__runTests>false</KIE_TOOLS_BUILD__runTests>
<KIE_TOOLS_BUILD__runIntegrationTests>false</KIE_TOOLS_BUILD__runIntegrationTests>
Expand Down
Loading

0 comments on commit 0716d7f

Please sign in to comment.