A cookiecutter template for integration services syncpacks
$ pip install cookiecutter
$ cookiecutter https://github.com/ScienceLogic/is_syncpack_cookiecutter.git
You will be asked about basic information:
Prompt | Description |
---|---|
author | Creator of the SyncPack |
url_project | Link to the SyncPack Source Code |
syncpack_name | Name of the SyncPack Module |
syncpack_friendly_name | Display Name of the SyncPack |
syncpack_description | What does this SyncPack do? |
version | Initial SyncPack Version |
requires_minimum_pf_version | Which version(s) of PowerFlow will this SyncPack support? |
dev_container_source | Use SL External if you are not a ScienceLogic employee |
dev_container_version | dev_container_version image version. i.e. for PF 2.4.1, the version should be 2.4.1 |
The generated package includes VSCode configuration settings to improve the SyncPack development process.
The generated package will contain a Visual Studio Code DevContainer
When you open the generated folder with VSCode you will get a prompt to open the workspace within the container.
This PowerFlow Syncpack SDK(DevContainer) contains a functional environment for developing and testing your SyncPack steps without the need of a full PowerFlow system.
Usage
- After completing the cookie cutter run, open the generated folder in Visual Studio Code
- The .devcontainer folder should be detected and you should be prompted to re-open the workspace in the container. Click Yes.
If you are not prompted or you miss it, Open the command pallet (ctrl+shift+P) and run Remote-Containers: Reopen in Container
Your environemt should now be ready.
If you need any additional syncpacks or packages to be available, simply pip install
them into your container. Remember to add them to your dependancies!
The generated workspace contains a number of tasks to assist with development.
Usage:
- Open the Command Pallet
- Run
Tasks: Run Task
- Choose
PF: Build and Upload SyncPack
- Input your PF Hostname or IP
- Input your PF Username (default: isadmin)
- Input your PF Password (default: isadmin)
SyncPack should now be available to install on your PowerFlow system.
Initializes the pre-commit workflow. Run this after you have added a git repository to your workspace.
Usage:
- Open the Command Pallet
- Run
Tasks: Run Task
- Choose
Pre-Commit: Initialize
Pre-Commit should now be ready to use.
Manually run all Pre-Commit checks.
Usage:
- Open the Command Pallet
- Run
Tasks: Run Task
- Choose
Pre-Commit: Run All Files
Check pre-commit tasts for workflow updates and update them if needed.
Usage:
- Open the Command Pallet
- Run
Tasks: Run Task
- Choose
Pre-Commit: auto-update
Allows to install the current syncpack using offline dependencies.
Usage:
- Open the Command Pallet
- Run
Tasks: Run Task
- Choose
PF: Install SP - Offline Dependencies
- Input a Workspace Directory to read offline dependencies (default: ${workspaceFolder}/.offline_dependencies)
Allows to install the current syncpack using a remote PF system.
Usage:
- Open the Command Pallet
- Run
Tasks: Run Task
- Choose
PF: Install SP - Dependencies from PF(devpi)
- Input a Workspace Directory to read offline dependencies (default: ${workspaceFolder}/.offline_dependencies)
- Input your PF Hostname or IP
- Input your PF Username (default: isadmin)
- Input your PF Password (default: isadmin)
Allows to install the current syncpack using a remote PF system and offline dependencies.
Usage:
- Open the Command Pallet
- Run
Tasks: Run Task
- Choose
PF: Install SP - Dependencies from PF(devpi) + Offline dependencies
- Input a Workspace Directory to read offline dependencies (default: ${workspaceFolder}/.offline_dependencies)
- Input your PF Hostname or IP
- Input your PF Username (default: isadmin)
- Input your PF Password (default: isadmin)
The PFApp.code-snippets snippet allows to quickly have a basic application structure. Usage:
- Create a json file with the corresponding application name in the apps folder
- In the file write pfapp and when vscode suggests the expected snippet to use, press Enter
- The cursor will be positioned in the property that needs to be edited
- Press Tab to go the next property to edit
The PFStep.code-snippets snippet allows to quickly have a basic step structure.
Usage:
- Create a python file with the corresponding step name in the steps folder
- In the file start writing pfstep and when vscode suggests the expected snippet to use, press Enter
- The cursor will be positioned in the property that needs to be edited
- Press Tab to go the next property to edit
The PFStepTest.code-snippets snippet allows to quickly have a basic step structure.
Usage:
- Create a python file with the corresponding step test name in the tests/steps folder
- In the file start writing pfsteptest and when vscode suggests the expected snippet to use, press Enter
- The cursor will be positioned in the property that needs to be edited
- Press Tab to go the next property to edit
More details on how to use and create snippets in VSCode official documentation
The generated package will contain a settings.json
to enable pytest
and configure test discovery.
The generated package includes PyCharm configuration settings to improve the SyncPack development process.
Usage
- After completing the cookie cutter run, open the generated folder in PyCharm.
- When working with more than 1 syncpack repository, it is recommended to open the root directory in which the needed repositories are located.
- The .pycharm_devcontainer folder contains files to configure a Docker Python Interpreter in PyCharm
- Mark the syncpack directory as Source. Using Right Click > Mark Directory as > Sources Root
- Configure the docker-compose.yml file located in .pycharm_devcontainer/docker-compose.yml as a Docker Compose Remote Python interpreter. Follow the instruction in PyCharm official documentation.
- Select the interpreter created in the step 4 as default for your workspace
- Your environment should now be ready