fix: make version command work anywhere, update docs

This commit is contained in:
Stefan Reimer 2022-06-28 16:08:28 +02:00
parent d34100ab41
commit 7dd648ceff
2 changed files with 48 additions and 28 deletions

View File

@ -4,27 +4,49 @@
Toolset to deploy and maintain infrastructure in automated and trackable manner. Toolset to deploy and maintain infrastructure in automated and trackable manner.
First class support for: First class support for:
- [AWS CloudFormation](https://aws.amazon.com/cloudformation)
- [Pulumi](https://www.pulumi.com/docs/) - [Pulumi](https://www.pulumi.com/docs/)
- [AWS CloudFormation](https://aws.amazon.com/cloudformation)
# Install # Install
`$ pip install cloudbender` ## Container
This most likely only works on a recent Linux box/VM, which is capable of running rootless containers within containers.
Requires kernel >= 5.10, cgroupsV2 support, podman, ...
# State management ```
## Pulumi podman run -it --rm -v .:/workspace -v $HOME/.aws/config:/workspace/.aws/config public.ecr.aws/zero-downtime/cloudbender:latest cloudbender version
```
## Local install
1. ```pip install cloudbender```
2. ```curl -fsSL https://get.pulumi.com | sh```, see official [Docs](https://www.pulumi.com/docs/get-started/install/)
3. Ensure you either have `docker` or `podman` in your PATH.
To verify that all pieces are in place run:
```
cloudbender version
```
which should get you something like:
```
[2022-06-28 16:06:24] CloudBender: 0.13.4
[2022-06-28 16:06:24] Pulumi: v3.34.1
[2022-06-28 16:06:24] Podman/Docker: podman version 4.1.0
```
## State management
### Pulumi
The state for all Pulumi resources are stored on S3 in your account and in the same region as the resources being deployed. The state for all Pulumi resources are stored on S3 in your account and in the same region as the resources being deployed.
No data is send to nor shared with the official Pulumi provided APIs. No data is send to nor shared with the official Pulumi provided APIs.
CloudBender configures Pulumi with a local, temporary workspace on the fly. This incl. the injection of various common parameters like the AWS account ID and region etc. CloudBender configures Pulumi with a local, temporary workspace on the fly. This incl. the injection of various common parameters like the AWS account ID and region etc.
## Cloudformation ### Cloudformation
All state is handled by AWS Cloudformation. All state is handled by AWS Cloudformation.
The required account and region are determined by CloudBender automatically from the configuration. The required account and region are determined by CloudBender automatically from the configuration.
# CLI ## CLI
``` ```
Usage: cloudbender [OPTIONS] COMMAND [ARGS]... Usage: cloudbender [OPTIONS] COMMAND [ARGS]...
@ -58,9 +80,6 @@ Commands:
- Within the config folder each directory represents either a stack group if it has sub-directories, or an actual Cloudformation stack in case it is a leaf folder. - Within the config folder each directory represents either a stack group if it has sub-directories, or an actual Cloudformation stack in case it is a leaf folder.
- The actual configuration for each stack is hierachly merged. Lower level config files overwrite higher-level values. Complex data structures like dictionaries and arrays are deep merged. - The actual configuration for each stack is hierachly merged. Lower level config files overwrite higher-level values. Complex data structures like dictionaries and arrays are deep merged.
## Quickstart
TBD
## Secrets handling ## Secrets handling
### Pulumi ### Pulumi

View File

@ -24,6 +24,8 @@ logger = logging.getLogger(__name__)
def cli(ctx, debug, directory): def cli(ctx, debug, directory):
setup_logging(debug) setup_logging(debug)
# Skip parsing all the things if we just want the versions
if ctx.invoked_subcommand != "version":
# Make sure our root is abs # Make sure our root is abs
if directory: if directory:
if not os.path.isabs(directory): if not os.path.isabs(directory):
@ -47,8 +49,7 @@ def cli(ctx, debug, directory):
@click.command() @click.command()
@click.pass_obj def version():
def version(cb):
"""Displays own version and all dependencies""" """Displays own version and all dependencies"""
logger.error(f"CloudBender: {__version__}") logger.error(f"CloudBender: {__version__}")