diff --git a/README.md b/README.md index 82882deb..591fb803 100644 --- a/README.md +++ b/README.md @@ -181,15 +181,23 @@ Deployment happens manually via Bitbucket Pipelines Bitbucket Pipelines name: myvbv https://myvbv.control.iterativ.ch/ -https://myvbv.iterativ.ch/ - +https://myvbv.iterativ.ch/v Deployment happens manually via Bitbucket Pipelines ### CapRover feature branch deployment You can deploy every feature branch to CapRover directly from Bitbucket Pipelines -with a manual step. +with a manual step. Either in the "normal" pipeline by running "deploy feature" +as last manual step. + +You can also select deploy-step direclty under + +`Branches > Actions > Run pipeline` for a branch +and then `custom: deploy-feature-branch -> Run` in the modal. + +![](./docs/assets/deploy-feature1.png) +![](./docs/assets/deploy-feature2.png) When you run caprover_deploy.sh without arguments, it will deploy the current branch @@ -199,6 +207,9 @@ When you run caprover_deploy.sh without arguments, it will deploy the current br ### Cleanup caprover feature branch deployments +You can delete the CapRover App and DB directly in the CapRover interface +or use the `caprover_cleanup.py` script. + ```bash # by default it will delete all vbv-feature-* apps python caprover_cleanup.py diff --git a/caprover_create_app.py b/caprover_create_app.py index e137bcf1..779aa5db 100644 --- a/caprover_create_app.py +++ b/caprover_create_app.py @@ -64,6 +64,11 @@ def main(app_name, image_name, environment_file): default_allowed_hosts = f"{app_name}.iterativ.ch,{app_name}.control.iterativ.ch" + app_environment = env.str("IT_APP_ENVIRONMENT", "dev-feature") + if app_environment == "local": + # local is never the correct value... + app_environment = "dev-feature" + cap.create_and_update_app( app_name=app_name, enable_ssl=True, @@ -72,7 +77,7 @@ def main(app_name, image_name, environment_file): image_name=image_name, container_http_port=7555, environment_variables={ - "IT_APP_ENVIRONMENT": env.str("IT_APP_ENVIRONMENT", "dev-feature"), + "IT_APP_ENVIRONMENT": app_environment, "IT_DEFAULT_ADMIN_PASSWORD": env.str( "IT_DEFAULT_ADMIN_PASSWORD", "ACEEs0DCmNaPxdoNV8vhccuCTRl9b" ), diff --git a/docs/assets/deploy-feature1.png b/docs/assets/deploy-feature1.png new file mode 100644 index 00000000..19ec13bf Binary files /dev/null and b/docs/assets/deploy-feature1.png differ diff --git a/docs/assets/deploy-feature2.png b/docs/assets/deploy-feature2.png new file mode 100644 index 00000000..c58981f6 Binary files /dev/null and b/docs/assets/deploy-feature2.png differ