Skip to content
Snippets Groups Projects
.gitlab-ci.yml 5.69 KiB
stages:
  - base rootfs
  - base image
  - derived images
  - image test
  - publish images

variables:
  RELEASE: "bullseye"
  CUSTREL: "bullseyebootstrap"
  DISTRO: debian
  MIRROR: https://deb.debian.org/debian/
  STABLE: auto
  TEST_TAG: test-${CI_PIPELINE_ID}

default:
  # we want to ensure that the jobs updating the `latest` tags always reflect
  # the actual latest pipeline. when two pipelines are started at the same time
  # on the same branch sometimes the earlier one can complete last due to
  # scheduling or any other reason, thus breaking the previous assumption.
  # to avoid that, make the whole pipeline interruptible up to the tagging jobs
  # so that earlier pipelines get killed when a new one is started
  interruptible: true

before_script:
  - |
    if [ "${CI_COMMIT_BRANCH%%/*}" = "$DISTRO" ]
    then
        RELEASE="${CI_COMMIT_BRANCH#*/}"
        TAG=latest
    else
        TAG=$CI_COMMIT_REF_SLUG
    fi
    if [ "$STABLE" = "auto" ]
    then
        case $RELEASE in
          *dev*|*pre*)
              STABLE=false
              ;;
          *)
              STABLE=true
              ;;
        esac
    fi
    echo Using RELEASE=$RELEASE and STABLE=$STABLE

build-base-rootfs:
  stage: base rootfs
  image:
    name: godebos/debos
    entrypoint: [ "" ]
  tags:
    - kvm
  artifacts:
    paths:
      - base/*.tar.gz
    expire_in: 1d
  only:
    - branches
  script:
    - >
      cd base &&
      debos -t osname:${DISTRO} -t suite:${RELEASE} -t stable:$STABLE  -t mirror:"$MIRROR" rootfs.yaml

.build-docker-image:
  image:
    name: gcr.io/kaniko-project/executor:debug-v0.20.0
    entrypoint: [""]
  only:
    - branches