I have been looking for a clean way to push to a production server for a while,and a while ago I read about FlightplanJS.
Flightplan is basically a wrapper around some bash commands,namely rsync, ssh, scp, rm, and a few others. It’s going to SSHinto your server and execute a bunch of commands on your box.
This means you can do some mild environment changes, trigger some scripts,etc…
If you wanted more fine grained control over your environment, I’d take alook at chef, puppet, docker, etc… as those are going to be where you’llget that level of control.
I struggled for a long time to find an easy solution to deployment. It doesn’t take long to get sick of remote accessing your server, navigating to your project directory, doing a git pull and then restarting your server just to push out a new update.
I searched for a while, and it felt like there was something I was missing when it came to deployments.
Enter Git Webhooks My boss one day introduced me to the wonderful world of git webhooks.
Quick tip: Notes on using embedded models in Mongoose Recently I was working on a project where I needed to use embedded documents in Mongoose.When I first tried this, this is what my code looked like.
var Part = require('./Part'); var Build = require('./Build'); var Build = new Schema({ parts: [Part] }) This didn’t work, and I didn’t know why. I kept getting a Cast Error on the parts property.
When I first started learning development, I regularly bookmarked and kept notes on sites that I used, tutorials I liked, git repos that I found useful, etc…
As of today, I have condensed this down into the highest quality resources that I’ve used and found and put them into one curated list.
I’ll be updating this list regularly with things I’ve found, and I’ll make edit notes when major items are added.
There are a lot of cases where subdomains can come in handy. One of the most frequent use cases for a subdomain is a development server on the same domain as your default server. In this tutorial, I’ll run you through how to setup a subdomain and handle that subdomain with Nginx on your server.
Note: Gray labels with a $ prefix are bash commands
Another note: I’m using the dummy domain name of testsite.
Setup barebones static app You should have your app’s production build boil down to a single folder.
I usually point it all to ./build or ./dist
Create your apps Dockerfile Create a file named Dockerfile in the root of your app directory.
Then paste this in:
FROM kyma/docker-nginx COPY src/ /var/www CMD 'nginx' Replace src with your project’s build directory. For me, it’s usually ./build
This Dockerfile is doing 3 simple things.