diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 02650006..79472a2a 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -138,9 +138,11 @@ jobs: - get: bosh-deployment trigger: true - get: warden-ubuntu-noble-stemcell + - get: bosh-warden-cpi-image - task: test-main-warden-cpi timeout: 2h file: bosh-deployment/ci/tasks/test-main-warden-cpi.yml + image: bosh-warden-cpi-image input_mapping: stemcell: warden-ubuntu-noble-stemcell privileged: true @@ -153,9 +155,11 @@ jobs: - get: bosh-deployment trigger: true - get: warden-ubuntu-noble-stemcell + - get: bosh-docker-cpi-image - task: test-main-docker-cpi timeout: 2h file: bosh-deployment/ci/tasks/test-main-docker-cpi.yml + image: bosh-docker-cpi-image input_mapping: stemcell: warden-ubuntu-noble-stemcell privileged: true @@ -1240,6 +1244,16 @@ resources: source: repository: ghcr.io/cloudfoundry/ubuntu-noble-stemcell +- name: bosh-docker-cpi-image + type: registry-image + source: + repository: ghcr.io/cloudfoundry/bosh/docker-cpi + +- name: bosh-warden-cpi-image + type: registry-image + source: + repository: ghcr.io/cloudfoundry/bosh/warden-cpi + resource_types: - name: github-status type: registry-image diff --git a/ci/tasks/test-main-docker-cpi.sh b/ci/tasks/test-main-docker-cpi.sh index 20c421f0..2dcf5793 100755 --- a/ci/tasks/test-main-docker-cpi.sh +++ b/ci/tasks/test-main-docker-cpi.sh @@ -1,15 +1,21 @@ -#!/bin/bash +#!/usr/bin/env bash +set -euo pipefail -set -eu +if [[ -n "${DEBUG-}" ]]; then + set -x +fi -script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" bosh_deployment="${PWD}/bosh-deployment" + rm -rf "/usr/local/bosh-deployment" cp -r "${PWD}/bosh-deployment" "/usr/local/bosh-deployment" export USE_LOCAL_RELEASES=false -. start-bosh -. /tmp/local-bosh/director/env + +# shellcheck source=/dev/null +source start-bosh +# shellcheck source=/dev/null +source /tmp/local-bosh/director/bosh-env URL=$(cat stemcell/url) SHA1=$(cat stemcell/sha1) @@ -18,14 +24,14 @@ bosh upload-stemcell --sha1 "$SHA1" "$URL" bosh -n update-runtime-config "${bosh_deployment}/runtime-configs/dns.yml" -echo "-----> `date`: Deploy" -bosh -n -d zookeeper deploy "${script_dir}/../assets/zookeeper.yml" +echo "-----> $(date): Deploy" +bosh -n -d zookeeper deploy "${bosh_deployment}/ci/assets/zookeeper.yml" -echo "-----> `date`: Exercise deployment" +echo "-----> $(date): Exercise deployment" bosh -n -d zookeeper run-errand smoke-tests -echo "-----> `date`: Exercise deployment" +echo "-----> $(date): Exercise deployment" bosh -n -d zookeeper recreate -echo "-----> `date`: Clean up disks, etc." +echo "-----> $(date): Clean up disks, etc." bosh -n -d zookeeper clean-up --all diff --git a/ci/tasks/test-main-docker-cpi.yml b/ci/tasks/test-main-docker-cpi.yml index 0d40ba32..6db1b063 100644 --- a/ci/tasks/test-main-docker-cpi.yml +++ b/ci/tasks/test-main-docker-cpi.yml @@ -1,11 +1,6 @@ --- platform: linux -image_resource: - type: registry-image - source: - repository: ghcr.io/cloudfoundry/bosh/docker-cpi - inputs: - name: bosh-deployment - name: stemcell diff --git a/ci/tasks/test-main-warden-cpi.sh b/ci/tasks/test-main-warden-cpi.sh index 20c421f0..5ebf2a48 100755 --- a/ci/tasks/test-main-warden-cpi.sh +++ b/ci/tasks/test-main-warden-cpi.sh @@ -1,15 +1,21 @@ -#!/bin/bash +#!/usr/bin/env bash +set -euo pipefail -set -eu +if [[ -n "${DEBUG-}" ]]; then + set -x +fi -script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" bosh_deployment="${PWD}/bosh-deployment" + rm -rf "/usr/local/bosh-deployment" cp -r "${PWD}/bosh-deployment" "/usr/local/bosh-deployment" export USE_LOCAL_RELEASES=false -. start-bosh -. /tmp/local-bosh/director/env + +# shellcheck source=/dev/null +source start-bosh +# shellcheck source=/dev/null +source /tmp/local-bosh/director/env URL=$(cat stemcell/url) SHA1=$(cat stemcell/sha1) @@ -18,14 +24,14 @@ bosh upload-stemcell --sha1 "$SHA1" "$URL" bosh -n update-runtime-config "${bosh_deployment}/runtime-configs/dns.yml" -echo "-----> `date`: Deploy" -bosh -n -d zookeeper deploy "${script_dir}/../assets/zookeeper.yml" +echo "-----> $(date): Deploy" +bosh -n -d zookeeper deploy "${bosh_deployment}/ci/assets/zookeeper.yml" -echo "-----> `date`: Exercise deployment" +echo "-----> $(date): Exercise deployment" bosh -n -d zookeeper run-errand smoke-tests -echo "-----> `date`: Exercise deployment" +echo "-----> $(date): Exercise deployment" bosh -n -d zookeeper recreate -echo "-----> `date`: Clean up disks, etc." +echo "-----> $(date): Clean up disks, etc." bosh -n -d zookeeper clean-up --all diff --git a/ci/tasks/test-main-warden-cpi.yml b/ci/tasks/test-main-warden-cpi.yml index 51a7e348..8e804f18 100644 --- a/ci/tasks/test-main-warden-cpi.yml +++ b/ci/tasks/test-main-warden-cpi.yml @@ -1,11 +1,6 @@ --- platform: linux -image_resource: - type: registry-image - source: - repository: ghcr.io/cloudfoundry/bosh/warden-cpi - inputs: - name: bosh-deployment - name: stemcell