Skip to main content

Python 3.9 Lint and Test PyPI version

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:

  1. download templates from github release page
  2. Unzip templates and copy to designated location on client dev machine
  3. Set Shellfoundry config "online_mode" to False
  4. 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

License

Free Software: MIT License

Metadata

Release files for cloudshell-scriptfoundry 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cloudshell-scriptfoundry 0.1.2
File Size Uploaded
cloudshell-scriptfoundry-0.1.2.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cloudshell-scriptfoundry 0.1.2
File Interpreter ABI Platform
cloudshell_scriptfoundry-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 19.8 kB

Release files / cloudshell-scriptfoundry-0.1.2.tar.gz

Download URL cloudshell-scriptfoundry-0.1.2.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
30ca83fe81fa3c11ed1d4c80f21308588324a04e57fdbb28aa9ebcd354fc17fc
BLAKE2b-256 checksum
How to use checksums
b1f04271986b79a28fe71b2132d873ce8ff6eace32401478737c07021e1e3d1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / cloudshell_scriptfoundry-0.1.2-py3-none-any.whl

Download URL cloudshell_scriptfoundry-0.1.2-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1eebc6655dd4369adb2e24c5465c556e92adeb59c8cacd26a54bbcc9766ff9eb
BLAKE2b-256 checksum
How to use checksums
7fc8d5de02a5c6f4c4f2aea94af32faa5f6b947a43f795fbdf3b3a857bfba38d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page