RHEL 8 compose trigger #1863
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: RHEL 8 compose trigger | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 1 * * *' | |
- cron: '0 7 * * *' | |
- cron: '0 13 * * *' | |
- cron: '0 19 * * *' | |
env: | |
COMPOSE_URL_86: "http://${{ secrets.DOWNLOAD_NODE }}/rhel-8/nightly/updates/RHEL-8" | |
COMPOSE_URL_88: "http://${{ secrets.DOWNLOAD_NODE }}/rhel-8/nightly/updates/RHEL-8" | |
COMPOSE_URL_89: "http://${{ secrets.DOWNLOAD_NODE }}/rhel-8/nightly/updates/RHEL-8" | |
jobs: | |
check-compose: | |
# Do not run this job on any fork repos | |
if: github.repository == 'virt-s1/rhel-edge' | |
runs-on: container-runner | |
container: quay.io/fedora/fedora:38-x86_64 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check RHEL 8.6 compose | |
id: check_compose_id_86 | |
run: | | |
curl -s ${COMPOSE_URL_86}/latest-RHEL-8.6.0/STATUS --output STATUS_86 | |
STATUS_86=$(cat STATUS_86) | |
if [[ "$STATUS_86" == "FINISHED" ]]; then | |
curl -s ${COMPOSE_URL_86}/latest-RHEL-8.6.0/COMPOSE_ID --output COMPOSE_ID_86 | |
COMPOSE_ID_86=$(cat COMPOSE_ID_86) | |
TESTED_COMPOSE_86=( $( cat compose/compose.86 ) ) | |
if [[ " ${TESTED_COMPOSE_86[*]} " =~ "$COMPOSE_ID_86" ]]; then | |
COMPOSE_ID_86="false" | |
fi | |
else | |
COMPOSE_ID_86="false" | |
fi | |
if [[ "$COMPOSE_ID_86" != "false" ]]; then | |
OSBUILD_VERSION_86=$(curl -s "${COMPOSE_URL_86}/${COMPOSE_ID_86}/compose/AppStream/x86_64/os/Packages/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><") | |
OSBUILD_COMPOSER_VERSION_86=$(curl -s "${COMPOSE_URL_86}/${COMPOSE_ID_86}/compose/AppStream/x86_64/os/Packages/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><") | |
COMPOSER_CLI_VERSION_86=$(curl -s "${COMPOSE_URL_86}/${COMPOSE_ID_86}/compose/AppStream/x86_64/os/Packages/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><") | |
echo "osbuild_version_86=$OSBUILD_VERSION_86" >> $GITHUB_OUTPUT | |
echo "osbuild_composer_version_86=$OSBUILD_COMPOSER_VERSION_86" >> $GITHUB_OUTPUT | |
echo "composer_cli_version_86=$COMPOSER_CLI_VERSION_86" >> $GITHUB_OUTPUT | |
else | |
echo "osbuild_version_86=Null" >> $GITHUB_OUTPUT | |
echo "osbuild_composer_version_86=Null" >> $GITHUB_OUTPUT | |
echo "composer_cli_version_86=Null" >> $GITHUB_OUTPUT | |
fi | |
echo "rhel86_compose=$COMPOSE_ID_86" >> $GITHUB_OUTPUT | |
- name: Check RHEL 8.8 compose | |
id: check_compose_id_88 | |
run: | | |
curl -s ${COMPOSE_URL_88}/latest-RHEL-8.8.0/STATUS --output STATUS_88 | |
STATUS_88=$(cat STATUS_88) | |
if [[ "$STATUS_88" == "FINISHED" ]]; then | |
curl -s ${COMPOSE_URL_88}/latest-RHEL-8.8.0/COMPOSE_ID --output COMPOSE_ID_88 | |
COMPOSE_ID_88=$(cat COMPOSE_ID_88) | |
TESTED_COMPOSE_88=( $( cat compose/compose.88 ) ) | |
if [[ " ${TESTED_COMPOSE_88[*]} " =~ "$COMPOSE_ID_88" ]]; then | |
COMPOSE_ID_88="false" | |
fi | |
else | |
COMPOSE_ID_88="false" | |
fi | |
if [[ "$COMPOSE_ID_88" != "false" ]]; then | |
OSBUILD_VERSION_88=$(curl -s "${COMPOSE_URL_88}/${COMPOSE_ID_88}/compose/AppStream/x86_64/os/Packages/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><") | |
OSBUILD_COMPOSER_VERSION_88=$(curl -s "${COMPOSE_URL_88}/${COMPOSE_ID_88}/compose/AppStream/x86_64/os/Packages/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><") | |
COMPOSER_CLI_VERSION_88=$(curl -s "${COMPOSE_URL_88}/${COMPOSE_ID_88}/compose/AppStream/x86_64/os/Packages/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><") | |
echo "osbuild_version_88=$OSBUILD_VERSION_88" >> $GITHUB_OUTPUT | |
echo "osbuild_composer_version_88=$OSBUILD_COMPOSER_VERSION_88" >> $GITHUB_OUTPUT | |
echo "composer_cli_version_88=$COMPOSER_CLI_VERSION_88" >> $GITHUB_OUTPUT | |
else | |
echo "osbuild_version_88=Null" >> $GITHUB_OUTPUT | |
echo "osbuild_composer_version_88=Null" >> $GITHUB_OUTPUT | |
echo "composer_cli_version_88=Null" >> $GITHUB_OUTPUT | |
fi | |
echo "rhel88_compose=$COMPOSE_ID_88" >> $GITHUB_OUTPUT | |
- name: Check RHEL 8.9 compose | |
id: check_compose_id_89 | |
run: | | |
curl -s ${COMPOSE_URL_89}/latest-RHEL-8.9.0/STATUS --output STATUS_89 | |
STATUS_89=$(cat STATUS_89) | |
if [[ "$STATUS_89" == "FINISHED" ]]; then | |
curl -s ${COMPOSE_URL_89}/latest-RHEL-8.9.0/COMPOSE_ID --output COMPOSE_ID_89 | |
COMPOSE_ID_89=$(cat COMPOSE_ID_89) | |
TESTED_COMPOSE_89=( $( cat compose/compose.89 ) ) | |
if [[ " ${TESTED_COMPOSE_89[*]} " =~ "$COMPOSE_ID_89" ]]; then | |
COMPOSE_ID_89="false" | |
fi | |
else | |
COMPOSE_ID_89="false" | |
fi | |
if [[ "$COMPOSE_ID_89" != "false" ]]; then | |
OSBUILD_VERSION_89=$(curl -s "${COMPOSE_URL_89}/${COMPOSE_ID_89}/compose/AppStream/x86_64/os/Packages/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><") | |
OSBUILD_COMPOSER_VERSION_89=$(curl -s "${COMPOSE_URL_89}/${COMPOSE_ID_89}/compose/AppStream/x86_64/os/Packages/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><") | |
COMPOSER_CLI_VERSION_89=$(curl -s "${COMPOSE_URL_89}/${COMPOSE_ID_89}/compose/AppStream/x86_64/os/Packages/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><") | |
echo "osbuild_version_89=$OSBUILD_VERSION_89" >> $GITHUB_OUTPUT | |
echo "osbuild_composer_version_89=$OSBUILD_COMPOSER_VERSION_89" >> $GITHUB_OUTPUT | |
echo "composer_cli_version_89=$COMPOSER_CLI_VERSION_89" >> $GITHUB_OUTPUT | |
else | |
echo "osbuild_version_89=Null" >> $GITHUB_OUTPUT | |
echo "osbuild_composer_version_89=Null" >> $GITHUB_OUTPUT | |
echo "composer_cli_version_89=Null" >> $GITHUB_OUTPUT | |
fi | |
echo "rhel89_compose=$COMPOSE_ID_89" >> $GITHUB_OUTPUT | |
outputs: | |
rhel86_compose: ${{ steps.check_compose_id_86.outputs.rhel86_compose }} | |
rhel88_compose: ${{ steps.check_compose_id_88.outputs.rhel88_compose }} | |
rhel89_compose: ${{ steps.check_compose_id_89.outputs.rhel89_compose }} | |
osbuild_version_86: ${{ steps.check_compose_id_86.outputs.osbuild_version_86 }} | |
osbuild_composer_version_86: ${{ steps.check_compose_id_86.outputs.osbuild_composer_version_86 }} | |
composer_cli_version_86: ${{ steps.check_compose_id_86.outputs.composer_cli_version_86 }} | |
osbuild_version_88: ${{ steps.check_compose_id_88.outputs.osbuild_version_88 }} | |
osbuild_composer_version_88: ${{ steps.check_compose_id_88.outputs.osbuild_composer_version_88 }} | |
composer_cli_version_88: ${{ steps.check_compose_id_88.outputs.composer_cli_version_88 }} | |
osbuild_version_89: ${{ steps.check_compose_id_89.outputs.osbuild_version_89 }} | |
osbuild_composer_version_89: ${{ steps.check_compose_id_89.outputs.osbuild_composer_version_89 }} | |
composer_cli_version_89: ${{ steps.check_compose_id_89.outputs.composer_cli_version_89 }} | |
rhel-8-6: | |
needs: check-compose | |
if: ${{ needs.check-compose.outputs.rhel86_compose != 'false' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Add new compose id in compose.86 | |
run: | | |
compose_id="${{ needs.check-compose.outputs.rhel86_compose }}" | |
echo $compose_id >> compose/compose.86 | |
cat compose/compose.86 | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "${{ needs.check-compose.outputs.rhel86_compose }} - ${{ steps.date.outputs.date }}" | |
committer: cloudkitebot <[email protected]> | |
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
branch: cpr | |
branch-suffix: random | |
delete-branch: true | |
title: "${{ needs.check-compose.outputs.rhel86_compose }} - ${{ steps.date.outputs.date }}" | |
labels: auto-merge,RHEL-8.6.0 | |
body: | | |
RHEL 8.6 compose ${{ needs.check-compose.outputs.rhel86_compose }} | |
- Date: ${{ steps.date.outputs.date }} | |
- Packages: | |
- ${{ needs.check-compose.outputs.osbuild_version_86 }} | |
- ${{ needs.check-compose.outputs.osbuild_composer_version_86 }} | |
- ${{ needs.check-compose.outputs.composer_cli_version_86 }} | |
- name: Enable Pull Request Automerge | |
if: steps.cpr.outputs.pull-request-operation == 'created' | |
uses: peter-evans/enable-pull-request-automerge@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | |
merge-method: rebase | |
- name: Add a comment to trigger test workflow | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
token: ${{ secrets.PAT }} | |
issue-number: ${{ steps.cpr.outputs.pull-request-number }} | |
body: /test-rhel-8-6 | |
- name: Create a project card to track compose test result | |
uses: peter-evans/create-or-update-project-card@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
project-name: RHEL Compose Test | |
column-name: RHEL-8-6 | |
issue-number: ${{ steps.cpr.outputs.pull-request-number }} | |
rhel-8-8: | |
needs: check-compose | |
if: ${{ needs.check-compose.outputs.rhel88_compose != 'false' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Add new compose id in compose.88 | |
run: | | |
compose_id="${{ needs.check-compose.outputs.rhel88_compose }}" | |
echo $compose_id >> compose/compose.88 | |
cat compose/compose.88 | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "${{ needs.check-compose.outputs.rhel88_compose }} - ${{ steps.date.outputs.date }}" | |
committer: cloudkitebot <[email protected]> | |
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
branch: cpr | |
branch-suffix: random | |
delete-branch: true | |
title: "${{ needs.check-compose.outputs.rhel88_compose }} - ${{ steps.date.outputs.date }}" | |
labels: auto-merge,RHEL-8.8.0 | |
body: | | |
RHEL 8.8 compose ${{ needs.check-compose.outputs.rhel88_compose }} | |
- Date: ${{ steps.date.outputs.date }} | |
- Packages: | |
- ${{ needs.check-compose.outputs.osbuild_version_88 }} | |
- ${{ needs.check-compose.outputs.osbuild_composer_version_88 }} | |
- ${{ needs.check-compose.outputs.composer_cli_version_88 }} | |
- name: Enable Pull Request Automerge | |
if: steps.cpr.outputs.pull-request-operation == 'created' | |
uses: peter-evans/enable-pull-request-automerge@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | |
merge-method: rebase | |
- name: Add a comment to trigger test workflow | |
uses: peter-evans/create-or-update-comment@v1 | |
with: | |
token: ${{ secrets.PAT }} | |
issue-number: ${{ steps.cpr.outputs.pull-request-number }} | |
body: /test-rhel-8-8 | |
- name: Create a project card to track compose test result | |
uses: peter-evans/create-or-update-project-card@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
project-name: RHEL Compose Test | |
column-name: RHEL-8-8 | |
issue-number: ${{ steps.cpr.outputs.pull-request-number }} | |
rhel-8-9: | |
needs: check-compose | |
if: ${{ needs.check-compose.outputs.rhel89_compose != 'false' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Add new compose id in compose.89 | |
run: | | |
compose_id="${{ needs.check-compose.outputs.rhel89_compose }}" | |
echo $compose_id >> compose/compose.89 | |
cat compose/compose.89 | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "${{ needs.check-compose.outputs.rhel89_compose }} - ${{ steps.date.outputs.date }}" | |
committer: cloudkitebot <[email protected]> | |
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
branch: cpr | |
branch-suffix: random | |
delete-branch: true | |
title: "${{ needs.check-compose.outputs.rhel89_compose }} - ${{ steps.date.outputs.date }}" | |
labels: auto-merge,RHEL-8.9.0 | |
body: | | |
RHEL 8.9 compose ${{ needs.check-compose.outputs.rhel89_compose }} | |
- Date: ${{ steps.date.outputs.date }} | |
- Packages: | |
- ${{ needs.check-compose.outputs.osbuild_version_89 }} | |
- ${{ needs.check-compose.outputs.osbuild_composer_version_89 }} | |
- ${{ needs.check-compose.outputs.composer_cli_version_89 }} | |
- name: Enable Pull Request Automerge | |
if: steps.cpr.outputs.pull-request-operation == 'created' | |
uses: peter-evans/enable-pull-request-automerge@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | |
merge-method: rebase | |
- name: Add a comment to trigger test workflow | |
uses: peter-evans/create-or-update-comment@v1 | |
with: | |
token: ${{ secrets.PAT }} | |
issue-number: ${{ steps.cpr.outputs.pull-request-number }} | |
body: /test-rhel-8-9 | |
- name: Create a project card to track compose test result | |
uses: peter-evans/create-or-update-project-card@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
project-name: RHEL Compose Test | |
column-name: RHEL-8-9 | |
issue-number: ${{ steps.cpr.outputs.pull-request-number }} |