func (d *Deploy) Run(ctx *args.Context) error {
	c := config.Load()
	if !c.Exists() {
		d.log.Error("Configuration file could not load. Run `ginger init` before.")
		return errors.New("")
	}
	var err error
	defer func() {
		if err != nil {
			d.log.Error(err.Error())
			debugTrace(err)
		} else {
			d.log.Info("Deployment finished.")
		}
		c.SortResources()
		c.Write()
	}()
	switch ctx.At(1) {
	case DEPLOYFUNCTION, DEPLOYFN:
		if err = d.runHook(c); err != nil {
			return err
		}
		err = d.deployFunction(c, ctx)
	case DEPLOYRESOURCE, DEPLOYR:
		if err = d.runHook(c); err != nil {
			return err
		}
		err = d.deployResource(c, ctx)
	case DEPLOYSCHEDULE, DEPLOYS:
		if err = d.runHook(c); err != nil {
			return err
		}
		err = d.deploySchedulers(c, ctx)
	case DEPLOYSTORAGE:
		if err = d.runHook(c); err != nil {
			return err
		}
		err = d.deployStorage(c, ctx)
	case DEPLOYALL:
		if err = d.runHook(c); err != nil {
			return err
		}
		d.log.Print("========== Function Deployment ==========")
		if err = d.deployFunction(c, ctx); err != nil {
			return err
		}
		d.log.Print("========== Storage Deployment ==========")
		if err = d.deployStorage(c, ctx); err != nil {
			return err
		}
		d.log.Print("========== Scheduler Deployment ==========")
		if err = d.deploySchedulers(c, ctx); err != nil {
			return err
		}
		d.log.Print("========== Resource Deployment ==========")
		if err = d.deployResource(c, ctx); err != nil {
			return err
		}
		if s := ctx.String("stage"); s != "" {
			d.log.Print("========== Stage Deployment ==========")
			if err = d.deployStage(c, ctx); err != nil {
				return err
			}
		}
	default:
		fmt.Println(d.Help())
	}
	return nil
}
Run the deploy command

>>> doc

## Deploy all

Deploy all functions, resources, storage items.

```
$ ginger deploy all [options]
```

| option  | description                                                         |
|:-------:|:--------------------------------------------------------------------|
| --stage | Stage name. If this option is supplied, create deployment to stage. |

<<< doc
package command
import (
	"bytes"
	"errors"
	"fmt"
	"os"
	"strings"
	"archive/zip"
	"io/ioutil"
	"os/exec"
	"path/filepath"
	"github.com/ysugimoto/go-args"
	"github.com/ysugimoto/ginger/config"
	"github.com/ysugimoto/ginger/entity"
	"github.com/ysugimoto/ginger/logger"
	"github.com/ysugimoto/ginger/request"
)
const (
	DEPLOYFUNCTION = "function"
	DEPLOYFN       = "fn"
	DEPLOYRESOURCE = "resource"
	DEPLOYR        = "r"
	DEPLOYSTORAGE  = "storage"
	DEPLOYSCHEDULE = "schedule"
	DEPLOYS        = "s"
	DEPLOYALL      = "all"
	DEPLOYHELP     = "help"
)
type Deploy struct {
	Command
	log *logger.Logger
}
func NewDeploy() *Deploy {
	return &Deploy{
		log: logger.WithNamespace("ginger.deploy"),
	}
}
func (d *Deploy) Help() string {
	return commandHeader() + `
deploy - Deploy management functions and apis.
Usage:
  $ ginger deploy [subcommand] [options]
Subcommand:
  function : Deploy functions (default: all, one of function if --name option supplied)
  resource : Deploy resources (default: all, one of path if --name option supplied)
  storage  : Deploy storage
  schedule : Deploy schedulers
  all      : Deploy both of functions and apis
  help     : Show this help
Options:
  --name  : Target fucntion name
  --stage : Target api stage
`
}