Skip to main content
PyCon US is happening May 14th-22nd in Pittsburgh, PA USA.  Learn more

unofficial caprover api to deploy apps to caprover

Project description

Caprover API

https://img.shields.io/pypi/v/caprover_api.svg https://img.shields.io/travis/ak4zh/caprover_api.svg Documentation Status

unofficial caprover api to deploy apps to caprover

Features

  • create app

  • add custom domain

  • enable ssl

  • update app with port mappings, env variables, repo info etc

  • deploy one click apps

  • get list of all apps

  • get app by name

  • delete app

  • delete app and it’s volumes

  • stop app

  • scale app

Usage

To use Caprover API in a project:

from caprover_api import caprover_api

cap = caprover_api.CaproverAPI(
    dashboard_url="cap-dashboard-url",
    password="cap-dashboard-password"
)

One Click Apps

get app name from List of one-click-apps

automated deploy:

app_variables = {
    "$$cap_redis_password": "REDIS-PASSWORD-HERE"
}
cap.deploy_one_click_app(
    one_click_app_name='redis',
    namespace='new-app',
    app_variables=app_variables,
    automated=True
)

manual deploy (you will be asked to enter required variables during runtime):

cap.deploy_one_click_app(
    one_click_app_name='redis',
    namespace='new-app',
)

Custom Apps

create a new app:

cap.create_app(
    app_name="new-app",
    has_persistent_data=False
)

create and deploy redis app from docker hub:

cap.create_and_update_app(
    app_name="new-app-redis",
    has_persistent_data=False,
    image_name='redis:5',
    persistent_directories=['new-app-redis-data:/data', ]
)

History

0.1.24 (2024-12-16)

  • Fix & test update from novel kwargs (#12)

  • update method lets you set httpAuth (#11)

  • update() now handles persistent directories that use hostPath (#7)

  • gen_random_hex works across whole one-click-app YAML (#6)

  • Bugfix: update() should not change notExposeAsWebApp (#8)

  • Enable SSL on base domain (#9)

  • Allow optional override one-click repository path (#5)

0.1.0 (2021-06-11)

  • First release on PyPI.

Supported by

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