os: linux dist: focal language: shell env: global: BUILD_SCRIPT: cl-docker-images-build/cl-docker-images-build DOCKER_BUILDKIT: "1" DOCKER_CLI_EXPERIMENTAL: "enabled" stages: - name: build - name: deploy if: branch = master services: - docker before_install: - echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json - sudo service docker restart - docker info - | # Log in earlier, to hopefully avoid running into Docker Hub's new pull # limits. if [ -n "$DOCKER_PASSWORD" ]; then docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD fi - | if [ "$TRAVIS_BRANCH" = "master" ]; then BUILD_TAG_SUFFIX="-tmp-master" else BUILD_TAG_SUFFIX="-tmp" fi export BUILD_TAG_SUFFIX _nonnightly: &nonnightly if: ((NOT (type = cron) OR env(BASE_IMAGE_UPDATE) = yes) AND NOT (branch =~ ^nightly-.*$)) _nightly: &nightly allow_failures: if: NOT (type = cron) before_script: - mkdir tmp - cd tmp - git clone https://github.com/Clozure/ccl.git - cd ccl - export EXTRA_BUILDARGS="--build-arg ref=$(git rev-parse HEAD)" - cd ../.. - rm -rf tmp _build_job: &build_job stage: build script: # Pull the previous images - $BUILD_SCRIPT pull # Build the image - $BUILD_SCRIPT build after_success: | if [ -n "$DOCKER_PASSWORD" ]; then $BUILD_SCRIPT push_build_image fi jobs: include: # Regular images # Debian Buster - arch: amd64 env: ARCH: amd64 OS_NAME: debian OS_VERSION: "buster" <<: [*build_job, *nonnightly] - arch: arm64 env: ARCH: arm32v7 OS_NAME: debian OS_VERSION: "buster" <<: [*build_job, *nonnightly] # Debian Stretch - arch: amd64 env: ARCH: amd64 OS_NAME: debian OS_VERSION: "stretch" <<: [*build_job, *nonnightly] - arch: arm64 env: ARCH: arm32v7 OS_NAME: debian OS_VERSION: "stretch" <<: [*build_job, *nonnightly] # Ubuntu Focal - arch: amd64 env: ARCH: amd64 OS_NAME: ubuntu OS_VERSION: "focal" <<: [*build_job, *nonnightly] - arch: arm64 install: - unset DOCKER_BUILDKIT - sudo apt-get remove -y docker docker.io containerd runc - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - sudo add-apt-repository "deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - sudo apt-get update - sudo apt-get install -y docker-ce docker-ce-cli containerd.io env: ARCH: arm32v7 OS_NAME: ubuntu OS_VERSION: "focal" <<: [*build_job, *nonnightly] # Ubuntu Bionic - arch: amd64 env: ARCH: amd64 OS_NAME: ubuntu OS_VERSION: "bionic" <<: [*build_job, *nonnightly] - arch: arm64 env: ARCH: arm32v7 OS_NAME: ubuntu OS_VERSION: "bionic" <<: [*build_job, *nonnightly] # Nightly images # Debian Buster - arch: amd64 env: ARCH: amd64 OS_NAME: debian OS_VERSION: "buster" VERSION: nightly <<: [*build_job, *nightly] - arch: arm64 env: ARCH: arm32v7 OS_NAME: debian OS_VERSION: "buster" VERSION: nightly <<: [*build_job, *nightly] # Debian Stretch - arch: amd64 env: ARCH: amd64 OS_NAME: debian OS_VERSION: "stretch" VERSION: nightly <<: [*build_job, *nightly] - arch: arm64 env: ARCH: arm32v7 OS_NAME: debian OS_VERSION: "stretch" VERSION: nightly <<: [*build_job, *nightly] # Ubuntu Focal - arch: amd64 env: ARCH: amd64 OS_NAME: ubuntu OS_VERSION: "focal" VERSION: nightly <<: [*build_job, *nightly] - arch: arm64 install: - unset DOCKER_BUILDKIT - sudo apt-get remove -y docker docker.io containerd runc - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - sudo add-apt-repository "deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - sudo apt-get update - sudo apt-get install -y docker-ce docker-ce-cli containerd.io env: ARCH: arm32v7 OS_NAME: ubuntu OS_VERSION: "focal" VERSION: nightly <<: [*build_job, *nightly] # Ubuntu Bionic - arch: amd64 env: ARCH: amd64 OS_NAME: ubuntu OS_VERSION: "bionic" VERSION: nightly <<: [*build_job, *nightly] - arch: arm64 env: ARCH: arm32v7 OS_NAME: ubuntu OS_VERSION: "bionic" VERSION: nightly <<: [*build_job, *nightly] # Deploy nightly - arch: amd64 stage: deploy env: INCLUDE_WINDOWS_IN_MANIFEST: "no" VERSION: nightly script: - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin # First, download all the nightly builds, retag them, and push them to # the arch specific repos - $BUILD_SCRIPT pull_retag_and_push_linux_arch_images # Next, create and push all the linux manifests - $BUILD_SCRIPT release_linux_manifests # Last, release shared manifests - $BUILD_SCRIPT release_shared_manifests # Deploy nightly - arch: amd64 stage: deploy if: ((type = cron) AND env(BASE_IMAGE_UPDATE) = yes) script: - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin # First, download all the nightly builds, retag them, and push them to # the arch specific repos - $BUILD_SCRIPT pull_retag_and_push_linux_arch_images # Next, create and push all the linux manifests - $BUILD_SCRIPT release_linux_manifests # Last, release shared manifests - $BUILD_SCRIPT release_shared_manifests