m-khvoinitsky / workflow-templater

Template engine for (currently) Jira and Email. Uses yaml and jinja2. It helps you create multiple (possibly cross-liked) jira issues and emails from a template.
MIT License
6 stars 3 forks source link

Intro

Template engine for (currently) Jira and Email. Uses yaml and jinja2. It helps you create multiple (possibly cross-linked) jira issues and emails from a template.

Table of Contents

Installation

Windows

  1. Download WorkflowTemplater${version}.exe from the latest release on Releases page.
  2. Install it.
  3. Now workflow-templater executable should be available from Windows Command Prompt (cmd.exe) and from Powershell.
  4. (Optional, recommended) Install Windows Terminal and use it instead of default console.

macOS

  1. Install python ≥ 3.10.
    • Using official Python installer:
      1. Install python ≥ 3.10 from https://python.org/ ("macOS 64-bit installer")
      2. Install CA certificates for python, execute in Terminal:
        /Applications/Python\ 3.7/Install\ Certificates.command

        Alternatively, you can double-click on Install Certificates.command in Finder

    • Or using Homebrew:
      brew install python
  2. pip3 install workflow-templater

    Anything else (GNU/Linux, Cygwin, *nix, etc)

    Using pip

  3. Make sure that python ≥ 3.10 is installed
  4. pip3 install workflow-templater

    Using pipx

  5. pipx run workflow-templater

    From source

  6. Clone this repo
  7. Install dependencies if required
    pip3 install -r requirements.txt
  8. You can execute the script directly:
    cd workflow_templater
    ./workflow_templater/__init__.py --help

    Or install/build/whatever it with

    python3 setup.py

Usage

See

workflow-templater --help

Configuration

To avoid typing same command line arguments each time, it is possible to specify them in configuration file. Configuration file location is OS-specific, to find out correct location for your os, execute workflow-templater --help, you'll see message "--config CONFIG overwrite config file path, default is ${location}" where ${location} is the location of configuration file on your OS. You can create this file and specify values of command-line arguments omitting -- and replacing - with _, for example, --jira-user j_wayne becomes jira_user: j_wayne, --dry-run becomes dry_run: true and so on. You can also use jinja2 in configuration file which evaluates using variables from itself.

Example ~/.config/workflow-templater/config.yaml:

dry_run: true
verbose: true
user: j_wayne
jira: https://jira.example.com/
jira_user: '{{ user }}'
email_user: '{{ user }}'
email_from: '{{ user }}@example.com'
email_smtp: 'smtp.example.com:587'
# avoid typing in the same password for jira and email
jira_keyring_service_name: 'MyCorp LDAP'
email_keyring_service_name: 'MyCorp LDAP'

Template description

Overview

Examples

See basic release example for basic example.