This is an automated email from the ASF dual-hosted git repository.

tiagobento pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git


The following commit(s) were added to refs/heads/main by this push:
     new 3aa7de8e822 NO-ISSUE: Use offline m2 for 
dev-deployment-kogito-quarkus-blank-app-image (#2393)
3aa7de8e822 is described below

commit 3aa7de8e8222c1093ddfc9f6be666f5b277a1160
Author: Thiago Lugli <[email protected]>
AuthorDate: Mon Jun 3 12:48:22 2024 -0300

    NO-ISSUE: Use offline m2 for dev-deployment-kogito-quarkus-blank-app-image 
(#2393)
---
 .../Containerfile                                  |  4 +--
 packages/image-builder/src/bin.ts                  | 41 +++++++++++-----------
 .../settings.xml.envsubst                          |  4 +--
 3 files changed, 25 insertions(+), 24 deletions(-)

diff --git 
a/packages/dev-deployment-kogito-quarkus-blank-app-image/Containerfile 
b/packages/dev-deployment-kogito-quarkus-blank-app-image/Containerfile
index c43d145b81c..37cd0daa263 100644
--- a/packages/dev-deployment-kogito-quarkus-blank-app-image/Containerfile
+++ b/packages/dev-deployment-kogito-quarkus-blank-app-image/Containerfile
@@ -31,7 +31,7 @@ COPY --chown=$USER_ID:$USER_ID dist-dev/settings.xml 
/tmp/kogito/.m2/settings.xm
 
 # Pre-populate local Maven repository for faster startup
 RUN ./mvnw clean package -B --settings /tmp/kogito/.m2/settings.xml 
-Dmaven.test.skip -Dmaven.repo.local=/tmp/kogito/.m2/repository 
-Dquarkus.http.non-application-root-path=${ROOT_PATH}/q 
-Dquarkus.http.root-path=${ROOT_PATH} \
-  && chgrp -R 0 $HOME_PATH/app && chmod -R g=u $HOME_PATH/app && chgrp -R 0 
/tmp/kogito && chmod -R g=u /tmp/kogito && chgrp -R 0 /.m2 && chmod -R g=u /.m2 
&& rm /tmp/kogito/.m2/settings.xml
+  && chgrp -R 0 $HOME_PATH/app && chmod -R g=u $HOME_PATH/app && chgrp -R 0 
/tmp/kogito && chmod -R g=u /tmp/kogito && chgrp -R 0 /.m2 && chmod -R g=u /.m2
 
 USER $USER_ID
 
@@ -39,4 +39,4 @@ EXPOSE 8080
 
 ENTRYPOINT ["/bin/bash", "-c"]
 
-CMD ["dev-deployment-upload-service && cp -r $HOME_PATH/app/. /tmp/app && cd 
/tmp/app && ./mvnw quarkus:dev -Ddebug=false 
-Dmaven.repo.local=/tmp/kogito/.m2/repository 
-Dquarkus.http.non-application-root-path=${ROOT_PATH}/q 
-Dquarkus.http.root-path=${ROOT_PATH}"]
+CMD ["dev-deployment-upload-service && cp -r $HOME_PATH/app/. /tmp/app && cd 
/tmp/app && ./mvnw quarkus:dev -o -s=/tmp/kogito/.m2/settings.xml 
-Dquarkus.analytics.disabled=true -Ddebug=false 
-Dmaven.repo.local=/tmp/kogito/.m2/repository 
-Dquarkus.http.non-application-root-path=${ROOT_PATH}/q 
-Dquarkus.http.root-path=${ROOT_PATH}"]
diff --git a/packages/image-builder/src/bin.ts 
b/packages/image-builder/src/bin.ts
index 2c4f64fdfe6..d5e5f994de2 100644
--- a/packages/image-builder/src/bin.ts
+++ b/packages/image-builder/src/bin.ts
@@ -64,15 +64,15 @@ function getImageFullNames(args: ArgsType) {
 
 function createAndUseDockerBuilder(args: { allowHostNetworkAccess: boolean }) {
   try {
-    console.info("-> Checking for existing kie-tools-builder...");
+    console.info("[image-builder] Checking for existing kie-tools-builder...");
     execSync("docker buildx inspect kie-tools-builder", { stdio: "inherit" });
-    console.info("-> kie-tools-builder found, using it.");
+    console.info("[image-builder] kie-tools-builder found, using it.");
     execSync("docker buildx use kie-tools-builder", { stdio: "inherit" });
   } catch (e) {
-    console.info("- kie-tools-builder not found, creating it.");
+    console.info("[image-builder] kie-tools-builder not found, creating it.");
     execSync(
       `docker buildx create
-        ${args.allowHostNetworkAccess ? "--buildkitd-flags 
'--allow-insecure-entitlement network.host'" : ""}
+        --buildkitd-flags '--allow-insecure-entitlement network.host'
         --name kie-tools-builder
         --driver docker-container
         --bootstrap
@@ -93,7 +93,7 @@ function checkBuildEngine(args: ArgsType) {
       ...shell(),
     });
   } catch (e) {
-    console.log(`Build engine "${args.engine}" not available. Skipping 
build!`);
+    console.log(`[image-builder] Build engine "${args.engine}" not available. 
Skipping build!`);
     return;
   }
 }
@@ -105,16 +105,16 @@ function buildArchImage(args: ArgsType & { arch: "arm64" 
| "amd64" }, imageFullN
   }[args.arch];
 
   createAndUseDockerBuilder({ allowHostNetworkAccess: 
args.allowHostNetworkAccess });
-
-  const buildPlatformCommand = `docker buildx build 
+  console.log(`[image-builder] Building arch image ${args.arch}`);
+  const buildPlatformCommand = `docker buildx build
     ${args.allowHostNetworkAccess ? "--allow network.host --network host" : ""}
     --progress=plain
-    --load 
+    --load
     --platform ${platform}
     ${args.push ? "--push" : ""}
     ${imageFullNames.map((fullName) => `-t ${fullName}`).join(" ")}
     ${args.buildArg.map((arg) => `--build-arg ${arg}`).join(" ")}
-    ${args.context} 
+    ${args.context}
     -f ${args.containerfile}`
     .split("\n")
     .join(" ");
@@ -123,13 +123,14 @@ function buildArchImage(args: ArgsType & { arch: "arm64" 
| "amd64" }, imageFullN
 }
 
 function buildNativeImage(args: ArgsType, imageFullNames: string[]) {
-  const buildNativeCommand = `${args.engine} build 
-    --progress=plain 
+  console.log(`[image-builder] Building native image`);
+  const buildNativeCommand = `${args.engine} build
+    --progress=plain
     ${args.allowHostNetworkAccess ? "--allow network.host --network host" : ""}
-    ${args.push ? "--push" : ""} 
+    ${args.push ? "--push" : ""}
     ${imageFullNames.map((fullName) => `-t ${fullName}`).join(" ")}
-    ${args.buildArg.map((arg) => `--build-arg ${arg}`).join(" ")} 
-    ${args.context} 
+    ${args.buildArg.map((arg) => `--build-arg ${arg}`).join(" ")}
+    ${args.context}
     -f ${args.containerfile}`
     .split("\n")
     .join(" ");
@@ -208,10 +209,10 @@ EOF
 
 async function main() {
   function prettyPrintError(error: Error) {
-    console.error("\x1b[31m%s\x1b[0m", error);
+    console.error("\x1b[31m[image-builder] %s\x1b[0m", error);
   }
   try {
-    const argv = await yargs(hideBin(process.argv))
+    await yargs(hideBin(process.argv))
       .version(false)
       .scriptName("")
       .wrap(Math.min(150, terminalWidth()))
@@ -340,7 +341,7 @@ Also useful to aid on developing images and pushing them to 
Kubernetes/OpenShift
         () => {},
         (args) => {
           console.info(`
-  Building local image.
+[image-builder] Building local image.
     - registry: ${args.registry}
     - account: ${args.account}
     - name: ${args.name}
@@ -368,7 +369,7 @@ Also useful to aid on developing images and pushing them to 
Kubernetes/OpenShift
         () => {},
         (args) => {
           console.info(`
-  Building local image and loading it to Minikube cluster.
+[image-builder] Building local image and loading it to Minikube cluster.
     - registry: ${args.registry}
     - account: ${args.account}
     - name: ${args.name}
@@ -410,7 +411,7 @@ Also useful to aid on developing images and pushing them to 
Kubernetes/OpenShift
         },
         (args) => {
           console.info(`
-  Building local image and loading it to Kind cluster.
+[image-builder] Building local image and loading it to Kind cluster.
     - registry: ${args.registry}
     - account: ${args.account}
     - name: ${args.name}
@@ -451,7 +452,7 @@ Also useful to aid on developing images and pushing them to 
Kubernetes/OpenShift
         () => {},
         (args) => {
           console.info(`
-  Building image on OpenShift cluster.
+[image-builder] Building image on OpenShift cluster.
     - registry: ${args.registry} (ignored)
     - account: ${args.account} (ignored)
     - name: ${args.name}
diff --git a/packages/maven-m2-repo-via-http-image/settings.xml.envsubst 
b/packages/maven-m2-repo-via-http-image/settings.xml.envsubst
index 5579fb17347..e81922637e4 100644
--- a/packages/maven-m2-repo-via-http-image/settings.xml.envsubst
+++ b/packages/maven-m2-repo-via-http-image/settings.xml.envsubst
@@ -28,7 +28,7 @@
           </releases>
           <snapshots>
             <enabled>true</enabled>
-            <updatePolicy>daily</updatePolicy>
+            <updatePolicy>never</updatePolicy>
           </snapshots>
         </repository>
       </repositories>
@@ -45,7 +45,7 @@
           </releases>
           <snapshots>
             <enabled>true</enabled>
-            <updatePolicy>daily</updatePolicy>
+            <updatePolicy>never</updatePolicy>
           </snapshots>
         </pluginRepository>
       </pluginRepositories>


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

Reply via email to