Skip to content

Commit

Permalink
Deployed e55bf21 with MkDocs version: 1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mjordan committed Nov 10, 2024
1 parent e0bf2b5 commit 36b3206
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions rolling_back/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1029,23 +1029,25 @@ <h1>Rolling back nodes and media</h1>
<p>To roll back all the nodes and media you just created, run <code>./workbench --config rollback.yml</code>.</p>
<p>There are several configuration settings that let you control the names of these two files, and there is also an option to include comments in the files.</p>
<h2 id="setting-the-directory-where-the-rollback-cvs-file-is-written">Setting the directory where the rollback CVS file is written</h2>
<p>You can determine where the rollback CSV file is written by including the <code>rollback_dir</code> in your configuration. This overrides the default location defined in <code>input_dir</code>. The rollback configuration file is always written to the Workbench working directory.</p>
<p>You can determine where the rollback CSV file is written by including the <code>rollback_dir</code> in your configuration. This overrides the default location defined in <code>input_dir</code>.</p>
<p>The rollback configuration file is always written to the Workbench working directory.</p>
<h2 id="using-rollback-filename-templates">Using rollback filename templates</h2>
<p>For both the rollback config file and the rollback CSV file, you can define a template that provides two variables, <code>$config_filename</code> and <code>$input_csv_filename</code>, which contain the names of the <code>create</code> (or <code>create_from_files</code>) configuration file and the name of the input CSV file used in <code>create</code> tasks. You can embed these two variables in your template, which is then used to create the names of the two files. The templates for the two filenames are defined in two separate configuration settings:</p>
<p>For both the rollback config file and the rollback CSV file, you can define a template that provides two placeholders, <code>$config_filename</code> and <code>$input_csv_filename</code>, which contain the names of the <code>create</code> (or <code>create_from_files</code>) configuration file and the name of the input CSV file used in <code>create</code> tasks. You can embed these two placeholders in your template, which is then used to create the names of the two files. The templates for the two filenames are defined in two separate configuration settings:</p>
<p>For the rollback configuration file:</p>
<pre><code>rollback_config_filename_template: my-custom_filename_$config_filename_$input_csv_filename
</code></pre>
<p>Assuming the configuration file for the <code>create</code> task that generates this rollback configuration has the name <code>mjtest.yml</code>, and the <code>input_csv</code> filename has the filename <code>sample.csv</code>, this template will result in a configuration file named <code>my-custom_filename_mjtest_sample.yml</code>.</p>
<p>Assuming the configuration file for the <code>create</code> task that generates this rollback configuration has the name "mjtest.yml", and the <code>input_csv</code> filename has the filename "sample.csv", this template will result in a configuration file named <code>my-custom_filename_mjtest_sample.yml</code>.</p>
<p>For the rollback CSV file:</p>
<pre><code>rollback_csv_filename_template: my_custom_rollback_filename_$config_filename_$input_csv_filename
</code></pre>
<p>Using the same <code>create</code> task configuration filename and input CSV filename as in the previous example, this template will result in a CSV file named <code>my_custom_rollback_filename_mjtest_sample.csv</code>.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Python's built-in templating system has a quirk where when a character that is valid in a Python variable name follows a template variable, that character is added to the template variable. If this happens to you, Workbench will exit with the error message "One or more parts of the configured rollback configuration filename template ([your template here]) need adjusting." You can work around this behavior by wrapping your template variable in <code>{}</code>. The example rollback config filename template above (<code>my-custom_filename_$config_filename_$input_csv_filename</code>) will trigger this error because the <code>_</code> following the <code>$config_filename</code> variable is valid in Python variable names. If you see this type of message, adjust your template to <code>my-custom_filename_${config_filename}_$input_csv_filename</code>.</p>
<p>Python's built-in templating system has a quirk where when a character that is valid in a Python variable name follows a template placeholder, that character is added to the template placeholder. If this happens to you, Workbench will exit with the error message "One or more parts of the configured rollback configuration filename template ([your template here]) need adjusting."</p>
<p>You can work around this behavior by wrapping your template variable in <code>{}</code>. The example rollback config filename template above (<code>my-custom_filename_$config_filename_$input_csv_filename</code>) will trigger this error because the <code>_</code> following the <code>$config_filename</code> placeholder is valid in Python variable names. If you see this type of message, adjust your template to <code>my-custom_filename_${config_filename}_$input_csv_filename</code>.</p>
</div>
<h2 id="adding-a-timestamp-to-the-rollback-filenames">Adding a timestamp to the rollback filenames</h2>
<p>By default, Workbench overwrites the rollback configuration and CSV files each time it runs, so these files only apply to the most recent <code>create</code> and <code>create_from_files</code> runs. If you add <code>timestamp_rollback: true</code> to your configuration file, a (to-the-second) timestamp will be added to the <code>rollback.yml</code> and corresponding <code>rollback.csv</code> files, for example, <code>rollback.2021_11_03_21_10_28.yml</code> and <code>rollback.2021_11_03_21_10_28.csv</code>. The name of the CSV is also written to <code>workbench.log</code>. Running <code>./workbench --config rollback.2021_11_03_21_10_28.yml</code> will delete the nodes identified in <code>input_data/rollback.2021_11_03_21_10_28.csv</code>.</p>
<p>By default, Workbench overwrites the rollback configuration and CSV files each time it runs, so these files only apply to the most recent <code>create</code> and <code>create_from_files</code> runs. If you add <code>timestamp_rollback: true</code> to your configuration file, a (to-the-second) timestamp will be added to the <code>rollback.yml</code> and corresponding <code>rollback.csv</code> files, for example, <code>rollback.2024_11_03_21_10_28.yml</code> and <code>rollback.2024_11_03_21_10_28.csv</code>. The name of the CSV is also written to <code>workbench.log</code>. Running <code>./workbench --config rollback.2024_11_03_21_10_28.yml</code> will delete the nodes identified in <code>input_data/rollback.2024_11_03_21_10_28.csv</code>.</p>
<p>Timestamps are added in the same way to custom rollback configuration and CSV filenames create using templates.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

Binary file modified sitemap.xml.gz
Binary file not shown.

0 comments on commit 36b3206

Please sign in to comment.