Skip to content

Commit

Permalink
Rename cli binary from cfn-compose to cfnc (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
omegazyadav authored Jan 2, 2023
1 parent 368f3a1 commit 714324c
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: "."
binary_name: "cfn-compose"
binary_name: "cfnc"
ldflags: "-s -w"
extra_files: LICENSE README.md

Expand All @@ -41,6 +41,6 @@ jobs:
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: "."
binary_name: "cfn-compose"
binary_name: "cfnc"
ldflags: "-s -w"
extra_files: LICENSE README.md
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.vscode
.cfn-compose
main
cfn-compose
cfnc
coverage
.DS_Store
.DS_Store
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
local-bin: build
cp ./cfn-compose ${GOPATH}/bin
cp ./cfnc ${GOPATH}/bin

build:
go build -o cfn-compose .
go build -o cfnc .

test:
mkdir -p coverage
Expand Down
78 changes: 39 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cfn-compose
# cfnc
A command-line tool for managing CloudFormation Stacks at scale.

By Balman Rawat, started as an experiment project at [CloudFactory](https://www.cloudfactory.com/)
Expand All @@ -14,17 +14,17 @@ By Balman Rawat, started as an experiment project at [CloudFactory](https://www.
![Demo](./docs/images/demo.gif)

## Overview
As the infrastrucutre evolves and gets complicated we need to manage/maintain multiple CloudFormation Stacks. When we want to `create/update/delete` these stacks we need to manually apply the actions one at a time. Deletion mostly in dev/test environment can be hectic as we should delete the stacks in the reverse of creation order. **cfn-compose** helps to manage multiple stacks that are closely related using declarative language.
As the infrastrucutre evolves and gets complicated we need to manage/maintain multiple CloudFormation Stacks. When we want to `create/update/delete` these stacks we need to manually apply the actions one at a time. Deletion mostly in dev/test environment can be hectic as we should delete the stacks in the reverse of creation order. **cfnc** helps to manage multiple stacks that are closely related using declarative language.

![overview image](./docs/images/cfn-compose.svg)

## Usage
```shell
cfn-compose --help
cfnc --help
Manage cloudformation stacks at scale. Design and deploy multiple cloudformation stacks either in sequence or in prallel using declarative configuration

Usage:
cfn-compose [command]
cfnc [command]

Available Commands:
completion Generate the autocompletion script for the specified shell
Expand All @@ -36,46 +36,46 @@ Available Commands:
Flags:
-c, --config string File path to compose file (default "cfn-compose.yml")
-d, --dry-run Run commands in dry run mode
-h, --help help for cfn-compose
-h, --help help for cfnc
-l, --loglevel string Specify Log Levels. Valid Levels are: DEBUG, INFO, WARN, ERROR (default "INFO")
-v, --version version for cfn-compose
-v, --version version for cfnc

Use "cfn-compose [command] --help" for more information about a command.
Use "cfnc [command] --help" for more information about a command.
```

#### Examples
```shell
## Deploy
cfn-compose deploy
cfnc deploy
## Deploy in dry run mode
cfn-compose deploy -d
cfnc deploy -d

## Destroy
cfn-compose destroy
cfnc destroy
## Destroy in dry run mode
cfn-compose destroy -d
cfnc destroy -d

## Generate Validate and Visualize compose configuration
cfn-compose config generate
cfn-compose config validate
cfn-compose config visualize
cfnc config generate
cfnc config validate
cfnc config visualize
```

## Man
| Command | Options | Description |
| ------------- | ------------- | ------------- |
| cfn-compose | -h, --help, help | Get description of cfn-compose |
| cfn-compose | -d, --dry-run | enable dry run mode |
| cfn-compose| -l, --loglevel | Specify Log Levels. Valid Levels are: DEBUG, INFO, WARN, ERROR (default "INFO") |
| cfn-compose| -c, --config | File path to compose file (default "cfn-compose.yml") |
| cfn-compose deploy | with no flag| deploys all the stacks |
| cfn-compose deploy | -f, --flow | Cherry pick specific flow to deploy |
| cfn-compose destroy | with no flag| destroys all the stacks |
| cfn-compose destroy | -f, --flow | Cherry pick specific flow to destroy |
| cfn-compose config generate | no flags | Generates compose template |
| cfn-compose config validate | no flags | Validates the compose configuration |
| cfn-compose config visualize | no flags | Visualize the stacks dependencies and creation order |
| cfn-compose | -v, --version | version for cfn-compose |
| cfnc | -h, --help, help | Get description of cfnc |
| cfnc | -d, --dry-run | enable dry run mode |
| cfnc| -l, --loglevel | Specify Log Levels. Valid Levels are: DEBUG, INFO, WARN, ERROR (default "INFO") |
| cfnc| -c, --config | File path to compose file (default "cfn-compose.yml") |
| cfnc deploy | with no flag| deploys all the stacks |
| cfnc deploy | -f, --flow | Cherry pick specific flow to deploy |
| cfnc destroy | with no flag| destroys all the stacks |
| cfnc destroy | -f, --flow | Cherry pick specific flow to destroy |
| cfnc config generate | no flags | Generates compose template |
| cfnc config validate | no flags | Validates the compose configuration |
| cfnc config visualize | no flags | Visualize the stacks dependencies and creation order |
| cfnc | -v, --version | version for cfnc |

## Compose Configuration
**Syntax:**
Expand Down Expand Up @@ -125,7 +125,7 @@ Vars:
```yaml
Description: Sample CloudFormation Compose file
Vars:
ENV_NAME: cfn-compose
ENV_NAME: cfnc
ENV_TYPE: nonproduction
Flows:
SecurityGroup:
Expand Down Expand Up @@ -168,47 +168,47 @@ Binary is available for Linux, Windows and Mac OS (amd64 and arm64). Download th

Linux:
```
curl -sSLO https://github.com/rbalman/cfn-compose/releases/download/v0.0.1-beta/cfn-compose-v0.0.1-beta-linux-amd64.tar.gz
curl -sSLO https://github.com/rbalman/cfn-compose/releases/download/v0.0.1-beta/cfnc-v0.0.2-beta-linux-amd64.tar.gz
```
```
tar zxf cfn-compose-v0.0.1-beta-linux-amd64.tar.gz
tar zxf cfnc-v0.0.2-beta-linux-amd64.tar.gz
```
```
sudo install -m 0755 cfn-compose /usr/local/bin/cfn-compose
sudo install -m 0755 cfnc /usr/local/bin/cfnc
```
macOS (Intel):
```
curl -sSLO https://github.com/rbalman/cfn-compose/releases/download/v0.0.1-beta/cfn-compose-v0.0.1-beta-darwin-amd64.tar.gz
curl -sSLO https://github.com/rbalman/cfn-compose/releases/download/v0.0.1-beta/cfnc-v0.0.2-beta-darwin-amd64.tar.gz
```
```
tar zxf cfn-compose-v0.0.1-beta-darwin-amd64.tar.gz
tar zxf cfnc-v0.0.2-beta-darwin-amd64.tar.gz
```
```
sudo install -m 0755 cfn-compose /usr/local/bin/cfn-compose
sudo install -m 0755 cfnc /usr/local/bin/cfnc
```
macOS (Apple Silicon):
```
curl -sSLO https://github.com/rbalman/cfn-compose/releases/download/v0.0.1-beta/cfn-compose-v0.0.1-beta-darwin-arm64.tar.gz
curl -sSLO https://github.com/rbalman/cfn-compose/releases/download/v0.0.1-beta/cfnc-v0.0.2-beta-darwin-arm64.tar.gz
```
```
tar zxf cfn-compose-v0.0.1-beta-darwin-arm64.tar.gz
tar zxf cfnc-v0.0.2-beta-darwin-arm64.tar.gz
```
```
sudo install -m 0755 cfn-compose /usr/local/bin/cfn-compose
sudo install -m 0755 cfnc /usr/local/bin/cfnc
```
Windows:
```
curl -sSLO https://github.com/rbalman/cfn-compose/releases/download/v0.0.1-beta/cfn-compose-v0.0.1-beta-windows-amd64.zip
curl -sSLO https://github.com/rbalman/cfn-compose/releases/download/v0.0.1-beta/cfnc-v0.0.2-beta-windows-amd64.zip
```
```
unzip cfn-compose-v0.0.1-beta-windows-amd64.zip
unzip cfnc-v0.0.2-beta-windows-amd64.zip
```
## Contribution
There is a lot of room for enhancements and you are more than welcome to contribute. If any concerns or recommendations [create issues](https://github.com/rbalman/cfn-compose/issues). If want to contribute [create PR](https://github.com/rbalman/cfn-compose/pulls)
There is a lot of room for enhancements and you are more than welcome to contribute. If any concerns or recommendations [create issues](https://github.com/rbalman/cfnc/issues). If want to contribute [create PR](https://github.com/rbalman/cfnc/pulls)
## Contributors
- [Balman Rawat](https://github.com/rbalman)
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ var dryRun bool
var flowName string

var rootCmd = &cobra.Command{
Use: "cfn-compose",
Version: "0.0.1-beta",
Use: "cfnc",
Version: "0.0.2-beta",
Short: "Declarative way of managing cloudformation stacks at scale",
Long: `Manage cloudformation stacks at scale. Design and deploy multiple cloudformation stacks either in sequence or in prallel using declarative configuration`,
}
Expand Down
12 changes: 6 additions & 6 deletions examples/ec2-sg/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Compose File
```yaml
Description: Sample CloudFormation Compose file
Vars:
ENV_NAME: cfn-compose
ENV_NAME: cfnc
ENV_TYPE: nonproduction
SUBNET_ID: "subnet-033274e18559e7bde"
VPC_ID: "vpc-0001e3b703212c9cb"
Expand Down Expand Up @@ -86,9 +86,9 @@ Parameters:
Type: String
Default: t2.nano
Resources:
ExampleEC2Instance:
ExampleEC2Instance:
Type: AWS::EC2::Instance
Properties:
Properties:
ImageId: !Ref ImageId
InstanceType: !Ref InstanceType
SubnetId: !Ref SubnetId
Expand All @@ -101,10 +101,10 @@ Resources:
Value: !Ref EnvironmentType
```
## Visualize
`cfn-compose config visualize`
`cfnc config visualize`

## Deploy
`cfn-compose deploy`
`cfnc deploy`

## Destroy
`cfn-compose destroy`
`cfnc destroy`

0 comments on commit 714324c

Please sign in to comment.