Skip to content

M4R14/ssh-pipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ssh-pipe

ใช้ shell เข้าเครื่อง Server

Setup:

โหลด ssh-pipe.js ลงในโปรเจค แล้วรันคำสั่ง

$ yarn add simple-ssh colors cli-spinner

Coding:

const SshPipe = require('./ssh-pipe.js');
(async () => {
    const production = new SshPipe({
        connent: {
            host: '_____________',
            user: '_____________',
            pass: '_____________',
            agent: process.env.SSH_AUTH_SOCK,
            agentForward: true,
            baseDir: '_____________'
        },
        env: { BRANCH: "master" }
    })

    await production.start([
        {
            title: "git load.",
            step: [
                "git fetch",
                "git checkout .",
                "git checkout $BRANCH",
                "git clean -fd",
                "git pull",
                "git reset --hard origin/$BRANCH"
            ]
        }
    ]);
    production.Report

})()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published