Build & Deploy
Once a feature is added, a bug is fixed or a configuration adjusted, you may want to deploy the latest version of your code online. At Artifakt, we use containerization. It means we bundle your applications together with all of their related dependencies, libraries, and configurations files required for them to run.
Two options are possible to deploy your code:
- The Build and Deploy job: the application source code has been modified and you need to build the application again before deploying it online.
- The Deploy job: you just want to modify a few settings (example: environment variables) before redeploying the previously built application.
The build process defines what happens when building your application and creates the necessary container image. The deploy process pulls the container image and starts live containers, replacing the previous version, with no interruption, using a blue-green deployment pattern.
If your application has a build step that you would like to run, you can use a
build.shscript located in an
.artifakt/folder in the root folder of your project (note the
.in front of artifakt).
Similarly, you can also use an
entrypoint.shfile in the
.artifakt/folder to override some configuration. If it exists, the
entrypoint.shscript will be executed just before the default process. It is ideal to make last minute checks, db migrations, quick cache reset, etc.
There is a performance penalty at startup in putting too many commands in the
entrypoint.sh. Please consider using
build.shas much as possible.
Below you can find a summary of the available callbacks and when they are executed:
If you use one of the callbacks (
entrypoint.sh), you become responsible for the runtime, in accordance with our Shared Responsibility Model.
After this Build & Deploy procedure, the code is deployed in a container runnning on each server of the stack.
The /mnt/shared directory is mounted on the container on the /data directory so that data can be transmitted to the container.