Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
setlocal DisableDelayedExpansion
rem This script is only for internal usage and should not be invoked directly by users from the command line.
rem This script launches the operation to apply a candidate server installation to update or revert.
rem The server JVM writes the required values into the installation-manager.properties file by using InstMgrCandidateStatus.java
rem The server JVM writes the required values into the _installation-manager_helper.properties file by using InstMgrCandidateStatus.java

if "%INST_MGR_SCRIPT_DEBUG%"=="true" (
@echo on
Expand All @@ -22,7 +22,7 @@ set INST_MGR_STATUS=

echo %date% %time% INFO %LOG_NAME% - Executing Management CLI Installer script.

set "PROPS_FILE=%INSTALLATION_HOME%\bin\installation-manager.properties"
set "PROPS_FILE=%INSTALLATION_HOME%\.installation\_installation-manager_helper.properties"
if not exist "%PROPS_FILE%" (
echo %date% %time% ERROR %LOG_NAME% - Installation Manager properties file not found at %PROPS_FILE%.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This script is only for internal usage and should not be invoked directly by users from the command line.
# This script launches the operation to apply a candidate server installation to update or revert.
# The server JVM writes the required values into the installation-manager.properties file by using InstMgrCandidateStatus.java
# The server JVM writes the required values into the _installation-manager_helper.properties file by using InstMgrCandidateStatus.java
param (
[Parameter(Mandatory=$true)]
[string]$installationHome,
Expand Down Expand Up @@ -32,7 +32,7 @@ Write-Log -Level "INFO" -Message "Executing Management CLI Installer script."
Set-Variable -Name INST_MGR_COMMAND -Scope Script
Set-Variable -Name INST_MGR_STATUS -Scope Script

$propsFile="$installationHome\bin\installation-manager.properties"
$propsFile="$installationHome\.installation\_installation-manager_helper.properties"
if ($propsFile -eq $null) {
Write-Log -Level "ERROR" -Message "Installation Manager properties file not found at $propsFile."
exit 1
Expand Down Expand Up @@ -112,4 +112,4 @@ catch {
Write-Log -Level "ERROR" -Message "An unknown error occurred trying to launch the installation manager."
}

exit 1
exit 1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# This script is only for internal usage and should not be invoked directly by the users from the command line.
# This script launches the operation to apply a candidate server installation to update or revert.
# The server JVM writes the required values into the installation-manager.properties file by using InstMgrCandidateStatus.java
# The server JVM writes the required values into the _installation-manager_helper.properties file by using InstMgrCandidateStatus.java
if [ "x${INST_MGR_SCRIPT_DEBUG}" = "xtrue" ]; then
set -x
fi
Expand All @@ -17,27 +17,27 @@ unset INST_MGR_STATUS
LOG_NAME="[management-cli-installer]"

log() {
echo "$(date "+%Y-%m-%d %H:%M:%S,%3N") ${1} $LOG_NAME - ${2}"
echo "$(date "+%Y-%m-%d %H:%M:%S,%3N") ${1} $LOG_NAME - ${2}"
}

log "INFO" "Executing Management CLI Installer script."

PROPS_FILE="${INSTALLATION_HOME}/bin/installation-manager.properties"
PROPS_FILE="${INSTALLATION_HOME}/.installation/_installation-manager_helper.properties"
if ! [ -e "${PROPS_FILE}" ]; then
log "ERROR" "Installation Manager properties file not found at ${PROPS_FILE}."
exit 1
fi

while IFS='=' read -r key value; do
case "${key}" in
"#"*) continue ;;
*) export "${key}=${value}" ;;
esac
done < "$PROPS_FILE"
case "${key}" in
"#"*) continue ;;
*) export "${key}=${value}" ;;
esac
done <"$PROPS_FILE"

if [ "x${INST_MGR_STATUS}" = "x" ]; then
log "ERROR" "Cannot read the Installation Manager status."
exit 1
log "ERROR" "Cannot read the Installation Manager status."
exit 1
fi

if ! [ "${INST_MGR_STATUS}" = "PREPARED" ]; then
Expand All @@ -46,8 +46,8 @@ if ! [ "${INST_MGR_STATUS}" = "PREPARED" ]; then
fi

if [ "x${INST_MGR_COMMAND}" = "x" ]; then
log "ERROR" "Installation Manager command was not set."
exit 1
log "ERROR" "Installation Manager command was not set."
exit 1
fi

export JAVA_OPTS="-Dlogging.configuration=file:\"${INST_MGR_LOG_PROPERTIES}\" -Dorg.jboss.boot.log.file=\"${INST_MGR_LOG_FILE}\" -Dorg.wildfly.prospero.log.file -Dstdout.encoding=UTF-8 -Dstderr.encoding=UTF-8 ${JAVA_OPTS}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ Function Start-WildFly-Process {
} elseif ($LastExitCode -eq 20) { # :shutdown(perform-installation=true) was called
Write-Host "INFO: Starting Candidate Server installation using Management CLI Installer script"
$instMgrOutFile="$JBOSS_LOG_DIR\management-cli-installer-out.log"
& "$JBOSS_HOME\bin\installation-manager.ps1" -installationHome "$JBOSS_HOME" -instMgrLogProperties "$logFileProperties" -instMgrLogFile "$logFile" *>&1 | Out-File -FilePath $instMgrOutFile -Append -Encoding UTF8
& "$JBOSS_HOME\.installation\_installation-manager_helper.ps1" -installationHome "$JBOSS_HOME" -instMgrLogProperties "$logFileProperties" -instMgrLogFile "$logFile" *>&1 | Out-File -FilePath $instMgrOutFile -Append -Encoding UTF8
if ($LastExitCode -eq 0) {
Write-Host "INFO: Candidate Server installation completed successfully."
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ if %errorlevel% equ 20 (

setlocal EnableDelayedExpansion
set "INST_MGR_CONSOLE_FILE=!JBOSS_LOG_DIR!\management-cli-installer-out.log"
call "!JBOSS_HOME!\bin\installation-manager.bat" "!JBOSS_HOME!" "!JBOSS_CONFIG_DIR!\logging.properties" "!JBOSS_LOG_DIR!\host-controller.log" >> "!INST_MGR_CONSOLE_FILE!" 2>&1
call "!JBOSS_HOME!\.installation\_installation-manager_helper.bat" "!JBOSS_HOME!" "!JBOSS_CONFIG_DIR!\logging.properties" "!JBOSS_LOG_DIR!\host-controller.log" >> "!INST_MGR_CONSOLE_FILE!" 2>&1
if !ERRORLEVEL! equ 0 (
echo INFO: Candidate Server installation completed successfully.
) else (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ while true; do
elif [ "$JBOSS_STATUS" -eq 20 ]; then
echo "INFO: Starting Candidate Server installation using Management CLI Installer script"
INST_MGR_CONSOLE_FILE="${JBOSS_LOG_DIR}/management-cli-installer-out.log"
"${JBOSS_HOME}/bin/installation-manager.sh" "${JBOSS_HOME}" "${JBOSS_CONFIG_DIR}/logging.properties" "${JBOSS_LOG_DIR}/host-controller.log" >> "${INST_MGR_CONSOLE_FILE}" 2>&1
"${JBOSS_HOME}/.installation/_installation-manager_helper.sh" "${JBOSS_HOME}" "${JBOSS_CONFIG_DIR}/logging.properties" "${JBOSS_LOG_DIR}/host-controller.log" >> "${INST_MGR_CONSOLE_FILE}" 2>&1
if [ $? -eq 0 ]; then
echo "INFO: Candidate Server installation completed successfully."
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ if %errorlevel% equ 20 (

setlocal EnableDelayedExpansion
set "INST_MGR_CONSOLE_FILE=!JBOSS_LOG_DIR!\management-cli-installer-out.log"
call "!JBOSS_HOME!\bin\installation-manager.bat" "!JBOSS_HOME!" "!JBOSS_CONFIG_DIR!\logging.properties" "!JBOSS_LOG_DIR!\server.log" >> "!INST_MGR_CONSOLE_FILE!" 2>&1
call "!JBOSS_HOME!\.installation\_installation-manager_helper.bat" "!JBOSS_HOME!" "!JBOSS_CONFIG_DIR!\logging.properties" "!JBOSS_LOG_DIR!\server.log" >> "!INST_MGR_CONSOLE_FILE!" 2>&1
if !ERRORLEVEL! equ 0 (
echo INFO: Candidate Server installation completed successfully.
) else (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ while true; do
elif [ "$JBOSS_STATUS" -eq 20 ]; then
echo "INFO: Starting Candidate Server installation using Management CLI Installer script"
INST_MGR_CONSOLE_FILE="${JBOSS_LOG_DIR}/management-cli-installer-out.log"
"${JBOSS_HOME}/bin/installation-manager.sh" "${JBOSS_HOME}" "${JBOSS_CONFIG_DIR}/logging.properties" "${JBOSS_LOG_DIR}/server.log" >> "${INST_MGR_CONSOLE_FILE}" 2>&1
"${JBOSS_HOME}/.installation/_installation-manager_helper.sh" "${JBOSS_HOME}" "${JBOSS_CONFIG_DIR}/logging.properties" "${JBOSS_LOG_DIR}/server.log" >> "${INST_MGR_CONSOLE_FILE}" 2>&1
if [ $? -eq 0 ]; then
echo "INFO: Candidate Server installation completed successfully."
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
<!-- Unstable API Annotation Index -->
<package name="org.wildfly._internal.unstable-api-annotation-index" optional="true" valid-for-stability="preview" />
<package name="org.wildfly.unstable.annotation.api.indexer" optional="true" valid-for-stability="preview" />
<package name=".installation"/>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jfdenise We are adding this new .installation directory under the standard galleon content directory, so I understand there is an auto discovery done by Galleon and a new package, named ".installation" is created out of the box.

My question is more about design than functionality. Under which circumstances should we count on this auto discovery of package names instead of creating our own dedicated package name?

I only can think of having a maybe better package name, but I am not sure

</packages>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
<!-- Unstable API Annotation Index -->
<package name="org.wildfly._internal.unstable-api-annotation-index" optional="true" valid-for-stability="preview" />
<package name="org.wildfly.unstable.annotation.api.indexer" optional="true" valid-for-stability="preview" />
<package name=".installation"/>
</packages>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
<permission value="664">
<filter pattern="*.properties" include="true"/>
</permission>
<permission value="700">
<filter pattern="*/.installation" include="true"/>
</permission>
<permission value="600">
<filter pattern="*-users.properties" include="true"/>
<filter pattern="*-roles.properties" include="true"/>
<filter pattern="*-groups.properties" include="true"/>
<filter pattern="*/.installation" include="true"/>
</permission>
</file-permissions>
<copy-artifact artifact="org.jboss.modules:jboss-modules" to-location="jboss-modules.jar"/>
Expand Down
27 changes: 27 additions & 0 deletions dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,33 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>verifications-configuration</id>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>process-classes</phase>
<configuration>
<overwrite>true</overwrite>
<outputDirectory>${basedir}/target/verifier</outputDirectory>
<resources>
<resource>
<directory>src/verifier</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-verifier-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
Expand Down
31 changes: 31 additions & 0 deletions dist/src/verifier/verifications.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright The WildFly Authors
~ SPDX-License-Identifier: Apache-2.0
-->
<verifications xmlns="http://maven.apache.org/verifications/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/verifications/1.0.0 http://maven.apache.org/xsd/verifications-1.0.0.xsd">
<!--
1) Verify that installation manager helper files are provisioned at .installation directory
-->
<files>
<file>
<location>target/${project.build.finalName}/.installation/_installation-manager_helper.sh</location>
<exists>true</exists>
</file>
<file>
<location>target/${project.build.finalName}/.installation/_installation-manager_helper.bat</location>
<exists>true</exists>
</file>
<file>
<location>target/${project.build.finalName}/.installation/_installation-manager_helper.ps1</location>
<exists>true</exists>
</file>
<file>
<location>target/${project.build.finalName}/.installation/_installation-manager_helper.properties</location>
<exists>true</exists>
</file>
</files>
<!-- end of (#1) -->
</verifications>
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ public void execute(OperationContext context, ModelNode operation) throws Operat
if (performInstallation) {
// Cannot use the Installation Manager constants, we will generate a circular reference via maven
final String productName = environment.getProductConfig().getProductName();
try (FileInputStream in = new FileInputStream(environment.getHomeDir().toPath().resolve("bin").resolve("installation-manager.properties").toFile())) {
try (FileInputStream in = new FileInputStream(environment.getHomeDir().toPath()
.resolve(".installation")
.resolve("_installation-manager_helper.properties")
.toFile())
) {
final Properties prop = new Properties();
prop.load(in);
String current = (String) prop.get("INST_MGR_STATUS");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import org.wildfly.core.instmgr.logging.InstMgrLogger;

/**
* Tracks the status of the candidate installation by using the installation-manager.properties file and configures the values that are
* passed to the installation-manager.sh/bat scripts to apply or revert an installation.
* Tracks the status of the candidate installation by using the .installation/_installation-manager_helper.properties file and configures the values that are
* passed to the .installation/_installation-manager_helper.sh/bat scripts to apply or revert an installation.
*/
class InstMgrCandidateStatus {
private Path properties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void start(StartContext startContext) throws StartException {
this.customPatchPath = homeDir.resolve(InstMgrConstants.CUSTOM_PATCH_SUBPATH);

// Properties file used to send information to the launch scripts
Path propertiesPath = homeDir.resolve("bin").resolve("installation-manager.properties");
Path propertiesPath = homeDir.resolve(".installation").resolve("_installation-manager_helper.properties");

this.candidateStatus.initialize(propertiesPath);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class InstMgrResourceTestCase extends AbstractControllerTestBase {
static final Path TARGET_DIR = Paths.get(System.getProperty("basedir", ".")).resolve("target");
static final Path JBOSS_HOME = TARGET_DIR.resolve("InstMgrResourceTestCase").normalize().toAbsolutePath();
static final Path JBOSS_CONTROLLER_TEMP_DIR = JBOSS_HOME.resolve("temp");
static final Path INSTALLATION_MANAGER_PROPERTIES = JBOSS_HOME.resolve("bin").resolve("installation-manager.properties");
static final Path INSTALLATION_MANAGER_PROPERTIES = JBOSS_HOME.resolve(".installation").resolve("_installation-manager_helper.properties");

@Parameters
public static Iterable<BiConsumer<Path, Path>> zipHandlers() {
Expand All @@ -112,7 +112,7 @@ public InstMgrResourceTestCase(BiConsumer<Path, Path> zipHandler) {
@Before
public void setupController() throws InterruptedException, IOException {
TestInstallationManager.initialized = false;
JBOSS_HOME.resolve("bin").toFile().mkdirs();
INSTALLATION_MANAGER_PROPERTIES.getParent().toFile().mkdirs();
Files.deleteIfExists(INSTALLATION_MANAGER_PROPERTIES);
Files.createFile(INSTALLATION_MANAGER_PROPERTIES);
try (FileOutputStream out = new FileOutputStream(INSTALLATION_MANAGER_PROPERTIES.toString())) {
Expand Down Expand Up @@ -1273,7 +1273,7 @@ public void prepareUpdatesSimple() throws OperationFailedException, IOException
Assert.assertEquals(InstMgrCandidateStatus.Status.PREPARED, instMgrService.getCandidateStatus());
Assert.assertFalse(instMgrService.canPrepareServer());

Path scriptPropertiesFile = JBOSS_HOME.resolve("bin").resolve("installation-manager.properties");
Path scriptPropertiesFile = JBOSS_HOME.resolve(".installation").resolve("_installation-manager_helper.properties");
try (FileInputStream in = new FileInputStream(scriptPropertiesFile.toFile())) {
final Properties prop = new Properties();
prop.load(in);
Expand Down Expand Up @@ -1442,7 +1442,7 @@ public void prepareRevertSimple() throws OperationFailedException, IOException {
Assert.assertEquals(InstMgrCandidateStatus.Status.PREPARED, instMgrService.getCandidateStatus());
Assert.assertFalse(instMgrService.canPrepareServer());

Path scriptPropertiesFile = JBOSS_HOME.resolve("bin").resolve("installation-manager.properties");
Path scriptPropertiesFile = JBOSS_HOME.resolve(".installation").resolve("_installation-manager_helper.properties");
try (FileInputStream in = new FileInputStream(scriptPropertiesFile.toFile())) {
final Properties prop = new Properties();
prop.load(in);
Expand Down
18 changes: 18 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
<version.org.wildfly.bom-builder-plugin>2.0.10.Final</version.org.wildfly.bom-builder-plugin>
<version.org.wildfly.wildfly-maven-gpg-plugin>3.2.8.SP1</version.org.wildfly.wildfly-maven-gpg-plugin>
<version.org.wildfly.licenses.plugin>2.4.4.Final</version.org.wildfly.licenses.plugin>
<version.verifier.plugin>1.1</version.verifier.plugin>
<version.versions.plugin>2.5</version.versions.plugin>
<version.xml.plugin>1.1.0</version.xml.plugin>
<wildfly.build.output.dir>build/target/${server.output.dir.prefix}-${wildfly.core.release.version}</wildfly.build.output.dir>
Expand Down Expand Up @@ -754,6 +755,23 @@
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.wildfly.plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-verifier-plugin</artifactId>
<version>${version.verifier.plugin}</version>
<executions>
<execution>
<id>main</id>
<phase>verify</phase>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<verificationFile>target/verifier/verifications.xml</verificationFile>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ public void execute(OperationContext context, ModelNode operation) throws Operat
if (performInstallation) {
// Cannot use the Installation Manager service, we will generate a circular reference via maven
final String productName = environment.getProductConfig().getProductName();
try (FileInputStream in = new FileInputStream(environment.getHomeDir().toPath().resolve("bin").resolve("installation-manager.properties").toFile())) {
try (FileInputStream in = new FileInputStream(environment.getHomeDir().toPath()
.resolve(".installation")
.resolve("_installation-manager_helper.properties")
.toFile())
) {
final Properties prop = new Properties();
prop.load(in);
String current = (String) prop.get("INST_MGR_STATUS");
Expand Down
Loading