Promote container repositories #730
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Promote container repositories | |
on: | |
workflow_dispatch: | |
inputs: | |
filter: | |
description: Space-separated list of regular expressions matching images to promote | |
type: string | |
required: false | |
default: "" | |
kayobe_config_branch: | |
required: true | |
description: Branch of StackHPC Kayobe configuration to use | |
check_mode: | |
description: Check mode | |
type: boolean | |
required: false | |
default: false | |
env: | |
ANSIBLE_FORCE_COLOR: True | |
ANSIBLE_VAULT_PASSWORD_FILE: ${{ github.workspace }}/vault-pass | |
jobs: | |
container-promote: | |
name: Promote container repositories | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Release Train & dependencies | |
uses: ./.github/actions/setup | |
with: | |
vault-password: ${{ secrets.ANSIBLE_VAULT_PASSWORD }} | |
vault-password-file: ${{ env.ANSIBLE_VAULT_PASSWORD_FILE }} | |
- name: Clone StackHPC Kayobe configuration repository | |
uses: actions/checkout@v4 | |
with: | |
repository: stackhpc/stackhpc-kayobe-config | |
ref: refs/heads/${{ github.event.inputs.kayobe_config_branch }} | |
path: stackhpc-kayobe-config | |
- name: Promote images from stackhpc-dev to stackhpc namespace in Ark | |
run: | | |
args="" | |
if [[ $CHECK_MODE = true ]]; then | |
args="$args --check --diff" | |
fi | |
ansible-playbook -i ansible/inventory \ | |
ansible/dev-pulp-container-tag-query-kayobe.yml \ | |
ansible/dev-pulp-container-promote.yml \ | |
-e kolla_container_image_filter="'$FILTER'" \ | |
-e kayobe_config_repo_path=./stackhpc-kayobe-config/ \ | |
$args | |
env: | |
FILTER: ${{ github.event.inputs.filter }} | |
CHECK_MODE: ${{ inputs.check_mode }} | |
- name: Send message to Slack via Workflow Builder | |
uses: ./.github/actions/slack-alert | |
with: | |
inputs: >- | |
filter: ${{ inputs.filter }}\n | |
kayobe_config_branch: ${{ inputs.kayobe_config_branch }}\n | |
check_mode: ${{ inputs.check_mode }}\n | |
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} | |
slack-channel-id: ${{ vars.SLACK_CHANNEL_ID }} | |
if: failure() |