Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-velonis1 committed Jul 25, 2024
2 parents f26f0d8 + 17fdc73 commit 25e72d0
Showing 2 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -54,21 +54,13 @@ <h3>Install the Python package step-by-step</h3>
if lb.is_table(obj): # function provided from liquibase utilities
status.fired = True # indicates the custom check has been triggered
status.message = No tables allowed! # set the message of the custom check, which liquibase will return
sys.exit(1) # exit from the check</MadCap:codeSnippetBody></MadCap:codeSnippet><p>You have successfully activated the Checks Python package. Next you will go over usage of our helper scripts.</p></li>
sys.exit(1) # exit from the check</MadCap:codeSnippetBody></MadCap:codeSnippet><p>You have successfully activated the Checks Python package.</p></li>
</ol>
<h3>Install the Python package and import tools step-by-step</h3>
<p>This option allows you to enhance your checks further with usage of specific items within the Python package.</p>
<ol>
<li>In your virtual environment, install the package by running <code>pip install liquibase-checks-python</code> in the CLI.</li>
<li>Navigate to the location where you import <code>liquibase_utilities</code> and replace <code>import liquibase_utilities</code> with <code>from liquibase_checks_python import liquibase_utilities</code> in your Python script.<br />Now the Python package that includes the helper scripts is activated.<br /></li>
<li>Next you will call on a specific helper script.<br />In this example we will run <code>logger = liquibase_utilities.get_logger</code></li>
<li>When the check runs it will retrieve any content it finds based on the criteria you asked for and display it in the CLI.</li>
</ol>
<h2>Access helper scripts</h2>
<h3>Step-by-step</h3>
<ol>
<h2 MadCap:conditions="exclude.future">Access helper scripts</h2>
<h3 MadCap:conditions="exclude.future">Step-by-step</h3>
<ol MadCap:conditions="exclude.future">
<li>Navigate to your Custom Policy Check Python script that you want to implement helper scripts in.</li>
<li>Next you will include a specific helper script function in your Custom Policy Check Python script.<br />In this example we will include <code>logger = liquibase_utilities.get_logger</code> to pull the <MadCap:variable name="General.Liquibase" /> log.<br /><ul><li><MadCap:codeSnippet><MadCap:codeSnippetCopyButton /><MadCap:codeSnippet><MadCap:codeSnippetCopyButton /><MadCap:codeSnippetBody MadCap:useLineNumbers="False" MadCap:lineNumberStart="1" MadCap:continue="False" xml:space="preserve" style="mc-code-lang: Python;">import sys # useful for indicating a check has been triggered
<li MadCap:conditions="exclude.future">Next you will include a specific helper script function in your Custom Policy Check Python script.<br />In this example we will include <code>logger = liquibase_utilities.get_logger</code> to pull the <MadCap:variable name="General.Liquibase" /> log.<br /><ul><li><MadCap:codeSnippet><MadCap:codeSnippetCopyButton /><MadCap:codeSnippet><MadCap:codeSnippetCopyButton /><MadCap:codeSnippetBody MadCap:useLineNumbers="False" MadCap:lineNumberStart="1" MadCap:continue="False" xml:space="preserve" style="mc-code-lang: Python;">import sys # useful for indicating a check has been triggered
from liquibase_checks_python import liquibase_utilities as lb # this is where we are importing our liquibase_utilities helper script provided by the liquibase-checks-python package

liquibase_logger = liquibase_utilities.get_logger()
2 changes: 2 additions & 0 deletions scripts/redirect_creation/variables.tf
Original file line number Diff line number Diff line change
@@ -14,6 +14,8 @@ variable "redirects" {
{ key = "/2014/11/faq.html", website_redirect = "/faq.html" },
{ key = "/2014/11/home.html", website_redirect = "/home.html" },
{ key = "/2014/11/popular-topics.html", website_redirect = "/home.html" },
{ key = "/bigquery", website_redirect = "/start/tutorials/google-bigquery/home.html" },
{ key = "/bigquery.html", website_redirect = "/start/tutorials/google-bigquery/home.html" },
{ key = "/change-tracking/maintenance/tag.html", website_redirect = "/commands/utility/tag.html" },
{ key = "/change-types", website_redirect = "/change-types/home.html" },
{ key = "/change-types/column.html", website_redirect = "/change-types/nested-tags/column.html" },

0 comments on commit 25e72d0

Please sign in to comment.