Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add io2 and modify documentation #103

Merged
merged 1 commit into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cmd/goployer/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var (
)

// NewRootCommand creates new root command
func NewRootCommand(_, stderr io.Writer) *cobra.Command {
func NewRootCommand(out, stderr io.Writer) *cobra.Command {
cobra.OnInitialize(initConfig)
rootCmd := &cobra.Command{
Use: "goployer",
Expand All @@ -47,6 +47,8 @@ You can find more information in https://goployer.dev`,
SilenceErrors: true,
SilenceUsage: true,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
cmd.Root().SetOutput(out)

// Setup logs
if err := setUpLogs(stderr, v); err != nil {
return err
Expand All @@ -71,7 +73,7 @@ You can find more information in https://goployer.dev`,
rootCmd.AddCommand(NewAddCommand())
rootCmd.AddCommand(NewUpdateCommand())

rootCmd.PersistentFlags().StringVarP(&v, "verbosity", "v", constants.DefaultLogLevel.String(), "Log level (debug, info, warn, error, fatal, panic)")
rootCmd.PersistentFlags().StringVarP(&v, "log-level", "v", constants.DefaultLogLevel.String(), "Log level (debug, info, warn, error, fatal, panic)")

return rootCmd
}
Expand Down
9 changes: 6 additions & 3 deletions cmd/goployer/cmd/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ var FlagRegistry = map[string][]Flag{
{
Name: "log-level",
Usage: "Level of logging",
Shorthand: "v",
Value: aws.String(constants.EmptyString),
DefValue: "info",
DefValue: "warning",
FlagAddMethod: "StringVar",
},
{
Expand Down Expand Up @@ -210,17 +211,19 @@ var FlagRegistry = map[string][]Flag{
{
Name: "log-level",
Usage: "Level of logging",
Shorthand: "v",
Value: aws.String(constants.EmptyString),
DefValue: "info",
DefValue: "warning",
FlagAddMethod: "StringVar",
},
},
"addSet": {
{
Name: "log-level",
Usage: "Level of logging",
Shorthand: "v",
Value: aws.String(constants.EmptyString),
DefValue: "info",
DefValue: "warning",
FlagAddMethod: "StringVar",
},
},
Expand Down
5 changes: 3 additions & 2 deletions configs/hello.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ stacks:
# If you do not set volume_type, it would be gp2.
block_devices:
- device_name: /dev/xvda
volume_size: 100
volume_type: "gp2"
volume_size: 8
volume_type: "io2"
iops: 200
- device_name: /dev/xvdb
volume_type: "st1"
volume_size: 500
Expand Down
150 changes: 124 additions & 26 deletions docs/content/en/docs/References/commandline/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Initiate project:

Retrieve and Modify deployment:
* [goployer status](#goployer-status) - Retrieve information of the specific deployment
* [goployer update](#goployer-update) - Update configuration of deployment without re-deployment

<br>

Expand All @@ -23,57 +24,138 @@ Total Deployment Process:

## goployer init
- setup goployer project
```

```bash
Examples:
# Minimum argument
goployer init

# See log
goployer init --log-level=debug

Options:
--log-level string Level of logging
Flags:
-h, --help help for init
-p, --profile string Profile configuration of AWS

Global Flags:
-v, --log-level string Log level (debug, info, warn, error, fatal, panic) (default "warning")
```

- All project files will be created in current directory.
- All project files will be created in the current directory.
- manifests
- scripts
- metric.yaml
<br>

## goployer add
- add new goployer manifest file
```

```bash
Examples:
# Minimum argument
goployer add

# You can specify application name from command
goployer add hello

Options:
--log-level string Level of logging
Flags:
-h, --help help for add
-p, --profile string Profile configuration of AWS

Global Flags:
-v, --log-level string Log level (debug, info, warn, error, fatal, panic) (default "warning")
```
<br>


## goployer status
- Retrieve information of the specific deployment
```

```bash
Examples:
# Minimum argument
goployer status hello

# With region
goployer status hello --region=ap-northeast-2

Options:
--region string Region of autoscaling group
Usage:
goployer status [flags]

Flags:
-h, --help help for status
-p, --profile string Profile configuration of AWS
--region string Region of autoscaling group

Global Flags:
-v, --log-level string Log level (debug, info, warn, error, fatal, panic) (default "warning")
```

```bash
$ goployer status hello
? Choose autoscaling group: hello-dev_apnortheast2-v003
Name: hello-dev_apnortheast2-v003
Created Time: 2020-09-16 10:29:21.169 +0000 UTC

📦 Capacity
MINIMUM DESIRED MAXIMUM
1 1 2

🖥 Instance Statistics
∙ t3.medium: 1

⚓ Tags
∙ Name=hello-dev_apnortheast2-v003
∙ ansible-tags=all
∙ app=hello
∙ project=test
∙ repo=hello-deploy
∙ stack=_apnortheast2
∙ stack-name=artd
∙ test=test
```
<br>

## goployer deploy
- Deploy a new application
## goployer update
- Update configuration of deployment without re-deployment
- Capacity modification: change value of min/desired/max

```bash
Examples:
# Minimum argument
# at least one of `--min, --max, --desired` is needed
goployer update hello --desired=1 --min=0 --max=1

# Auto apply without confirmation
goployer update hello --desired=1 --auto-apply

# Update with other options
goployer update hello --desired=1 --region=ap-northeast-2 --auto-apply --polling-interval=20s

Usage:
goployer update name-prefix [flags]

Flags:
--auto-apply Apply command without confirmation from local terminal
--desired int Desired instance capacity you want to update with (default -1)
-h, --help help for update
--max int Maximum instance capacity you want to update with (default -1)
--min int Minimum instance capacity you want to update with (default -1)
--polling-interval duration Time to interval for polling health check (default 60s) (default 1m0s)
-p, --profile string Profile configuration of AWS
--region string Region of autoscaling group
--timeout duration Time to wait for deploy to finish before timing out (default 60m) (default 1h0m0s)

Global Flags:
-v, --log-level string Log level (debug, info, warn, error, fatal, panic) (default "warning")
```
<br>


## goployer deploy
- Deploy a new application

```bash
Examples:
# Minimum argument
goployer deploy --manifest=configs/hello.yaml --stack=artd --region=ap-northeast-2
Expand All @@ -87,26 +169,30 @@ Examples:
# Control polling interval for healthcheck
goployer deploy --manifest=configs/hello.yaml --stack=artd --region=ap-northeast-2 --polling-interval=30s

Options:
-m, --manifest string The manifest configuration file to use. (required)
--stack string stack that should be deployed.(required)
--manifest-s3-region string Region of bucket containing the manifest configuration file to use. (required if –manifest starts with s3://)
Flags:
--ami string Amazon AMI to use.
--ansible-extra-vars string Extra variables for ansible
--assume-role string The Role ARN to assume into.
--auto-apply Apply command without confirmation from local terminal
--disable-metrics Disable gathering metrics.
--env string The environment that is being deployed into.
--extra-tags string Extra tags to add to autoscaling group tags
--force-manifest-capacity Force-apply the capacity of instances in the manifest file
--log-level string Level of logging
-h, --help help for deploy
-m, --manifest string The manifest configuration file to use. (required)
--manifest-s3-region string Region of bucket containing the manifest configuration file to use. (required if –manifest starts with s3://)
--override-instance-type string Instance Type to override
--polling-interval duration Time to interval for polling health check (default 60s) (default 1m0s)
-p, --profile string Profile configuration of AWS
--region string The region to deploy into, if undefined, then the deployment will run against all regions for the given environment.
--release-notes string Release note for the current deployment
--release-notes-base64 string Base64 encoded string of release note for the current deployment
--slack-off Turn off slack alarm
--stack string stack that should be deployed.(required)
--timeout duration Time to wait for deploy to finish before timing out (default 60m) (default 1h0m0s)
--auto-apply Apply command without confirmation from local terminal

Global Flags:
-v, --log-level string Log level (debug, info, warn, error, fatal, panic) (default "warning")
```
<br>

Expand All @@ -115,8 +201,8 @@ Options:

## goployer delete
- Delete previous applications
```

```bash
Examples:
# Minimum argument
goployer delete --manifest=configs/hello.yaml --stack=artd --region=ap-northeast-2
Expand All @@ -127,18 +213,30 @@ Examples:
# Control polling interval for healthcheck
goployer delete --manifest=configs/hello.yaml --stack=artd --region=ap-northeast-2 --polling-interval=30s

Options:
-m, --manifest string The manifest configuration file to use. (required)
--stack string stack that should be deployed.(required)
--manifest-s3-region string Region of bucket containing the manifest configuration file to use. (required if –manifest starts with s3://)
--region string The region to deploy into, if undefined, then the deployment will run against all regions for the given environment.
Flags:
--ami string Amazon AMI to use.
--ansible-extra-vars string Extra variables for ansible
--assume-role string The Role ARN to assume into.
--auto-apply Apply command without confirmation from local terminal
--disable-metrics Disable gathering metrics.
--env string The environment that is being deployed into.
--log-level string Level of logging
--extra-tags string Extra tags to add to autoscaling group tags
--force-manifest-capacity Force-apply the capacity of instances in the manifest file
-h, --help help for delete
-m, --manifest string The manifest configuration file to use. (required)
--manifest-s3-region string Region of bucket containing the manifest configuration file to use. (required if –manifest starts with s3://)
--override-instance-type string Instance Type to override
--polling-interval duration Time to interval for polling health check (default 60s) (default 1m0s)
-p, --profile string Profile configuration of AWS
--region string The region to deploy into, if undefined, then the deployment will run against all regions for the given environment.
--release-notes string Release note for the current deployment
--release-notes-base64 string Base64 encoded string of release note for the current deployment
--slack-off Turn off slack alarm
--stack string stack that should be deployed.(required)
--timeout duration Time to wait for deploy to finish before timing out (default 60m) (default 1h0m0s)
--auto-apply Apply command without confirmation from local terminal

Global Flags:
-v, --log-level string Log level (debug, info, warn, error, fatal, panic) (default "warning")
```
<br>

13 changes: 10 additions & 3 deletions docs/content/en/schemas/metric.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"region": {
"type": "string",
"description": "Base region for gathering metrics",
"x-intellij-html-description": "Base region for gathering metrics"
"x-intellij-html-description": "Base region for gathering metrics",
"default": "\"\""
},
"storage": {
"$ref": "#/definitions/Storage",
Expand All @@ -27,17 +28,23 @@
"description": "Metric Builder Configurations",
"x-intellij-html-description": "Metric Builder Configurations"
},
"Metrics": {
"description": "Configurations of metrics",
"x-intellij-html-description": "Configurations of metrics"
},
"Storage": {
"properties": {
"name": {
"type": "string",
"description": "Storage Name",
"x-intellij-html-description": "Storage Name"
"x-intellij-html-description": "Storage Name",
"default": "\"\""
},
"type": {
"type": "string",
"description": "Storage Type - dynamodb",
"x-intellij-html-description": "Storage Type - dynamodb"
"x-intellij-html-description": "Storage Type - dynamodb",
"default": "\"\""
}
},
"additionalProperties": false,
Expand Down
Loading