代码拉取完成,页面将自动刷新
package main
import (
"fmt"
"os"
"path"
"github.com/Sirupsen/logrus"
"github.com/docker/libcompose/cli/command"
rancherApp "github.com/rancher/rancher-compose/app"
"github.com/rancher/rancher-compose/executor"
"github.com/rancher/rancher-compose/version"
"github.com/urfave/cli"
)
func beforeApp(c *cli.Context) error {
if c.GlobalBool("verbose") {
logrus.SetLevel(logrus.DebugLevel)
}
return nil
}
func main() {
if path.Base(os.Args[0]) == "rancher-compose-executor" {
executor.Main()
} else {
cliMain()
}
}
func cliMain() {
factory := &rancherApp.ProjectFactory{}
app := cli.NewApp()
app.Name = "rancher-compose"
app.Usage = "Docker-compose to Rancher"
app.Version = version.VERSION
app.Author = "Rancher Labs, Inc."
app.Email = ""
app.Before = beforeApp
app.Flags = append(command.CommonFlags(),
cli.StringFlag{
Name: "url",
Usage: fmt.Sprintf(
"Specify the Rancher API endpoint URL",
),
EnvVar: "RANCHER_URL",
},
cli.StringFlag{
Name: "access-key",
Usage: fmt.Sprintf(
"Specify Rancher API access key",
),
EnvVar: "RANCHER_ACCESS_KEY",
},
cli.StringFlag{
Name: "secret-key",
Usage: fmt.Sprintf(
"Specify Rancher API secret key",
),
EnvVar: "RANCHER_SECRET_KEY",
},
cli.StringFlag{
Name: "rancher-file,r",
Usage: "Specify an alternate Rancher compose file (default: rancher-compose.yml)",
},
cli.StringFlag{
Name: "env-file,e",
Usage: "Specify a file from which to read environment variables",
},
cli.StringFlag{
Name: "bindings-file,b",
Usage: "Specify a file from which to read bindings",
},
)
app.Commands = []cli.Command{
rancherApp.CreateCommand(factory),
rancherApp.UpCommand(factory),
command.StartCommand(factory),
command.LogsCommand(factory),
rancherApp.RestartCommand(factory),
rancherApp.StopCommand(factory),
command.ScaleCommand(factory),
command.RmCommand(factory),
rancherApp.PullCommand(factory),
rancherApp.UpgradeCommand(factory),
}
if err := app.Run(os.Args); err != nil {
logrus.Fatal(err)
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。