First Use

The simple tutorial how to use ngi-sync

Create the config

Go to your project folder and create sync-config.yaml first:

ngi-sync init

After that you will have :

  • xxx_sync-config.yaml or sync-config.yaml (if start from empty project) : This is a config file for connecting to the server. Rename it to sync-config.yaml

D:\workspaces\sample>ngi-sync init
You are in: D:\workspaces\sample
Initialize Bootstrap Is Done!
[ undefined, undefined ]
---------------------------------------------------
  Replace xxx_sync-config.yaml to sync-config.yaml
---------------------------------------------------

D:\workspaces\sample>
  • .sync_ignore This file ignores some file or extension file while sync to the server. The principle is same like .ignore file on git

.sync_ignore 
sync-config.yaml 
sync-config.yml 
.sync_temp

Then open the file, and edit some config to connecting to your server

With this config we have ssh_command that we use to connect to the server

Run the ngi-sync

Make sure your config is valid as a yaml file. Better go to http://www.yamllint.com

Here the following rules:

  • Submit the first command because we need to create a folder first on the server.

  • Run ngi-sync again and submit the devsync2 command devsync :: Open Devsync. And next choose the first option safe_sync :: DevSync Basic .... It will start synchronizing our code to the server project folder continuously.

  • Create file hello_word.js on our local side with this body and save it

  • When you create and update the hello_world.js It will sync to the server directly and keep it running.

  • Open new command prompt or terminal and Run ngi-sync again and choose recent project folder just open before, if you are not right place project folder.

  • It will jump to the project folder directly. And will display the next main menu, choose second menu.

  • Ok we will enter to the server and check the file that we create it hello_world.js

Ok that's a basic use for sync our code to the server. And next we will learn a advanced sync our code to the server. For now better we learn which every option on sync-config.yaml

Last updated

Was this helpful?