j-fnd

2.0.4 • Public • Published

Nodejs ssh deploy

  • Install package npm i j-fnd
  • Create jFnd.js file inside the root of the project --You can add custom actions and specify configurations inside this file.
      const deployCfg = {
        //REQUIRED
        deployUser: "",
        //REQUIRED
        appName: "",
        //REQUIRED
        serverIp: "",
        //REQUIRED
        repoUrl: "",
        //REQUIRED
        deployFolder: "",
        //REQUIRED options -> production, staging
        env: "production",
        //REQUIRED if env is production
        productionBranch: "",
        //REQUIRED if env is staging
        stagingBranch: "",
        //REQUIRED
        appStartupFile: "",
        //OPTIONAL
        linkedFolders: [],
        //OPTIONAL
        linkedFiles: ["config/environment.yaml"],
        //REQUIRED
        hostName: "foobar.com",
        //REQUIRED
        port: 3001,
        //REQUIRED
        location: ""
      }
      
      exports.deployCfg = deployCfg;
      
      exports.startup = async (shipit) => {
        await shipit.remote(
          `cd ${shipit.currentPath} && DB_ENV=deploy pm2 start --name ${deployCfg.appName} ${deployCfg.appStartupFile} --env production`
        );
      };
      
      exports.beforeNodeModulesInstall = async (shipit) => {
        await Promise.resolve();
      };
      
      exports.afterNodeModulesInstall = async (shipit) => {
        await shipit.remote(`cd ${shipit.currentPath} && npm run build`);
        await shipit.remote(`cd ${shipit.currentPath} && DB_ENV=deploy npm run db:migrate`);
      };
    

Readme

Keywords

none

Package Sidebar

Install

npm i j-fnd

Weekly Downloads

0

Version

2.0.4

License

ISC

Unpacked Size

6.16 kB

Total Files

6

Last publish

Collaborators

  • jo-tech