Pipeline configs for cas-ggircs-metabase
We build an deploy a custom version of metabase (bcgov/cas-ggircs-metabase), using the s2i (source-to-image) tool.
Building using s2i requires us to define three imagestreams and build configs:
- a builder image, which will contain all the dependencies needed to build metabase and the s2i scripts
- a build image where the assemble script will be executed, buiding metabase
- a final image contaning the runtime dependency of metabase (java) and the metabase.jar file built in the build image
See (bcgov/cas-ggircs-metabase-builder)
This build config uses the s2i build strategy. The s2i strategy does the following:
- Pull the builder image and use it.
- Clone the metabase repository into the
/tmp/src/directory of the builder image. - Pull the previous build image (if any), and executes the
save-artifactsscript in it, and extract the saved artifact in the/tmp/artifacts/directory of the builder image. Thesave-artifactsscripts simply runs atarcommand outputting to stdout, containg all the files that should be made available to the next build (dependencies, built sql drivers, etc). - Execute the
assemblescript. The assemble script restores the previous build artifacts, if any, i.e. moves them to the metabase source repository, and runs the metabase build. - Push the resulting image (builder + built sources, aka the build image).
The last build config has two steps:
- Pull the cas-ggircs-metabase-build image and copies the
metabase.jarfile into the build environment. - Build an image using the docker/metabase dockerfile. This dockerfile installs the runtime dependency (java), exposes the metabase port (
3000), copies thejarfile into the image, and setsjava -jar metabase.jaras the entrypoint.