How To

Create Node Command

  • Node command calls server.js file with multiple arguments.
  • The command is : 'node -r esm server.js'.
  • Following are the arguments which can be added:
    • product: The name of the product the build has to be applied. Product names can be - tw-pages/questionnaire/learning/shared/iso/tw-dept-docs/tw-pages-test/all.
    • type: Its the type of build you want to apply for for a product. Possible values can be - client/server/docs/dept name/all.
    • nodeModules: This parameter is true if we want to run 'npm install' before applying the build.
    • checkProduct: It takes product name if you want to check if product has any commits then only apply build.
    • checkType- It takes type if you want to check if product has any commits then only apply build.

Add new repo for build

  • Create the repos for src and build.
  • Add the paths of both in bash-files/clone-source-repos-for-build.sh.
  • If it is a doc repo then add path in bash-files/test-server/update-build-repos-of-docs.sh.
  • Add the paths in src/common/repo-paths.js
  • Create the folder in build-config with the name of the project.
  • In that create the folder with type and create three files in it:
    • commands.js: This file contains source and build paths and the array of the commands that have to be run to apply build.
    • build.sh: Contains command to apply build.
    • node-modules-build.sh: Contains command to apply build with npm install.

Add new dept in tw-dept-docs

  • The source for this is created by CRM and committed by them.
  • Create the build repo in the git server. Follow the given steps to create:
    • Login with the command:
      ssh root@{ipAddress}
      and enter the password.
    • Use cd command to move to the path '/repo/crm_dept/tw-dept-help-docs-build/'
    • Create a folder with the dept name using mkdir command.
    • Move to the dept folder using cd command.
    • Run the following command in it:
      git init --bare
  • Add the paths of both in bash-files/clone-source-repos-for-build.sh.
  • Add path in bash-files/test-server/update-build-repos-of-docs.sh.
  • Add the paths in src/common/repo-paths.js
  • Create the folder in build-config with the name of the project.
  • In that create the folder with type and create three files in it:
    • commands.js: This file contains source and build paths and the array of the commands that have to be run to apply build.
    • build.sh: Contains command to apply build.
    • node-modules-build.sh: Contains command to apply build with npm install.

Apply Test Build

  • Go to ext-repos/github/tw-pages/tw-test/tw-pages-client.
  • Pull from the branch and from the master.
  • Solve the merge issues if any.
  • Comment the lines 70-87 in aurelia-build-commands.sh.
  • Then apply the build