A CLI way to generate and upload cloudshell orchestration scripts
Project description
Cloudshell Scriptfoundry
A CLI tool to generate, package and upload cloudshell orchestration scripts. This tool is an optional add-on to the shellfoundry shell development cli tool. "Scriptfoundry" has shellfoundry as a dependency, and re-uses the same cli configuration.
Installation
pip install cloudshell-scriptfoundry
Basic Usage
Configure "Shellfoundry" Credentials (shared by "Scriptfoundry")
shellfoundry config host localhost
shellfoundry config username admin
shellfoundry config password admin
To check configured values:
shellfoundry config
See Shellfoundry Reference for more info.
Generate new project:
scriptfoundry new setup_config_firewall --template setup
Zip and upload to cloudshell:
cd setup_config_firewall
scriptfoundry update setup_config_firewall
Commands Overview
Usage: scriptfoundry [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
new Create new script from template
pack Create script zip archive
update Create zip archive and update on CloudShell
version Display scriptfoundry version
Template Generation
"New" command generates script template. The templates map to the orchestration script "types" in cloudshell (setup, teardown, default, save, restore, resource).
Usage: scriptfoundry new [OPTIONS] NAME
Create new script from template
Options:
--template [setup|teardown|save|restore|blueprint|resource]
Specify script template 'type'. Defaults to
'blueprint'. [required]
--output TEXT (Optional) - Specify path to output
directory. Defaults to current directory.
--help Show this message and exit.
Offline Mode
Online mode will pull cookiecutter templates from github repo
To Setup up Offline mode:
- download templates from github release page
- Unzip templates and copy to designated location on client dev machine
- Set Shellfoundry config "online_mode" to False
- Add custom config key to shellfoundry config, with the templates path as value
Sample Configuration:
shellfoundry config online_mode False
shellfoundry config script_template_location "C:\cloudshell_dev_files\cloudshell-script-templates-0.1.0"
Dev Helper
It can be useful to use the api generator helper to get api session without having to add credentials to debug file. With this helper, no need to erase credentials and no accidentally commiting secrets to source control.
from scriptfoundry.utilities.api_generator import AutomationApiGenerator
SANDBOX_ID = "<DEBUG_SANDBOX_ID>"
api = AutomationApiGenerator().create_client()
sb_details = api.GetReservationDetails(SANDBOX_ID, disableCache=True).ReservationDescription
Dependencies
Scriptfoundry is built on top of shellfoundry, and its underlying open-source dependencies
- shellfoundry - cloudshell config management
- Cookiecutter - script template generation
- Click - CLI interface
License
Free Software: MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cloudshell-scriptfoundry-0.1.2.tar.gz
.
File metadata
- Download URL: cloudshell-scriptfoundry-0.1.2.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30ca83fe81fa3c11ed1d4c80f21308588324a04e57fdbb28aa9ebcd354fc17fc |
|
MD5 | 550e93a9d316a2b5b71e9b7b411a3103 |
|
BLAKE2b-256 | b1f04271986b79a28fe71b2132d873ce8ff6eace32401478737c07021e1e3d1c |
File details
Details for the file cloudshell_scriptfoundry-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: cloudshell_scriptfoundry-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1eebc6655dd4369adb2e24c5465c556e92adeb59c8cacd26a54bbcc9766ff9eb |
|
MD5 | dd45d48ef2fc07cf81e84d14188e286d |
|
BLAKE2b-256 | 7fc8d5de02a5c6f4c4f2aea94af32faa5f6b947a43f795fbdf3b3a857bfba38d |