API Lab Deployment
Droplet (server): fe-dev-api-lab01
-> 162.243.19.214
Domain: http://apilab.gitlap.com/
Droplet/server setup
Following this guide: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04
Install Node.js (and npm), use nvm
for ease of use
Using pm2
to manage the app as a service and restart on crashes.
cd /var/www/apilab
pm2 start npm --name="apilab" -- start`
For the CI, on our droplet, make sure rsync is running:
# Enable rsync service
sudo systemctl enable rsync.service
# Check if enabled
systemctl list-unit-files | grep rsync
# Make a config file with the `apilab` module
# For more info about the `rsyncd.conf`, see https://download.samba.org/pub/rsync/rsyncd.conf.html
echo $'uid = root\ngid = root\nlog file = /var/log/rsync.log\n\n[apilab]\n\tpath = /var/www/apilab\n\tread only = false' > /etc/rsyncd.conf
# Start rsync service
sudo systemctl start rsync.service
# Check rsync status (also useful if the below command doesn't show rsync after trying to start it)
sudo systemctl status rsync.service
# Check if rsync is running
systemctl | grep rsync
See http://askubuntu.com/a/632943/196148
You can check that the rsync modules are available with the following
rsync userxxx@hostxxx::