Producing what gets deployed.
WHAT AN ARTEFACT IS
The output of a build: the thing you actually deploy.
WHY BUILD ONCE
So what you tested is what you deploy.
WHAT HAPPENS OTHERWISE
Building separately for each environment means each gets something slightly different.
WHAT A BUILD MIGHT PRODUCE
Compiled frontend assets Installed dependencies An archive of the deployable files
WHAT TO EXCLUDE
Development dependencies Tests Version control metadata Anything not needed to run
WHAT TO INCLUDE
A record of the version and what it was built from.
WHY
So a deployed artefact can be traced to a commit.
WHERE TO STORE THEM
Somewhere deployments can retrieve them, retained for long enough to revert.
HOW MANY TO KEEP
Enough to go back several releases.
WHAT TO VERIFY
That the artefact is complete before deploying it.
WHAT TO AVOID
Building on the production server Modifying an artefact after building it