Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ikasan 2332 add feature to migrate h2 database v2 #1279

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
d92cacf
IKASAN-2332 adding H2 migration implementation WIP
mick-stewart73 Feb 22, 2024
b83a63a
IKASAN-2332 got to the bottom of why liquibase logging to std out. It…
mick-stewart73 Feb 22, 2024
cffad6c
IKASAN-2332 adding missing file causing unit test to fail.
mick-stewart73 Feb 22, 2024
9198b58
IKASAN-2332 making file comparison more sensible.
mick-stewart73 Feb 22, 2024
5f86326
IKASAN-2332 adding strip to string comparison to see if eol character…
mick-stewart73 Feb 22, 2024
d493ef3
IKASAN-2332 ignoring test that is failing on travis.
mick-stewart73 Feb 22, 2024
50a9fd6
IKASAN-2332 ignoring test that is failing on travis.
mick-stewart73 Feb 22, 2024
8f87ea0
IKASAN-2332 @Disabled required to ignore tests on junit 5
mick-stewart73 Feb 22, 2024
de3961a
IKASAN-2332 @Disabled required to ignore tests on junit 5. try again...
mick-stewart73 Feb 22, 2024
cadb948
IKASAN-2332 attempt to fix failing unit tests
mick-stewart73 Feb 23, 2024
555e8dd
IKASAN-2332 adding code to clean up directory prior to unit test running
mick-stewart73 Feb 23, 2024
f4e5da8
IKASAN-2332 removing redundant test that is tested in it own discrete…
mick-stewart73 Feb 23, 2024
30762a6
IKASAN-2332 tidying up a little.
mick-stewart73 Feb 26, 2024
fee60c9
IKASAN-2332 updating readme with h2 migration.
mick-stewart73 Feb 26, 2024
da9f223
IKASAN-2332 fixing path to title image.
mick-stewart73 Feb 26, 2024
e68f52d
IKASAN-2332 adding migration persistence to a dedicated manifest dire…
mick-stewart73 Feb 27, 2024
14c5cbb
IKASAN-2332 sorting out the change log and adding migration to start …
mick-stewart73 Mar 18, 2024
de411ee
IKASAN-2332 adding flag to prevent h2 migration from running and maki…
mick-stewart73 Mar 19, 2024
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ before_install:

install: skip

script: mvn -quiet --file ikasaneip/pom.xml --settings .settings.xml test -Dmaven.javadoc.skip=true -Djava.security.egd=file:/dev/./urandom -Pall -B -V 1> /dev/null
script: mvn --file ikasaneip/pom.xml --settings .settings.xml test -Dmaven.javadoc.skip=true -Djava.security.egd=file:/dev/./urandom -Pall -B -V

deploy:
# deploy develop 3.3.x to oss
Expand Down
6 changes: 6 additions & 0 deletions ikasaneip/builder/jar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -418,5 +418,11 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<scope>test</scope>
</dependency>

</dependencies>
</project>
6 changes: 6 additions & 0 deletions ikasaneip/builder/spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

</project>
Expand Down
64 changes: 40 additions & 24 deletions ikasaneip/cli/shell/distribution/distribution.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,46 @@
<assembly>
<id>dist</id>
<formats>
<format>zip</format>
</formats>
<id>dist</id>
<formats>
<format>zip</format>
</formats>

<fileSets>
<fileSet>
<directory>../bin</directory>
<filtered>true</filtered>
<fileMode>755</fileMode>
<outputDirectory>./</outputDirectory>
</fileSet>
<fileSets>
<fileSet>
<directory>../bin</directory>
<filtered>true</filtered>
<fileMode>755</fileMode>
<outputDirectory>./</outputDirectory>
</fileSet>
<fileSet>
<directory>../sql/migration</directory>
<filtered>true</filtered>
<fileMode>755</fileMode>
<outputDirectory>./lib/migration</outputDirectory>
</fileSet>
</fileSets>

</fileSets>
<includeBaseDirectory>false</includeBaseDirectory>

<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<!-- Enable access to all projects in the current multimodule build! -->
<useProjectArtifact>false</useProjectArtifact>
<!-- Now, select which projects to include in this module-set. -->
<includes>
<include>org.ikasan:ikasan-shell</include>
</includes>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>

<dependencySets>
<dependencySet>
<!-- Enable access to all projects in the current multimodule build! -->
<useProjectArtifact>false</useProjectArtifact>
<!-- Now, select which projects to include in this module-set. -->
<includes>
<include>org.ikasan:ikasan-shell</include>
</includes>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
<files>
<file>
<source>target/h2-1.4.200.jar</source>
<outputDirectory>lib/migration</outputDirectory>
</file>
<file>
<source>target/h2-2.2.224.jar</source>
<outputDirectory>lib/migration</outputDirectory>
</file>
</files>
</assembly>
39 changes: 39 additions & 0 deletions ikasaneip/cli/shell/distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,45 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.4.2</version>
<executions>
<execution>
<id>download-h2-1.4.200-jar</id>
<phase>compile</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>https://search.maven.org/remotecontent?filepath=com/h2database/h2/1.4.200/h2-1.4.200.jar</url>
<unpack>false</unpack>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.4.2</version>
<executions>
<execution>
<id>download-h2-2.2.224-jar</id>
<phase>compile</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>https://search.maven.org/remotecontent?filepath=com/h2database/h2/2.2.224/h2-2.2.224.jar</url>
<unpack>false</unpack>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
53 changes: 29 additions & 24 deletions ikasaneip/cli/shell/jar/Readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Problem Domain](../../docs/quickstart-images/Ikasan-title-transparent.png)
![Problem Domain](../../../developer/docs/quickstart-images/Ikasan-title-transparent.png)
# Ikasan Command-Line Interface (CLI) Shell

The Ikasan CLI Shell is a cross-platform client interface for IkasanESB.
Expand Down Expand Up @@ -63,6 +63,7 @@ where non-interactive commands can be one or more of
- ```stop``` - stop the Integration Module followed by stopping the Integration Module's H2 process
- ```start-h2``` - start the Integration Module's H2 process
- ```stop-h2``` - stop the Integration Module's H2 process
- ```migrate-h2``` - migrate the Integration Module's H2 database from one version to another
- ```start-module``` - start the Integration Module
- ```stop-module``` - stop the Integration Module
- ```env``` - show runtime environment variables
Expand Down Expand Up @@ -104,38 +105,42 @@ Ikasan Shell:> help
AVAILABLE COMMANDS

Built-In Commands
clear: Clear the shell screen.
exit, quit: Exit the shell.
help: Display help about available commands.
history: Display or save the history of previously run commands
script: Read and execute commands from a file.
stacktrace: Display the full stacktrace of the last error.
help: Display help about available commands
stacktrace: Display the full stacktrace of the last error.
clear: Clear the shell screen.
quit, exit: Exit the shell.
history: Display or save the history of previously run commands
version: Show version info
script: Read and execute commands from a file.

Ikasan Commands
env: Show runtime environment variables. Syntax: env [regexp variable name - to match specific variable names] [-names - to display variable name(s) only] [-no-expand - do not expand variable wildcards] [-list - returns results as a list]
ps: Check running process. Syntax: ps [process name] | [-name <process name>] [-user <user name>]
start-h2: Start H2 persistence JVM
start-module: Start Integration Module JVM
stop-h2: Stop H2 persistence JVM
stop-module: Stop Integration Module JVM
stop-module: Stop Integration Module JVM
start-module: Start Integration Module JVM
migrate-h2: Migrate H2 persistence
ps: Check running process. Syntax: ps [process name] | [-name <process name>] [-user <user name>]
stop-h2: Stop H2 persistence JVM
env: Show runtime environment variables. Syntax: env [regexp variable name - to match specific variable names] [-names - to display variable name(s) only] [-no-expand - do not expand variable wildcards] [-list - returns results as a list]
start-h2: Start H2 persistence JVM



Ikasan Shell:>
```

#### Command Options

| Command | Description | Options | Examples |
| :--- | :--- | :--- | :--- |
| env | Displays the runtime environment variables currently picked up by the CLI shell. Specifying a regexp of a variable name will only show those variables matching.| -names boolean to display variable names only. <br/>-no-expand boolean to specify no wildcard expansion of variables. <br/> -list return the results as a list. | Example 1. <br/> ```env h2.java.process``` - will only show the h2.java.process variable. <br/><br/> Example 2. <br/> ```env h2 -names``` - will only show the variable names matching h2. <br/><br/>Example 3. <br/> ```env h2 -list``` - will show the variables matching h2 as a list. <br/><br/>Example 4. <br/> ```env h2 -no-expand``` - will show the variable without expanding wildcards. |
| ps | Displays the status of the H2 JVM and Integration Module JVM as running, true or false. Uses default Integration Module name and username running the CLI. | -name <Alternate Module Name> |
| | | -user <Alternate Username> |
| start-h2 | Starts the H2 JVM process for this Integration Module. Uses default Integration Module name and user. | -name <Alternate Module Name> |
| | | -command <Alternate JVM Command> which overrides h2.java.command |
| stop-h2 | Stops the H2 JVM process for this Integration Module. | -name <Alternate Module Name> |
| start-module | Starts the Integration Module JVM process. Uses default Integration Module name and user. | -name <Alternate Module Name> |
| | | -command <Alternate JVM Command> which overrides module.java.command |
| stop-module | Stops the Integration Module JVM process. | -name <Alternate Module Name> |
| Command | Description | Options | Examples |
|:-------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| env | Displays the runtime environment variables currently picked up by the CLI shell. Specifying a regexp of a variable name will only show those variables matching. | -names boolean to display variable names only. <br/>-no-expand boolean to specify no wildcard expansion of variables. <br/> -list return the results as a list. | Example 1. <br/> ```env h2.java.process``` - will only show the h2.java.process variable. <br/><br/> Example 2. <br/> ```env h2 -names``` - will only show the variable names matching h2. <br/><br/>Example 3. <br/> ```env h2 -list``` - will show the variables matching h2 as a list. <br/><br/>Example 4. <br/> ```env h2 -no-expand``` - will show the variable without expanding wildcards. |
| ps | Displays the status of the H2 JVM and Integration Module JVM as running, true or false. Uses default Integration Module name and username running the CLI. | -name <Alternate Module Name> |
| | | -user <Alternate Username> |
| start-h2 | Starts the H2 JVM process for this Integration Module. Uses default Integration Module name and user. | -name <Alternate Module Name> |
| | | -command <Alternate JVM Command> which overrides h2.java.command |
| stop-h2 | Stops the H2 JVM process for this Integration Module. | -name <Alternate Module Name> |
| migrate-h2 | Migrate H2 persistence | --source-h2-version The version of the H2 database we are migrating from. [Optional, default = 1.4.200] </br> --target-h2-version The version of the H2 database we are migrating to. [Optional, default = 2.2.224] <br/> --h2-user The username of the H2 database to use for the migration. [Optional, default = sa] <br/> --h2-password The password of the H2 database to use for the migration. [Optional, default = sa] <br/> --h2-database-location The path to the database. The general Ikasan convention [<persistence-dir>/<module-name>-db/esb] will be used by default. [Optional] |
| start-module | Starts the Integration Module JVM process. Uses default Integration Module name and user. | -name <Alternate Module Name> |
| | | -command <Alternate JVM Command> which overrides module.java.command |
| stop-module | Stops the Integration Module JVM process. | -name <Alternate Module Name> |

#### Sample Usage
Command
Expand Down
Loading