2.0.4 • Published 2 years ago

j-fnd v2.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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`);
      };
2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago