Skip to main content

Deploy ephemeral websites.

Project description

Smokeshow CLI

CI license

CLI to deploy ephemeral websites, see smokeshow.helpmanual.io for more information.

Installation

pip install smokeshow

Usage

To get help on usage, run:

smokeshow --help

To generate an upload key, use:

smokeshow generate-key

You should then set the key as an environment variable with

export SMOKESHOW_AUTH_KEY='...'

With that, you can upload a site with:

smokeshow upload path/to/upload

For more help run smokeshow upload --help, if you run smokeshow upload without either setting the SMOKESHOW_AUTH_KEY environment variable or using the --auth-key option, smokeshow will generate a new upload key before uploading the site.

If you're having trouble with python versions and accessing the CLI, you can also run the smokeshow library module as a script via

python -m smokeshow

GitHub actions & commit status integration

I build smokeshow primarily to preview documentation and coverage generate with github actions.

smokeshow therefore integrates directly with github actions to add a status to commits with a link to the newly created ephemeral site.

In addition, smokeshow has custom logic to extract the total coverage figure from coverage.py HTML coverage reports to both annotate commit status updates and decide if the commit status is "success" or "failure".

Example of setting the commit status from a github action:

- run: smokeshow upload cli/htmlcov
  env:
    SMOKESHOW_GITHUB_STATUS_DESCRIPTION: CLI Coverage {coverage-percentage}
    SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 50
    SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}

(this is taken directly from smokeshow's own CI, see here)

The following environment variables are used when setting commit statuses:

  • SMOKESHOW_GITHUB_STATUS_DESCRIPTION (or alternatively the --github-status-description CLI option) set the description for the commit status; the string {coverage-percentage} has a special meaning and will be replaced by the actual coverage percentage if it can be extract from the root index.html file being uploaded, this must be set for smokeshow to set the commit status
  • SMOKESHOW_GITHUB_COVERAGE_THRESHOLD (or alternatively the --github-coverage-threshold CLI option) decide the "state" of the commit status update; success is used if either the total coverage number isn't available or it's above the threshold, failure is used if the coverage number is below this threshold
  • SMOKESHOW_GITHUB_TOKEN this is used to authenticate the status update, more details here
  • SMOKESHOW_GITHUB_PR_HEAD_SHA or if it's omitted or empty GITHUB_SHA (which is set automatically by github actions) are used to decide which commit to set the status on. The SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} trick shown above is required since github set the GITHUB_SHA env var to a merge commit on pull requests which isn't what you want
  • SMOKESHOW_GITHUB_CONTEXT suffix for github status context
  • GITHUB_REPOSITORY is set automatically by github actions, it's used to choose the repo to set the status on

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smokeshow-0.3.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smokeshow-0.3-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file smokeshow-0.3.tar.gz.

File metadata

  • Download URL: smokeshow-0.3.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for smokeshow-0.3.tar.gz
Algorithm Hash digest
SHA256 1f4805dc995ecdc4698fe14ecaf68a0f0282f3162d99bc925a9e0bc7c8d60deb
MD5 1965fadc8fc41663de50b2e3c4311241
BLAKE2b-256 ecfa04c5335a8e7a27a132c865228703214de6d9aac3ad1f981148315b1204c9

See more details on using hashes here.

File details

Details for the file smokeshow-0.3-py3-none-any.whl.

File metadata

  • Download URL: smokeshow-0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for smokeshow-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1a4847c5b2d7e286cb7b18e7c462fc9ce789edcb8339371ab9785c8691bebfc0
MD5 bcc80c10850145cc6382d6874e83cd45
BLAKE2b-256 6dd89f017c470bb4be652fea818c3aa82e2732b4e9b75ec62bbd7c6f2da1c9b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page