npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gkjx-deploy

v1.0.12

Published

deploy frontend projects

Downloads

2

Readme

欢迎使用自动化部署工具 gkjx-deploy

gkjx-deploy 是一键自动化部署工具,可以根据配置文件中定义的参数自动化部署至服务器。

##Npm 安装 全局安装 npm install gkjx-deploy -g

##命令 初始化配置文件 g-deploy -V

查看当前版本

初始化配置文件 g-deploy init

初始化配置文件命令,执行完成之后会在当前目录生成一个 gkjx.deploy.js 文件,可自由配置。

执行部署 g-deploy deploy

根据配置文件信息执行一键部署命令

执行部署指定环境 g-deploy deploy -env test

根据配置文件信息执行一键部署命令

版本回退 g-deploy rollback

在部署成功之后,工具会把创建一个 release 文件夹,保留至多默认 3 个版本,执行此命令会回退至更旧的版本。

##配置文件示例

module.exports = {
  default: {
    name: "全部环境",
    webDir: "/opt/webApp",
    buildCommands: "npm run build",
    archiveDir: "dist",
    keepReleases: 5,
    commandBeforeDeploy: "mkdir commandBeforeDeploy",
    commandAfterDeploy: "npm run start",
    servers: [
      {
        host: "192.168.100.17",
        port: 22,
        username: "root",
        password: "123456",
      },
      {
        host: "192.168.100.18",
        port: 22,
        username: "root",
        password: "123456",
      },
      {
        host: "192.168.100.18",
        port: 22,
        username: "root",
        privateKey: "/path",
      },
    ],
  },
  aliyun: {
    name: "开发环境",
    webDir: "/opt/webApp",
    buildCommands: "npm run build",
    archiveDir: "dist",
    servers: [
      {
        host: "192.168.100.18",
        port: 22,
        username: "root",
        password: "123456",
      },
    ],
  },
};

##配置文件参数说明 | 参数名 | 说明 | 类型 | 默认值 | 是否必须 | | -------- | :-----: | :-----: |:-----: |:-----: | | name | 为配置项指定一个 name 名称 | String | - | 是 | | webDir | 目标服务器上的部署目录 | String | - | 是 | | clearWebDir | 是否清空部署目录后再部署,默认不清 | Boolean | false | 否 | | archiveDir | 需要部署至服务器的本机文件夹 | String | - | 是 | | servers | 需要部署服务器的配置列表 | Array | - | 是 | | servers-host | 服务器公网 IP 地址 | String | - | 是 | | servers-port | 服务器公网端口号 | Number | - | 是 | | servers-username | 服务器的用户名 | String | - | 是 | | servers-password | 服务器的密码 | String | - | 是 | | servers-privateKey | 服务器的密钥绝对路径 | String | - | 是 | | withOutConfirm | 在开始部署前是否需要手动确认 | Boolean | false | 否 | | confirmTip | 部署提示(仅在 withOutConfirm 为 false 时生效) | String | - | 否 | | buildCommands | 开始部署前在本机执行的打包命令 | String | - | 否 | | commandBeforeDeploy | 当与服务器建立连接后执行的命令 | String | - | 否 | | commandAfterDeploy | 当文件部署完成后执行的命令 | String | - | 否 | | keepReleases | 指定保留版本的数量 | Number | 3 | 否 |