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

Develop #10

Closed
wants to merge 2 commits into from
Closed
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <rollbackVersionPrefix><rollbackVersion>, for example: "v1" or "abc-1".
8 changes: 4 additions & 4 deletions src/main/resources/liquibase/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/synthetic.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<generate-deployable type="liquibase.Changelog" extends="udm.BaseDeployableFolderArtifact" />
<property name="changeLogFile"/>
<property name="rollbackVersion" kind="integer"/>
<property name="rollbackVersionPrefix" kind="string" required="false" default="v" description="Prefix added to rollback tag. Default value 'v'"/>
<property name="baseRollbackTag" default="xld_liquibase_base_version" hidden="true"/>
</type>

Expand Down