#!/usr/bin/env bash # Decides per CI run: build with tests, build without tests, or only retag an existing image. # Tests run once per code state: the images carry the git tree and commit as labels # (io.mindsift.tree, org.opencontainers.image.revision), so no extra image tags are needed. # dev -> build and test, tag :dev # main -> build :latest; tests are skipped when :dev was built from the same tree # v* -> retag :latest when it was built from this commit, else build (tests skipped when # :dev or :latest has the same tree); :stable only for releases without "-" # Inputs (environment): REF, COMMIT (default HEAD), IMAGE, PKG_VERSION (default from package.json), # LABEL_CMD (prints a label of a remote image: LABEL_CMD