diff --git a/.expeditor/config.yml b/.expeditor/config.yml index c9ed8703a..6e7628e60 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -10,8 +10,9 @@ rubygems: - ohai artifact_channels: - - unstable - - chef-dke-lts2024 + - stable + - base-2025-current + - base-2025 pipelines: - habitat/build: @@ -28,7 +29,7 @@ pipelines: - HAB_NOCOLORING: "true" - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" trigger: pull_request - + github: # This deletes the GitHub PR branch after successfully merged into the release branch delete_branch_on_merge: true @@ -85,4 +86,15 @@ subscriptions: actions: - built_in:rollover_changelog - built_in:promote_habitat_packages + + # Promote to 'current' on successful Habitat testing + - workload: buildkite_build_passed:{{agent_id}}:habitat/test:* + actions: + - built_in:promote_habitat_packages: + channel: current - built_in:publish_rubygems + + # Promote to 'base-2025' after promoting to 'stable' + - workload: hab_package_published:stable:ohai/19.* + actions: + - bash:.expeditor/scripts/base-2025-promote.sh \ No newline at end of file diff --git a/.expeditor/scripts/base-2025-promote.sh b/.expeditor/scripts/base-2025-promote.sh new file mode 100644 index 000000000..368872ebf --- /dev/null +++ b/.expeditor/scripts/base-2025-promote.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -euo pipefail + +echo "--- Promoting Habitat package from stable to base-2025" + +# Expeditor provides these environment variables automatically +echo "Package Origin: ${EXPEDITOR_PKG_ORIGIN}" +echo "Package Name: ${EXPEDITOR_PKG_NAME}" +echo "Package Version: ${EXPEDITOR_PKG_VERSION}" +echo "Package Release: ${EXPEDITOR_PKG_RELEASE}" +echo "Package Ident: ${EXPEDITOR_PKG_IDENT}" +echo "Package Target: ${EXPEDITOR_PKG_TARGET}" +echo "Source Channel: ${EXPEDITOR_CHANNEL}" + +# Set the target channel +TARGET_CHANNEL="base-2025" + +# Get HAB_AUTH_TOKEN from vault +HAB_AUTH_TOKEN=$(vault kv get -field auth_token account/static/habitat/chef-ci) +export HAB_AUTH_TOKEN + +echo "--- Promoting ${EXPEDITOR_PKG_IDENT} to ${TARGET_CHANNEL} channel" +hab pkg promote "${EXPEDITOR_PKG_IDENT}" "${TARGET_CHANNEL}" + +echo "--- Promotion completed successfully!"