DEV Community

Cover image for Configurable Artifacts: How To Deploy Like a Pro

Configurable Artifacts: How To Deploy Like a Pro

Kmaschta on January 23, 2018

When a project team grows, feature deployments become more frequent. Automating these deployments then becomes critical to optimize the development...
Collapse
 
jng profile image
Julie Ng

As you can see, the deployment is actually very fast, because I don't need to build in the target environment.

What about the node_modules folder? That is a gap in your argument. Your "artifact" isn't guaranteed to work 100% of the time because of potential system bindings (30% of modules have system bindings).

Even if you don't need to build in the target environment, you will probably want to run npm install once in the environment to make sure all the dependencies are OK before continuing.

Collapse
 
kmaschta profile image
Kmaschta

This point is adressed in the tips just under the sentence you quoted:

Tips: That means that if the build contains binaries, they must be compiled for the target environment. To simplify, it means you should develop your code on the same system as you run it. It's simpler that it sounds once you use Vagrant or Docker.

Collapse
 
christerbeke profile image
Chris ter Beke

Why not use Docker? It’s made to do exactly this in a fool-proof way.

Collapse
 
kmaschta profile image
Kmaschta

You're right, Docker can definitely help. But to introduce the concept of artifact-based deployment, I'd prefer to stay technology-agnostic.

Collapse
 
e3we profile image
Yi Chuan

How can this handle project which include unit and integration test?

Collapse
 
kmaschta profile image
Kmaschta

On majors CI/CD, you can isolate tests from the build.
By default, they run the build phase if the tests pass.

Hence, you can have two commands make test and make build, and trigger these commands at the following steps.

For example, you can see what Travis do: docs.travis-ci.com/user/build-stages/