ricardozanini commented on code in PR #2697:
URL: 
https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1821422715


##########
packages/kogito-db-migrator-tool-image/resources/kogito-db-migrator-tool-image.yaml:
##########
@@ -0,0 +1,49 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/kogito-db-migrator-tool"

Review Comment:
   ```suggestion
   name: "docker.io/apache/incubator-kie-kogito-db-migrator-tool"
   ```



##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

Review Comment:
   You can copy from this file: 
https://github.com/apache/incubator-kie-tools/blob/main/packages/kogito-data-index-ephemeral-image/install.js



##########
packages/kogito-db-migrator-tool-image/env/index.js:
##########
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { varsWithName, composeEnv, getOrDefault } = 
require("@kie-tools-scripts/build-env");
+
+const rootEnv = require("@kie-tools/root-env/env");
+
+module.exports = composeEnv([rootEnv], {
+  vars: varsWithName({
+    KOGITO_DB_MIGRATOR_TOOL_IMAGE__registry: {
+      default: "docker.io",
+      description: "The image registry.",
+    },
+    KOGITO_DB_MIGRATOR_TOOL_IMAGE__account: {
+      default: "apache",
+      description: "The image registry account.",
+    },
+    KOGITO_DB_MIGRATOR_TOOL_IMAGE__name: {
+      default: "kogito-db-migrator-tool",

Review Comment:
   ```suggestion
         default: "incubator-kie-kogito-db-migrator-tool",
   ```



##########
packages/kogito-db-migrator-tool/package.json:
##########
@@ -0,0 +1,38 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools";,
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git";
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues";
+  },
+  "scripts": {
+    "build:dev": "pnpm pre-build && mvn clean install -DskipTests 
-Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "build:prod": "pnpm pre-build && mvn clean install -DskipTests=$(build-env 
tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) 
-Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup": "pnpm cleanup-drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup-ddl-dirs": "rimraf src/main/resources/ansi && rimraf 
src/main/resources/postgresql",
+    "cleanup-drop-jar": "rimraf /tmp/kogito-db-migrator-tool/ && mkdir -p 
/tmp/kogito-db-migrator-tool",
+    "drop-jar": "cp target/sonataflow-db-migrator-0.0.0-runner.jar 
/tmp/kogito-db-migrator-tool",

Review Comment:
   Instead, we can copy this jar in the image `package.json` from the `target` 
directory. Also, we are not using `uber-jar` for images, but `quarkus-app` 
instead.



##########
packages/kogito-db-migrator-tool-image/package.json:
##########
@@ -0,0 +1,38 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool-image",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools";,
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git";
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues";
+  },
+  "scripts": {
+    "build": "pnpm copy-assets && pnpm image:build && rimraf build && rimraf 
target && rimraf dist-tests-e2e",
+    "build:dev": "pnpm build",
+    "build:prod": "pnpm build",
+    "copy-assets": "run-script-os",
+    "copy-assets:linux:darwin": "rimraf build && cp -R 
./node_modules/@kie-tools/sonataflow-image-common/resources build && cp -R 
resources/* build",
+    "format": "prettier --write . --ignore-path=../../.prettierignore 
--ignore-path=../../.gitignore",
+    "image:build": "run-script-os",
+    "image:build:darwin:linux": "pnpm setup:env && 
./resources/build-container-image.sh",
+    "image:build:win32": "echo \"Build skipped on Windows\"",
+    "install": "node install.js && pnpm format",
+    "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && 
cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoDbMigratorToolImage.registry) 
KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoDbMigratorToolImage.account) 
KOGITO_IMAGE_NAME=$(build-env kogitoDbMigratorToolImage.name) 
KOGITO_IMAGE_TAG=$(build-env kogitoDbMigratorToolImage.buildTag) 
QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) 
KOGITO_VERSION=$(build-env versions.kogito)"
+  },
+  "dependencies": {
+    "@kie-tools/kogito-db-migrator-tool": "workspace:*",
+    "@kie-tools/python-venv": "workspace:*",
+    "@kie-tools/root-env": "workspace:*",
+    "@kie-tools/sonataflow-image-common": "workspace:*",
+    "cross-env": "^7.0.3",
+    "replace-in-file": "^7.1.0",
+    "rimraf": "^3.0.2",
+    "run-script-os": "^1.1.6"

Review Comment:
   These are devDependencies, see: 
https://github.com/apache/incubator-kie-tools/blob/main/packages/kogito-data-index-ephemeral-image/package.json#L35-L43



##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,165 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
https://maven.apache.org/xsd/maven-4.0.0.xsd";
+  xmlns="http://maven.apache.org/POM/4.0.0";
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-flyway</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-jdbc-postgresql</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-arc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-junit5</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-junit-jupiter</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.github.stefanbirkner</groupId>
+      <artifactId>system-rules</artifactId>
+      <version>${version.com.github.stefanbirkner.systemrules}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <testSourceDirectory>src/test/java</testSourceDirectory>
+    <plugins>
+      <!-- Use mvn dependency:unpack command to unzip ddl files and mvn 
dependency:copy to copy into destination -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>3.8.1</version>

Review Comment:
   This version must come from `maven-base`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to