GithubHelp home page GithubHelp logo

ssh-deploy's Introduction

ssh-publish

基于ssh进行项目上传和部署的小脚本。适用于小型项目的发布,特别是一些没有CI/CD的项目,而直接部署在远程VPS上

安装

npm install ssh-publish -g

使用

s2p publish

可选入参:

-h: 主机地址

-p: ssh端口

-u: ssh用户名

-w: ssh密码

-k: ssh密钥内容 | ssh密钥文件路径

-r: 远程路径

-l: 本地路径

配置

项目首选使用.env文件进行配置

HOST=127.0.0.1
SSH_PORT=22
SSH_USER=root
SSH_PASSWORD=123456
SSH_KEY=/Users/xxx/.ssh/id_rsa || 密钥内容
REMOTE_PATH=/root/www
SSH_KEYFILE=/Users/xxx/.ssh/id_rsa || 密钥文件
LOCAL_PATH=/dist
PROJECT_NAME=project || 项目名称

亦或使用json文件进行配置

{
    "HOST": "",
    "SSH_PORT": 22,
    "SSH_USERNAME": "root",
    "SSH_KEY": "",
    "REMOTE_PATH": "/home/www/wwwroot/mcnavi.cn",
    "SSH_KEYFILE": "/",
    "LOCAL_PATH": "/dist",
    "PROJECT_NAME": "project"
}

亦或使用cjs文件进行配置

module.exports = {
    HOST: '127.0.0.1',
    SSH_PORT: 22,
    SSH_USERNAME: 'root',
    SSH_KEY: `-----BEGIN OPENSSH PRIVATE KEY-----
-----END OPENSSH PRIVATE KEY-----`,
    REMOTE_PATH: '/home/www/wwwroot/mcnavi.cn',
    SSH_KEYFILE: '/',
    LOCAL_PATH: '/dist',
    PROJECT_NAME: 'project'
};

ssh-deploy's People

Contributors

momeak9 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.