ソースを参照

[bitnami/wildfly] Adapt WildFly tests to Air-gapped environments (#18208)

* [bitnami/wildfly] Adapt WildFly tests to Air-gapped environments

Signed-off-by: Jota Martos <jotamartos@vmware.com>

* [bitnami/wildfly] Bump chart for testing purposes

Signed-off-by: Jota Martos <jotamartos@vmware.com>

* [bitnami/wildfly] Fix linter

Signed-off-by: Jota Martos <jotamartos@vmware.com>

* Revert "[bitnami/wildfly] Bump chart for testing purposes"

This reverts commit 65a2f1277bf1c271f3c2403ae5631c50a54129fc.

Signed-off-by: Jota Martos <jotamartos@vmware.com>

* [bitnami/wildfly] Update REAME file

Signed-off-by: Jota Martos <jotamartos@vmware.com>

---------

Signed-off-by: Jota Martos <jotamartos@vmware.com>
Juan José Martos 2 年 前
コミット
90853e42d8

+ 1 - 1
.vib/wildfly/goss/goss.yaml

@@ -9,6 +9,6 @@ file:
     owner: root
 command:
   jboss-deploy:
-    exec: jboss-cli.sh --controller=wildfly:{{ .Vars.service.ports.mgmt }} --connect --user={{ .Vars.wildflyUsername }} --password='{{ .Vars.wildflyPassword }}' 'deploy /bitnami/wildfly/helloworld.war --force'
+    exec: jboss-cli.sh --controller=wildfly:{{ .Vars.service.ports.mgmt }} --connect --user={{ .Vars.wildflyUsername }} --password='{{ .Vars.wildflyPassword }}' 'deploy ./wildfly/goss/testfiles/helloworld.war --force'
     exit-status: 0
     timeout: 10000

+ 8 - 0
.vib/wildfly/goss/testfiles/README.md

@@ -0,0 +1,8 @@
+# How to update this folder
+
+* Build the helloworld.war file by executing these commands
+
+```bash
+cd .vib/wildfly/goss/testfiles
+docker run --rm --entrypoint=/bin/bash -v .:/app bitnami/java:11 /app/helloworld.sh WILDFLY_VERSION
+```

+ 21 - 0
.vib/wildfly/goss/testfiles/helloworld.sh

@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# Script to help you generate the helloworld.war file using the bitnami/java:11 docker image
+#
+MAVEN_VERSION=3.8.6
+APP_VERSION=${1:-}
+if [ -z "${APP_VERSION}" ]; then
+    echo "Usage: $(basename "$0") APP_VERSION"
+    exit 1
+fi
+
+cd /opt/bitnami
+install_packages curl ca-certificates
+curl -L "https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz" -o /opt/bitnami/maven.tar.gz
+tar -xzf /opt/bitnami/maven.tar.gz
+export PATH="/opt/bitnami/apache-maven-${MAVEN_VERSION}/bin:$PATH"
+curl -L "https://github.com/wildfly/quickstart/archive/refs/tags/${APP_VERSION}.Final.tar.gz" -o /opt/bitnami/wildfly-quickstart.tar.gz
+tar -xzf /opt/bitnami/wildfly-quickstart.tar.gz
+cd /opt/bitnami/quickstart-${APP_VERSION}.Final/helloworld
+mvn clean package
+cp "/opt/bitnami/quickstart-${APP_VERSION}.Final/helloworld/target/helloworld.war" "/app/helloworld.war"

BIN
.vib/wildfly/goss/testfiles/helloworld.war


+ 0 - 27
.vib/wildfly/runtime-parameters.yaml

@@ -1,33 +1,6 @@
 wildflyUsername: user
 wildflyPassword: ComplicatedPassword123!4
 exposeManagementConsole: true
-initContainers:
- # This initContainer builds the sample helloworld.war artifact
- # from the official wildfly/quickstart repository. This is
- # then mounted into de WildFly container to verify the
- # server can deploy a war file.
- - name: build-war
-   image: bitnami/java:11
-   securityContext:
-     runAsUser: 0
-   env:
-     - name: MAVEN_VERSION
-       value: 3.8.6
-     - name: APP_VERSION
-       value: "{{ .Chart.AppVersion }}"
-   command: ['bash', '-c', "cd /opt/bitnami && \
-     install_packages curl ca-certificates && \
-     curl -L \"https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz\" -o /opt/bitnami/maven.tar.gz && \
-     tar -xzf /opt/bitnami/maven.tar.gz && \
-     export PATH=\"/opt/bitnami/apache-maven-${MAVEN_VERSION}/bin:$PATH\" && \
-     curl -L \"https://github.com/wildfly/quickstart/archive/refs/tags/${APP_VERSION}.Final.tar.gz\" -o /opt/bitnami/wildfly-quickstart.tar.gz && \
-     tar -xzf /opt/bitnami/wildfly-quickstart.tar.gz && \
-     cd /opt/bitnami/quickstart-${APP_VERSION}.Final/helloworld && \
-     mvn clean package && \
-     cp /opt/bitnami/quickstart-${APP_VERSION}.Final/helloworld/target/helloworld.war /bitnami/wildfly/helloworld.war"]
-   volumeMounts:
-     - name: data
-       mountPath: /bitnami/wildfly
 service:
   type: LoadBalancer
   ports: