定制 guttmann/naut-cli 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

guttmann/naut-cli

Composer 安装命令:

composer create-project guttmann/naut-cli

包简介

CLI client for SilverStripe deploynaut

README 文档

README

A cli client for SilverStripe's deploynaut.

Install

Download the latest phar from the releases section of this repo and put it somewhere on your $PATH.

Or you can clone this repository and build the phar yourself by following the instructions in the Build section below.

Configuration

naut-cli can be configured in two ways.

  1. By creating a .naut.env file in the users home directory (generated with the naut-cli configure command)
  2. By setting the required environment variables before running any naut-cli commands

Required environment variables

If you are not going to use a .naut.env file in your home directory, these environment variables must be set:

  • NAUT_URL: the URL of the deploynaut instances
  • NAUT_USERNAME: your deploynaut username
  • NAUT_TOKEN: your deploynaut API token

Usage

There are a few different commands that can be run.

Configure

naut-cli can be configured by placing a .naut.env file in your home directory.

You can create this file interactively by running:

php naut-cli.phar configure

This will ask you for:

And create a new file at ~/.naut.env that is only readable by the current user.

Deploy

Deploy the latest commit of a project to a specific environment with deploy:

php naut-cli.phar deploy <project_id> <environment> <branch_name>

Where:

  • <project_id> is the short text identifier of the project in deploynaut (also seen in the deploynaut URL at /naut/project/<project_id>)
  • <environment> is the name of the environment you want to deploy to (e.g. 'prod', 'uat', 'test1')
  • <branch_name> is the name of the git branch you would like to deploy

A few things will happen when you run this command:

  1. Fetch latest changes from git
  2. Trigger deployment
  3. Stream the deployment log back to your terminal

Snapshots

List

You can see a list of snapshots for a specific stack with the command:

php naut-cli.phar snapshot:list <stack_id>

This will display a table containing columns for: the snapshot id, source environment, mode, size, and created date/time.

Delete

You can delete a snapshot with the command:

php naut-cli.phar snapshot:delete <stack_id> <snapshot_id>

Create

You can create a new snapshot for a specific stack/environment with the command:

php naut-cli.phar snapshot:create <stack_id> <snapshot_id>

Optionally, you can include the --mode flag. This flag sets the type of snapshot to create.

Valid options are:

  • all
  • db
  • assets

The default if the --mode flag is missing is all. Example usage: --mode=assets.

Download

You can download a snapshot with the command:

php naut-cli.phar snapshot:download <stack_id> <snapshot_id>

By default, this command will save the snapshot to the current directory with the same name as it exists within the dashboard. It will also display a progress bar while downloading by default.

If you would like to save to a different location/filename then you can use he --to-stdout option, and run the command like:

php naut-cli.phar snapshot:download <stack_id> <snapshot_id> --to-stdout > /path/to/your/file.sspak

When downloading this way the progress bar is not displayed.

Build phar from source

To build the naut-cli.phar file from source run the script bin/build-phar.sh.

This will create a fresh copy of the phar at dist/naut-cli.phar.

To do

  • Implement more of the deploynaut API

guttmann/naut-cli 适用场景与选型建议

guttmann/naut-cli 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 25 次下载、GitHub Stars 达 2, 最近一次更新时间为 2017 年 02 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 guttmann/naut-cli 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 guttmann/naut-cli 我们能提供哪些服务?
定制开发 / 二次开发

基于 guttmann/naut-cli 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-22