From cfb1c7ea36f8b44c335d5901d18349d61466e7b4 Mon Sep 17 00:00:00 2001 From: Klaas Eenkhoorn Date: Sat, 11 Feb 2023 20:15:50 +0100 Subject: [PATCH 01/12] Added custom prefix feature and fixed pluginname in plugin-version.properties --- README.md | 7 ++++--- build.gradle | 8 ++++---- src/main/resources/liquibase/__init__.py | 2 +- src/main/resources/liquibase/apply_changelog.py | 2 +- src/main/resources/liquibase/apply_rollback.py | 2 +- src/main/resources/liquibase/apply_tag.py | 2 +- src/main/resources/liquibase/rule.py | 10 +++++----- src/main/resources/liquibase/test.bat.ftl | 2 +- src/main/resources/liquibase/test.sh.ftl | 2 +- src/main/resources/plugin-version.properties | 4 ++-- src/main/resources/synthetic.xml | 7 ++++--- src/main/resources/xl-rules.xml | 2 +- 12 files changed, 26 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index fd3e6df..b83f456 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Liquibase plugin # +# Liquibase plugin # This document describes the functionality provided by the Liquibase plugin. @@ -80,8 +80,8 @@ A liquibase.Runner instance represents a liquibase installation. Below the confi ### Deployable _liquibase.Changelog_ -*liquibase.Changelog* is a folder artifact that contains all the xml liquibase changelog -files of the application package. +*liquibase.Changelog* is a folder artifact that contains all the xml liquibase changelog +files of the application package. __PLEASE NOTE__ this plugin requires that each changeset be marked with the logicalFilePath attribute set. This is so that Liquibase will not take the file name that contains the changeset into consideration when writing database log changes, e.g
@@ -91,3 +91,4 @@ Properties :
 
 * *changeLogFile* specifies the entry point xml changelog file for liquibase.
 * *rollbackVersion* specifies the rollback version that will be used to apply a tag after successful changelog update.
+* *rollbackVersionPrefix* specifies the prefix added to the tag. Default is 'v'. The tag is composed as follows: , for example: "v1" or "abc-1".
diff --git a/build.gradle b/build.gradle
index 3c56414..ea66ef2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,14 +1,14 @@
 import org.apache.tools.ant.filters.ReplaceTokens
 
 plugins {
-    id "com.github.hierynomus.license" version "0.14.0"
+    id "com.github.hierynomus.license" version "0.15.0"
     id "com.xebialabs.xldp" version "1.0.5"
     id "com.xebialabs.xl.docker" version "1.1.0"
 }
 
-version='5.0.1-SNAPSHOT'
-
+version='5.2.0-SNAPSHOT'
 
+defaultTasks 'build'
 apply plugin: 'java'
 apply plugin: 'idea'
 apply plugin: 'eclipse'
@@ -29,7 +29,7 @@ license {
 
 
 dependencies {
-    compile 'com.xebialabs.overthere:overtherepy:0.0.3'
+    compile 'com.xebialabs.overthere:overtherepy:0.1.0'
     testCompile "org.hamcrest:hamcrest-core:1.2.1"
     testCompile "org.hamcrest:hamcrest-library:1.2.1"
 }
diff --git a/src/main/resources/liquibase/__init__.py b/src/main/resources/liquibase/__init__.py
index 670f189..d1ed1d9 100644
--- a/src/main/resources/liquibase/__init__.py
+++ b/src/main/resources/liquibase/__init__.py
@@ -1,5 +1,5 @@
 #
-# Copyright 2019 XEBIALABS
+# Copyright 2023 XEBIALABS
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 #
diff --git a/src/main/resources/liquibase/apply_changelog.py b/src/main/resources/liquibase/apply_changelog.py
index 239a44a..ab78934 100644
--- a/src/main/resources/liquibase/apply_changelog.py
+++ b/src/main/resources/liquibase/apply_changelog.py
@@ -1,5 +1,5 @@
 #
-# Copyright 2019 XEBIALABS
+# Copyright 2023 XEBIALABS
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 #
diff --git a/src/main/resources/liquibase/apply_rollback.py b/src/main/resources/liquibase/apply_rollback.py
index 3eb3c19..8225f5c 100644
--- a/src/main/resources/liquibase/apply_rollback.py
+++ b/src/main/resources/liquibase/apply_rollback.py
@@ -1,5 +1,5 @@
 #
-# Copyright 2019 XEBIALABS
+# Copyright 2023 XEBIALABS
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 #
diff --git a/src/main/resources/liquibase/apply_tag.py b/src/main/resources/liquibase/apply_tag.py
index 1e9dc52..4d7cac5 100644
--- a/src/main/resources/liquibase/apply_tag.py
+++ b/src/main/resources/liquibase/apply_tag.py
@@ -1,5 +1,5 @@
 #
-# Copyright 2019 XEBIALABS
+# Copyright 2023 XEBIALABS
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 #
diff --git a/src/main/resources/liquibase/rule.py b/src/main/resources/liquibase/rule.py
index 651f8ff..871c118 100644
--- a/src/main/resources/liquibase/rule.py
+++ b/src/main/resources/liquibase/rule.py
@@ -1,5 +1,5 @@
 #
-# Copyright 2019 XEBIALABS
+# Copyright 2023 XEBIALABS
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 #
@@ -18,10 +18,10 @@ def apply_changelog_steps(d, ctx):
                         script='liquibase/apply_changelog.py',
                         jython_context={"container": d.container, "deployed": d})
     ctx.addStep(step)
-    step = steps.jython(description="Create deployment rollback tag [v%s] in liquibase [%s]" % (d.rollbackVersion, d.container.name),
+    step = steps.jython(description="Create deployment rollback tag [%s%s] in liquibase [%s]" % (d.rollbackVersionPrefix, d.rollbackVersion, d.container.name),
                         order=CREATE_RESOURCES,
                         script='liquibase/apply_tag.py',
-                        jython_context={"container": d.container, "tag": "v%s" % d.rollbackVersion})
+                        jython_context={"container": d.container, "tag": "%s%s" % (d.rollbackVersionPrefix, d.rollbackVersion)})
     ctx.addStep(step)
 
 
@@ -43,10 +43,10 @@ def handle_destroy(d, ctx):
 
 def handle_modify(pd, d, ctx):
     if d.rollbackVersion < pd.rollbackVersion:
-        step = steps.jython(description="Rollback to tag [v%s] in liquibase [%s]" % (d.rollbackVersion, d.container.name),
+        step = steps.jython(description="Rollback to tag [%s%s] in liquibase [%s]" % (d.rollbackVersionPrefix, d.rollbackVersion, d.container.name),
                             order=DESTROY_RESOURCES,
                             script='liquibase/apply_rollback.py',
-                            jython_context={"container": d.container, "tag": "v%s" % d.rollbackVersion, "deployed": pd})
+                            jython_context={"container": d.container, "tag": "%s%s" % (d.rollbackVersionPrefix, d.rollbackVersion), "deployed": pd})
         ctx.addStep(step)
     else:
         apply_changelog_steps(d, ctx)
diff --git a/src/main/resources/liquibase/test.bat.ftl b/src/main/resources/liquibase/test.bat.ftl
index dd93060..abe096f 100644
--- a/src/main/resources/liquibase/test.bat.ftl
+++ b/src/main/resources/liquibase/test.bat.ftl
@@ -1,6 +1,6 @@
 <#--
 
-    Copyright 2019 XEBIALABS
+    Copyright 2023 XEBIALABS
 
     Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 
diff --git a/src/main/resources/liquibase/test.sh.ftl b/src/main/resources/liquibase/test.sh.ftl
index 0d6838a..33256b6 100644
--- a/src/main/resources/liquibase/test.sh.ftl
+++ b/src/main/resources/liquibase/test.sh.ftl
@@ -1,6 +1,6 @@
 <#--
 
-    Copyright 2019 XEBIALABS
+    Copyright 2023 XEBIALABS
 
     Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 
diff --git a/src/main/resources/plugin-version.properties b/src/main/resources/plugin-version.properties
index c37303d..25509cd 100644
--- a/src/main/resources/plugin-version.properties
+++ b/src/main/resources/plugin-version.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2019 XEBIALABS
+# Copyright 2023 XEBIALABS
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 #
@@ -8,5 +8,5 @@
 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-plugin=@project.artifactId@
+plugin=@project.name@
 version=@project.version@
diff --git a/src/main/resources/synthetic.xml b/src/main/resources/synthetic.xml
index 9377cd0..9ef6f6e 100644
--- a/src/main/resources/synthetic.xml
+++ b/src/main/resources/synthetic.xml
@@ -1,7 +1,7 @@
 
 
-${container.javaCmd} -jar ${container.liquibaseJarPath} --version
+<#if (container.liquibaseLauncher) >${container.liquibaseLauncher}<#else>${container.javaCmd} -jar ${container.liquibaseJarPath} --version
+
diff --git a/src/main/resources/liquibase/test.sh.ftl b/src/main/resources/liquibase/test.sh.ftl
index 33256b6..b997adf 100644
--- a/src/main/resources/liquibase/test.sh.ftl
+++ b/src/main/resources/liquibase/test.sh.ftl
@@ -11,5 +11,5 @@
 -->
 
 #!/bin/sh
-${container.javaCmd} -jar ${container.liquibaseJarPath} --version
+<#if (container.liquibaseLauncher) >${container.liquibaseLauncher}<#else>${container.javaCmd} -jar ${container.liquibaseJarPath} --version
 
diff --git a/src/main/resources/synthetic.xml b/src/main/resources/synthetic.xml
index 9ef6f6e..0a832cb 100644
--- a/src/main/resources/synthetic.xml
+++ b/src/main/resources/synthetic.xml
@@ -24,15 +24,16 @@
     
         
 

From 92c9ac543910d4d9f4ccf45bb98c031f48aa0a51 Mon Sep 17 00:00:00 2001
From: Klaas Eenkhoorn 
Date: Sat, 11 Feb 2023 23:24:03 +0100
Subject: [PATCH 04/12] Changed note

---
 README.md | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/README.md b/README.md
index e3d1469..aa2e9f0 100644
--- a/README.md
+++ b/README.md
@@ -74,11 +74,7 @@ A liquibase.Runner instance represents a liquibase installation. Below the confi
 * *liquibaseJarPath*: path to the main liquibase jar file, i.e. liquibase.jar.
 * *javaCmd*: command that will be used to launch liquibase java process. Default is "java".
 
----
-**NOTE for Liquibase v4.11.0 and up**
-With Liquibase version v4.11.0 the [preferred way](https://docs.liquibase.com/workflows/liquibase-community/run-liquibase-without-launch-scripts.html) of starting Liquibase CLI is changed to a launcher script. Therefore the plugin provides the *liquibaseLauncher* option for `xld-liquibase-plugin` version 5.1.0 and up.
-If this option is configured the contents of *liquibaseJarPath* and *javaCmd* will be ignored. If you wish to use the previous `java -jar liquibase-core.jar` way leave the field *liquibaseLauncher* empty. If you do this with version v4.11.0 and up, provide a `LIQUIBASE_HOME` variable on the client somehow because this variable is required for this version and up.
----
+__NOTE for Liquibase v4.11.0 and up__ With Liquibase version v4.11.0 the [preferred way](https://docs.liquibase.com/workflows/liquibase-community/run-liquibase-without-launch-scripts.html) of starting Liquibase CLI is changed to a launcher script. Therefore the plugin provides the *liquibaseLauncher* option for `xld-liquibase-plugin` version 5.1.0 and up. If this option is configured the contents of *liquibaseJarPath* and *javaCmd* will be ignored. If you wish to use the previous `java -jar liquibase-core.jar` way leave the field *liquibaseLauncher* empty. If you do this with version v4.11.0 and up, provide a `LIQUIBASE_HOME` variable on the client somehow because this variable is required for this version and up.
 
 ### Deployable _liquibase.Changelog_
 

From 75cb47d6b8a90519b7f6b00a17360ac538c959a5 Mon Sep 17 00:00:00 2001
From: Klaas Eenkhoorn 
Date: Sat, 11 Feb 2023 23:26:48 +0100
Subject: [PATCH 05/12] Textmarkup change

---
 README.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index aa2e9f0..78e01b9 100644
--- a/README.md
+++ b/README.md
@@ -74,7 +74,8 @@ A liquibase.Runner instance represents a liquibase installation. Below the confi
 * *liquibaseJarPath*: path to the main liquibase jar file, i.e. liquibase.jar.
 * *javaCmd*: command that will be used to launch liquibase java process. Default is "java".
 
-__NOTE for Liquibase v4.11.0 and up__ With Liquibase version v4.11.0 the [preferred way](https://docs.liquibase.com/workflows/liquibase-community/run-liquibase-without-launch-scripts.html) of starting Liquibase CLI is changed to a launcher script. Therefore the plugin provides the *liquibaseLauncher* option for `xld-liquibase-plugin` version 5.1.0 and up. If this option is configured the contents of *liquibaseJarPath* and *javaCmd* will be ignored. If you wish to use the previous `java -jar liquibase-core.jar` way leave the field *liquibaseLauncher* empty. If you do this with version v4.11.0 and up, provide a `LIQUIBASE_HOME` variable on the client somehow because this variable is required for this version and up.
+### Liquibase v4.11.0 and up
+With Liquibase version v4.11.0 the [preferred way](https://docs.liquibase.com/workflows/liquibase-community/run-liquibase-without-launch-scripts.html) of starting Liquibase CLI is changed to a launcher script. Therefore the plugin provides the *liquibaseLauncher* option for `xld-liquibase-plugin` version 5.1.0 and up. If this option is configured the contents of *liquibaseJarPath* and *javaCmd* will be ignored. If you wish to use the previous `java -jar liquibase-core.jar` way leave the field *liquibaseLauncher* empty. If you do this with version v4.11.0 and up, provide a `LIQUIBASE_HOME` variable on the client somehow because this variable is required for this version and up.
 
 ### Deployable _liquibase.Changelog_
 

From bab6d1aa259131cd940bb9a393d71d86fd790cdc Mon Sep 17 00:00:00 2001
From: Klaas Eenkhoorn 
Date: Sat, 11 Feb 2023 23:27:58 +0100
Subject: [PATCH 06/12] Text change

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 78e01b9..b100933 100644
--- a/README.md
+++ b/README.md
@@ -75,7 +75,7 @@ A liquibase.Runner instance represents a liquibase installation. Below the confi
 * *javaCmd*: command that will be used to launch liquibase java process. Default is "java".
 
 ### Liquibase v4.11.0 and up
-With Liquibase version v4.11.0 the [preferred way](https://docs.liquibase.com/workflows/liquibase-community/run-liquibase-without-launch-scripts.html) of starting Liquibase CLI is changed to a launcher script. Therefore the plugin provides the *liquibaseLauncher* option for `xld-liquibase-plugin` version 5.1.0 and up. If this option is configured the contents of *liquibaseJarPath* and *javaCmd* will be ignored. If you wish to use the previous `java -jar liquibase-core.jar` way leave the field *liquibaseLauncher* empty. If you do this with version v4.11.0 and up, provide a `LIQUIBASE_HOME` variable on the client somehow because this variable is required for this version and up.
+With Liquibase version v4.11.0 the [preferred way](https://docs.liquibase.com/workflows/liquibase-community/run-liquibase-without-launch-scripts.html) of starting Liquibase CLI is changed to a launcher script. Therefore the plugin provides the *liquibaseLauncher* option for `xld-liquibase-plugin` version 5.1.0 and up. If this option is configured the contents of *liquibaseJarPath* and *javaCmd* will be ignored. If you wish to use the previous `java -jar liquibase-core.jar` way leave the field *liquibaseLauncher* empty. If you do so with version v4.11.0 and up, provide a `LIQUIBASE_HOME` variable on the client somehow because this variable is required for this version and up.
 
 ### Deployable _liquibase.Changelog_
 

From 7e150d3bc5fd9e54d741264eb9556748aa1cd961 Mon Sep 17 00:00:00 2001
From: Klaas Eenkhoorn 
Date: Sun, 12 Feb 2023 13:48:50 +0100
Subject: [PATCH 07/12] Added step ordering option

---
 README.md                                 |  3 +++
 src/main/resources/liquibase/apply_tag.py |  6 -----
 src/main/resources/liquibase/rule.py      | 32 +++++++++++++++++++----
 src/main/resources/synthetic.xml          | 11 +++++---
 4 files changed, 37 insertions(+), 15 deletions(-)

diff --git a/README.md b/README.md
index b100933..5c83f2c 100644
--- a/README.md
+++ b/README.md
@@ -91,3 +91,6 @@ Properties :
 * *changeLogFile* specifies the entry point xml changelog file for liquibase.
 * *rollbackVersion* specifies the rollback version that will be used to apply a tag after successful changelog update.
 * *rollbackVersionPrefix* specifies the prefix added to the tag. Default is 'v'. The tag is composed as follows: , for example: "v1" or "abc-1".
+* *createOrder* Create order in the steplist, default is '60'.
+* *destroyOrder* Destroy order in the steplist, default is '40'.
+* *modifyOrder* Modify order in teh steplist, default is '40'.
diff --git a/src/main/resources/liquibase/apply_tag.py b/src/main/resources/liquibase/apply_tag.py
index 4d7cac5..38c3d9f 100644
--- a/src/main/resources/liquibase/apply_tag.py
+++ b/src/main/resources/liquibase/apply_tag.py
@@ -8,12 +8,6 @@
 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-#
-# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
-# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
-#
-
 from __future__ import with_statement
 from overtherepy import OverthereHostSession
 from liquibase import *
diff --git a/src/main/resources/liquibase/rule.py b/src/main/resources/liquibase/rule.py
index 871c118..58b3051 100644
--- a/src/main/resources/liquibase/rule.py
+++ b/src/main/resources/liquibase/rule.py
@@ -8,26 +8,40 @@
 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
+# Default values must corrspond to synthetic.xml
 DESTROY_RESOURCES = 40
 CREATE_RESOURCES = 60
+MODIFY_RESOURCES = 40
 
+from overtherepy import StringUtils
+
+def none_or_empty(s):
+    return StringUtils.empty(s)
 
 def apply_changelog_steps(d, ctx):
+    if not none_or_empty(d.createOrder):
+        stepOrder=d.createOrder
+    else:
+        stepOrder=CREATE_RESOURCES
     step = steps.jython(description="Apply changelog [%s] in liquibase [%s]" % (d.name, d.container.name),
-                        order=CREATE_RESOURCES,
+                        order=stepOrder,
                         script='liquibase/apply_changelog.py',
                         jython_context={"container": d.container, "deployed": d})
     ctx.addStep(step)
     step = steps.jython(description="Create deployment rollback tag [%s%s] in liquibase [%s]" % (d.rollbackVersionPrefix, d.rollbackVersion, d.container.name),
-                        order=CREATE_RESOURCES,
+                        order=stepOrder,
                         script='liquibase/apply_tag.py',
                         jython_context={"container": d.container, "tag": "%s%s" % (d.rollbackVersionPrefix, d.rollbackVersion)})
     ctx.addStep(step)
 
 
 def handle_create(d, ctx):
+    if not none_or_empty(d.createOrder):
+        stepOrder=d.createOrder
+    else:
+        stepOrder=CREATE_RESOURCES
     step = steps.jython(description="Create initial deployment rollback tag [%s] in liquibase [%s]" % (d.baseRollbackTag, d.container.name),
-                        order=CREATE_RESOURCES,
+                        order=stepOrder,
                         script='liquibase/apply_tag.py',
                         jython_context={"container": d.container, "tag": d.baseRollbackTag})
     ctx.addStep(step)
@@ -35,16 +49,24 @@ def handle_create(d, ctx):
 
 
 def handle_destroy(d, ctx):
+    if not none_or_empty(d.destroyOrder):
+        stepOrder=d.destroyOrder
+    else:
+        stepOrder=DESTROY_RESOURCES
     step = steps.jython(description="Rollback to tag [%s] in liquibase [%s]" % (d.baseRollbackTag, d.container.name),
-                        order=DESTROY_RESOURCES,
+                        order=stepOrder,
                         script='liquibase/apply_rollback.py',
                         jython_context={"container": d.container, "tag": d.baseRollbackTag, "deployed": d})
     ctx.addStep(step)
 
 def handle_modify(pd, d, ctx):
+    if not none_or_empty(d.modifyOrder):
+        stepOrder=d.modifyOrder
+    else:
+        stepOrder=MODIFY_RESOURCES
     if d.rollbackVersion < pd.rollbackVersion:
         step = steps.jython(description="Rollback to tag [%s%s] in liquibase [%s]" % (d.rollbackVersionPrefix, d.rollbackVersion, d.container.name),
-                            order=DESTROY_RESOURCES,
+                            order=stepOrder,
                             script='liquibase/apply_rollback.py',
                             jython_context={"container": d.container, "tag": "%s%s" % (d.rollbackVersionPrefix, d.rollbackVersion), "deployed": pd})
         ctx.addStep(step)
diff --git a/src/main/resources/synthetic.xml b/src/main/resources/synthetic.xml
index 0a832cb..65991bb 100644
--- a/src/main/resources/synthetic.xml
+++ b/src/main/resources/synthetic.xml
@@ -15,10 +15,13 @@
 
     
 		
-		
-		
-		
-		
 
     

From 594b3f6844eb34d2445093227645a0bdf4e82741 Mon Sep 17 00:00:00 2001
From: Klaas Eenkhoorn 
Date: Sun, 12 Feb 2023 13:56:09 +0100
Subject: [PATCH 08/12] Fixed typo in readme.md

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 5c83f2c..ab1498e 100644
--- a/README.md
+++ b/README.md
@@ -93,4 +93,4 @@ Properties :
 * *rollbackVersionPrefix* specifies the prefix added to the tag. Default is 'v'. The tag is composed as follows: , for example: "v1" or "abc-1".
 * *createOrder* Create order in the steplist, default is '60'.
 * *destroyOrder* Destroy order in the steplist, default is '40'.
-* *modifyOrder* Modify order in teh steplist, default is '40'.
+* *modifyOrder* Modify order in the steplist, default is '40'.

From f70e785b202ac89da766d773253793cf7a37dfa2 Mon Sep 17 00:00:00 2001
From: "Klaas D. Eenkhoorn" 
Date: Mon, 13 Feb 2023 12:41:16 +0100
Subject: [PATCH 09/12] Revert "Fixed typo in readme.md"

This reverts commit 594b3f6844eb34d2445093227645a0bdf4e82741.
---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index ab1498e..5c83f2c 100644
--- a/README.md
+++ b/README.md
@@ -93,4 +93,4 @@ Properties :
 * *rollbackVersionPrefix* specifies the prefix added to the tag. Default is 'v'. The tag is composed as follows: , for example: "v1" or "abc-1".
 * *createOrder* Create order in the steplist, default is '60'.
 * *destroyOrder* Destroy order in the steplist, default is '40'.
-* *modifyOrder* Modify order in the steplist, default is '40'.
+* *modifyOrder* Modify order in teh steplist, default is '40'.

From 52d734d1a5938bdfbdaabcffbf76e4181506297e Mon Sep 17 00:00:00 2001
From: "Klaas D. Eenkhoorn" 
Date: Mon, 13 Feb 2023 12:41:47 +0100
Subject: [PATCH 10/12] Revert "Added step ordering option"

This reverts commit 7e150d3bc5fd9e54d741264eb9556748aa1cd961.
---
 README.md                                 |  3 ---
 src/main/resources/liquibase/apply_tag.py |  6 +++++
 src/main/resources/liquibase/rule.py      | 32 ++++-------------------
 src/main/resources/synthetic.xml          | 11 +++-----
 4 files changed, 15 insertions(+), 37 deletions(-)

diff --git a/README.md b/README.md
index 5c83f2c..b100933 100644
--- a/README.md
+++ b/README.md
@@ -91,6 +91,3 @@ Properties :
 * *changeLogFile* specifies the entry point xml changelog file for liquibase.
 * *rollbackVersion* specifies the rollback version that will be used to apply a tag after successful changelog update.
 * *rollbackVersionPrefix* specifies the prefix added to the tag. Default is 'v'. The tag is composed as follows: , for example: "v1" or "abc-1".
-* *createOrder* Create order in the steplist, default is '60'.
-* *destroyOrder* Destroy order in the steplist, default is '40'.
-* *modifyOrder* Modify order in teh steplist, default is '40'.
diff --git a/src/main/resources/liquibase/apply_tag.py b/src/main/resources/liquibase/apply_tag.py
index 38c3d9f..4d7cac5 100644
--- a/src/main/resources/liquibase/apply_tag.py
+++ b/src/main/resources/liquibase/apply_tag.py
@@ -8,6 +8,12 @@
 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
+#
+# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
+# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
+#
+
 from __future__ import with_statement
 from overtherepy import OverthereHostSession
 from liquibase import *
diff --git a/src/main/resources/liquibase/rule.py b/src/main/resources/liquibase/rule.py
index 58b3051..871c118 100644
--- a/src/main/resources/liquibase/rule.py
+++ b/src/main/resources/liquibase/rule.py
@@ -8,40 +8,26 @@
 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-# Default values must corrspond to synthetic.xml
 DESTROY_RESOURCES = 40
 CREATE_RESOURCES = 60
-MODIFY_RESOURCES = 40
 
-from overtherepy import StringUtils
-
-def none_or_empty(s):
-    return StringUtils.empty(s)
 
 def apply_changelog_steps(d, ctx):
-    if not none_or_empty(d.createOrder):
-        stepOrder=d.createOrder
-    else:
-        stepOrder=CREATE_RESOURCES
     step = steps.jython(description="Apply changelog [%s] in liquibase [%s]" % (d.name, d.container.name),
-                        order=stepOrder,
+                        order=CREATE_RESOURCES,
                         script='liquibase/apply_changelog.py',
                         jython_context={"container": d.container, "deployed": d})
     ctx.addStep(step)
     step = steps.jython(description="Create deployment rollback tag [%s%s] in liquibase [%s]" % (d.rollbackVersionPrefix, d.rollbackVersion, d.container.name),
-                        order=stepOrder,
+                        order=CREATE_RESOURCES,
                         script='liquibase/apply_tag.py',
                         jython_context={"container": d.container, "tag": "%s%s" % (d.rollbackVersionPrefix, d.rollbackVersion)})
     ctx.addStep(step)
 
 
 def handle_create(d, ctx):
-    if not none_or_empty(d.createOrder):
-        stepOrder=d.createOrder
-    else:
-        stepOrder=CREATE_RESOURCES
     step = steps.jython(description="Create initial deployment rollback tag [%s] in liquibase [%s]" % (d.baseRollbackTag, d.container.name),
-                        order=stepOrder,
+                        order=CREATE_RESOURCES,
                         script='liquibase/apply_tag.py',
                         jython_context={"container": d.container, "tag": d.baseRollbackTag})
     ctx.addStep(step)
@@ -49,24 +35,16 @@ def handle_create(d, ctx):
 
 
 def handle_destroy(d, ctx):
-    if not none_or_empty(d.destroyOrder):
-        stepOrder=d.destroyOrder
-    else:
-        stepOrder=DESTROY_RESOURCES
     step = steps.jython(description="Rollback to tag [%s] in liquibase [%s]" % (d.baseRollbackTag, d.container.name),
-                        order=stepOrder,
+                        order=DESTROY_RESOURCES,
                         script='liquibase/apply_rollback.py',
                         jython_context={"container": d.container, "tag": d.baseRollbackTag, "deployed": d})
     ctx.addStep(step)
 
 def handle_modify(pd, d, ctx):
-    if not none_or_empty(d.modifyOrder):
-        stepOrder=d.modifyOrder
-    else:
-        stepOrder=MODIFY_RESOURCES
     if d.rollbackVersion < pd.rollbackVersion:
         step = steps.jython(description="Rollback to tag [%s%s] in liquibase [%s]" % (d.rollbackVersionPrefix, d.rollbackVersion, d.container.name),
-                            order=stepOrder,
+                            order=DESTROY_RESOURCES,
                             script='liquibase/apply_rollback.py',
                             jython_context={"container": d.container, "tag": "%s%s" % (d.rollbackVersionPrefix, d.rollbackVersion), "deployed": pd})
         ctx.addStep(step)
diff --git a/src/main/resources/synthetic.xml b/src/main/resources/synthetic.xml
index 65991bb..0a832cb 100644
--- a/src/main/resources/synthetic.xml
+++ b/src/main/resources/synthetic.xml
@@ -15,13 +15,10 @@
 
     
 		
-		
-		
-		
-		
 
     

From 4532e6404602141b6fdef3f4cca6bb6b87f28ac1 Mon Sep 17 00:00:00 2001
From: "Klaas D. Eenkhoorn" 
Date: Mon, 13 Feb 2023 12:45:17 +0100
Subject: [PATCH 11/12] Reverted steplistoptions they are problematic to for
 now

---
 src/main/resources/liquibase/apply_tag.py | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/src/main/resources/liquibase/apply_tag.py b/src/main/resources/liquibase/apply_tag.py
index 4d7cac5..38c3d9f 100644
--- a/src/main/resources/liquibase/apply_tag.py
+++ b/src/main/resources/liquibase/apply_tag.py
@@ -8,12 +8,6 @@
 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-#
-# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
-# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
-#
-
 from __future__ import with_statement
 from overtherepy import OverthereHostSession
 from liquibase import *

From 05373276293d2f97b5b7ba1228cac75ed97f3060 Mon Sep 17 00:00:00 2001
From: "Klaas D. Eenkhoorn" 
Date: Mon, 13 Feb 2023 16:43:39 +0100
Subject: [PATCH 12/12] Testing script syntax error

---
 src/main/resources/liquibase/test.bat.ftl | 2 +-
 src/main/resources/liquibase/test.sh.ftl  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/liquibase/test.bat.ftl b/src/main/resources/liquibase/test.bat.ftl
index 295c4d5..b9901e1 100644
--- a/src/main/resources/liquibase/test.bat.ftl
+++ b/src/main/resources/liquibase/test.bat.ftl
@@ -9,5 +9,5 @@
     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<#if (container.liquibaseLauncher) >${container.liquibaseLauncher}<#else>${container.javaCmd} -jar ${container.liquibaseJarPath} --version
+<#if (container.liquibaseLauncher) ??>${container.liquibaseLauncher}<#else>${container.javaCmd} -jar ${container.liquibaseJarPath} --version
 
diff --git a/src/main/resources/liquibase/test.sh.ftl b/src/main/resources/liquibase/test.sh.ftl
index b997adf..3b71d54 100644
--- a/src/main/resources/liquibase/test.sh.ftl
+++ b/src/main/resources/liquibase/test.sh.ftl
@@ -11,5 +11,5 @@
 -->
 
 #!/bin/sh
-<#if (container.liquibaseLauncher) >${container.liquibaseLauncher}<#else>${container.javaCmd} -jar ${container.liquibaseJarPath} --version
+<#if (container.liquibaseLauncher) ??>${container.liquibaseLauncher}<#else>${container.javaCmd} -jar ${container.liquibaseJarPath} --version