Skip to content

Commit

Permalink
ci: add fedora 40 (rawhide) support
Browse files Browse the repository at this point in the history
  • Loading branch information
henrywang committed Oct 25, 2023
1 parent a20adda commit 9a87db3
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 123 deletions.
198 changes: 99 additions & 99 deletions .github/workflows/trigger-fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,105 +17,105 @@ env:
UPDATES_URL_F37: https://dl.fedoraproject.org/pub/fedora/linux/updates/37

jobs:
# check-compose:
# # Do not run this job on any fork repos
# if: github.repository == 'virt-s1/rhel-edge'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3

# - name: Check if fedora rawhide compose is new
# id: check_compose_id
# run: |
# curl -s "${COMPOSE_URL_rawhide}/COMPOSE_ID" --output COMPOSE_ID
# COMPOSE_ID=$(cat COMPOSE_ID)
# TESTED_COMPOSE=( $( cat compose/compose.fedora ) )
# if [[ " ${TESTED_COMPOSE[*]} " =~ "$COMPOSE_ID" ]]; then
# COMPOSE_ID="false"
# fi

# if [[ "$COMPOSE_ID" != "false" ]]; then
# OSBUILD_VERSION=$(curl -s "${COMPOSE_URL_rawhide}/Everything/x86_64/os/Packages/o/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><")
# OSBUILD_COMPOSER_VERSION=$(curl -s "${COMPOSE_URL_rawhide}/Everything/x86_64/os/Packages/o/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><")
# COMPOSER_CLI_VERSION=$(curl -s "${COMPOSE_URL_rawhide}/Everything/x86_64/os/Packages/w/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><")
# echo "osbuild_version=$OSBUILD_VERSION" >> $GITHUB_OUTPUT
# echo "osbuild_composer_version=$OSBUILD_COMPOSER_VERSION" >> $GITHUB_OUTPUT
# echo "composer_cli_version=$COMPOSER_CLI_VERSION" >> $GITHUB_OUTPUT
# else
# echo "osbuild_version=Null" >> $GITHUB_OUTPUT
# echo "osbuild_composer_version=Null" >> $GITHUB_OUTPUT
# echo "composer_cli_version=Null" >> $GITHUB_OUTPUT
# fi

# echo "rawhide_compose=$COMPOSE_ID" >> $GITHUB_OUTPUT

# outputs:
# rawhide_compose: ${{ steps.check_compose_id.outputs.rawhide_compose }}
# osbuild_version: ${{ steps.check_compose_id.outputs.osbuild_version }}
# osbuild_composer_version: ${{ steps.check_compose_id.outputs.osbuild_composer_version }}
# composer_cli_version: ${{ steps.check_compose_id.outputs.composer_cli_version }}

# fedora-rawhide:
# needs: check-compose
# if: ${{ needs.check-compose.outputs.rawhide_compose != 'false' }}
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3

# - name: Add new compose id in compose.fedora
# run: |
# compose_id="${{ needs.check-compose.outputs.rawhide_compose }}"
# echo $compose_id >> compose/compose.fedora
# cat compose/compose.fedora

# - 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.rawhide_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.rawhide_compose }} - ${{ steps.date.outputs.date }}"
# labels: auto-merge,fedora-rawhide
# body: |
# Fedora rawhide compose ${{ needs.check-compose.outputs.rawhide_compose }}
# - Date: ${{ steps.date.outputs.date }}
# - Compose URL: ${{ env.COMPOSE_URL_rawhide }}
# - Packages:
# - ${{ needs.check-compose.outputs.osbuild_version }}
# - ${{ needs.check-compose.outputs.osbuild_composer_version }}
# - ${{ needs.check-compose.outputs.composer_cli_version }}

# - 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-rawhide

# - 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: Fedora Compose Test
# column-name: Fedora-rawhide
# issue-number: ${{ steps.cpr.outputs.pull-request-number }}
check-compose:
# Do not run this job on any fork repos
if: github.repository == 'virt-s1/rhel-edge'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Check if fedora rawhide compose is new
id: check_compose_id
run: |
curl -s "${COMPOSE_URL_rawhide}/COMPOSE_ID" --output COMPOSE_ID
COMPOSE_ID=$(cat COMPOSE_ID)
TESTED_COMPOSE=( $( cat compose/compose.fedora ) )
if [[ " ${TESTED_COMPOSE[*]} " =~ "$COMPOSE_ID" ]]; then
COMPOSE_ID="false"
fi
if [[ "$COMPOSE_ID" != "false" ]]; then
OSBUILD_VERSION=$(curl -s "${COMPOSE_URL_rawhide}/Everything/x86_64/os/Packages/o/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><")
OSBUILD_COMPOSER_VERSION=$(curl -s "${COMPOSE_URL_rawhide}/Everything/x86_64/os/Packages/o/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><")
COMPOSER_CLI_VERSION=$(curl -s "${COMPOSE_URL_rawhide}/Everything/x86_64/os/Packages/w/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><")
echo "osbuild_version=$OSBUILD_VERSION" >> $GITHUB_OUTPUT
echo "osbuild_composer_version=$OSBUILD_COMPOSER_VERSION" >> $GITHUB_OUTPUT
echo "composer_cli_version=$COMPOSER_CLI_VERSION" >> $GITHUB_OUTPUT
else
echo "osbuild_version=Null" >> $GITHUB_OUTPUT
echo "osbuild_composer_version=Null" >> $GITHUB_OUTPUT
echo "composer_cli_version=Null" >> $GITHUB_OUTPUT
fi
echo "rawhide_compose=$COMPOSE_ID" >> $GITHUB_OUTPUT
outputs:
rawhide_compose: ${{ steps.check_compose_id.outputs.rawhide_compose }}
osbuild_version: ${{ steps.check_compose_id.outputs.osbuild_version }}
osbuild_composer_version: ${{ steps.check_compose_id.outputs.osbuild_composer_version }}
composer_cli_version: ${{ steps.check_compose_id.outputs.composer_cli_version }}

fedora-rawhide:
needs: check-compose
if: ${{ needs.check-compose.outputs.rawhide_compose != 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Add new compose id in compose.fedora
run: |
compose_id="${{ needs.check-compose.outputs.rawhide_compose }}"
echo $compose_id >> compose/compose.fedora
cat compose/compose.fedora
- 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.rawhide_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.rawhide_compose }} - ${{ steps.date.outputs.date }}"
labels: auto-merge,fedora-rawhide
body: |
Fedora rawhide compose ${{ needs.check-compose.outputs.rawhide_compose }}
- Date: ${{ steps.date.outputs.date }}
- Compose URL: ${{ env.COMPOSE_URL_rawhide }}
- Packages:
- ${{ needs.check-compose.outputs.osbuild_version }}
- ${{ needs.check-compose.outputs.osbuild_composer_version }}
- ${{ needs.check-compose.outputs.composer_cli_version }}
- 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-rawhide

- 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: Fedora Compose Test
column-name: Fedora-rawhide
issue-number: ${{ steps.cpr.outputs.pull-request-number }}

fedora-39:
# Do not need check-compose and make "workflow_dispatch" work for this job
Expand Down
44 changes: 20 additions & 24 deletions tools/playbook/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -13,68 +13,64 @@ repos:
baseos: "http://{{ download_node }}/rhel-8/nightly/updates/RHEL-8/latest-RHEL-8.6.0/compose/BaseOS/x86_64/os/"
appstream: "http://{{ download_node }}/rhel-8/nightly/updates/RHEL-8/latest-RHEL-8.6.0/compose/AppStream/x86_64/os/"
crb: "http://{{ download_node }}/rhel-8/nightly/updates/RHEL-8/latest-RHEL-8.6.0/compose/CRB/x86_64/os/"
rhel-8-7:
baseos: "http://{{ download_node }}/rhel-8/nightly/updates/RHEL-8/latest-RHEL-8.7.0/compose/BaseOS/x86_64/os/"
appstream: "http://{{ download_node }}/rhel-8/nightly/updates/RHEL-8/latest-RHEL-8.7.0/compose/AppStream/x86_64/os/"
crb: "http://{{ download_node }}/rhel-8/nightly/updates/RHEL-8/latest-RHEL-8.7.0/compose/CRB/x86_64/os/"
rhel-8-8:
baseos: "http://{{ download_node }}/rhel-8/nightly/updates/RHEL-8/latest-RHEL-8.8.0/compose/BaseOS/x86_64/os/"
appstream: "http://{{ download_node }}/rhel-8/nightly/updates/RHEL-8/latest-RHEL-8.8.0/compose/AppStream/x86_64/os/"
crb: "http://{{ download_node }}/rhel-8/nightly/updates/RHEL-8/latest-RHEL-8.8.0/compose/CRB/x86_64/os/"
rhel-8-9:
baseos: "http://{{ download_node }}/rhel-8/nightly/RHEL-8/latest-RHEL-8.9.0/compose/BaseOS/x86_64/os/"
appstream: "http://{{ download_node }}/rhel-8/nightly/RHEL-8/latest-RHEL-8.9.0/compose/AppStream/x86_64/os/"
crb: "http://{{ download_node }}/rhel-8/nightly/RHEL-8/latest-RHEL-8.9.0/compose/CRB/x86_64/os/"
baseos: "http://{{ download_node }}/rhel-8/nightly/updates/RHEL-8/latest-RHEL-8.9.0/compose/BaseOS/x86_64/os/"
appstream: "http://{{ download_node }}/rhel-8/nightly/updates/RHEL-8/latest-RHEL-8.9.0/compose/AppStream/x86_64/os/"
crb: "http://{{ download_node }}/rhel-8/nightly/updates/RHEL-8/latest-RHEL-8.9.0/compose/CRB/x86_64/os/"
rhel-8-10:
baseos: "http://{{ download_node }}/rhel-8/nightly/RHEL-8/latest-RHEL-8.10.0/compose/BaseOS/x86_64/os/"
appstream: "http://{{ download_node }}/rhel-8/nightly/RHEL-8/latest-RHEL-8.10.0/compose/AppStream/x86_64/os/"
crb: "http://{{ download_node }}/rhel-8/nightly/RHEL-8/latest-RHEL-8.10.0/compose/CRB/x86_64/os/"
rhel-9-0:
baseos: "http://{{ download_node }}/rhel-9/nightly/updates/RHEL-9/latest-RHEL-9.0.0/compose/BaseOS/x86_64/os/"
appstream: "http://{{ download_node }}/rhel-9/nightly/updates/RHEL-9/latest-RHEL-9.0.0/compose/AppStream/x86_64/os/"
crb: "http://{{ download_node }}/rhel-9/nightly/updates/RHEL-9/latest-RHEL-9.0.0/compose/CRB/x86_64/os/"
rhel-9-1:
baseos: "http://{{ download_node }}/rhel-9/nightly/updates/RHEL-9/latest-RHEL-9.1.0/compose/BaseOS/x86_64/os/"
appstream: "http://{{ download_node }}/rhel-9/nightly/updates/RHEL-9/latest-RHEL-9.1.0/compose/AppStream/x86_64/os/"
crb: "http://{{ download_node }}/rhel-9/nightly/updates/RHEL-9/latest-RHEL-9.1.0/compose/CRB/x86_64/os/"
rhel-9-2:
baseos: "http://{{ download_node }}/rhel-9/nightly/updates/RHEL-9/latest-RHEL-9.2.0/compose/BaseOS/x86_64/os/"
appstream: "http://{{ download_node }}/rhel-9/nightly/updates/RHEL-9/latest-RHEL-9.2.0/compose/AppStream/x86_64/os/"
crb: "http://{{ download_node }}/rhel-9/nightly/updates/RHEL-9/latest-RHEL-9.2.0/compose/CRB/x86_64/os/"
rhel-9-3:
baseos: "http://{{ download_node }}/rhel-9/nightly/RHEL-9/latest-RHEL-9.3.0/compose/BaseOS/x86_64/os/"
appstream: "http://{{ download_node }}/rhel-9/nightly/RHEL-9/latest-RHEL-9.3.0/compose/AppStream/x86_64/os/"
crb: "http://{{ download_node }}/rhel-9/nightly/RHEL-9/latest-RHEL-9.3.0/compose/CRB/x86_64/os/"
baseos: "http://{{ download_node }}/rhel-9/nightly/updates/RHEL-9/latest-RHEL-9.3.0/compose/BaseOS/x86_64/os/"
appstream: "http://{{ download_node }}/rhel-9/nightly/updates/RHEL-9/latest-RHEL-9.3.0/compose/AppStream/x86_64/os/"
crb: "http://{{ download_node }}/rhel-9/nightly/updates/RHEL-9/latest-RHEL-9.3.0/compose/CRB/x86_64/os/"
rhel-9-4:
baseos: "http://{{ download_node }}/rhel-9/nightly/RHEL-9/latest-RHEL-9.4.0/compose/BaseOS/x86_64/os/"
appstream: "http://{{ download_node }}/rhel-9/nightly/RHEL-9/latest-RHEL-9.4.0/compose/AppStream/x86_64/os/"
crb: "http://{{ download_node }}/rhel-9/nightly/RHEL-9/latest-RHEL-9.4.0/compose/CRB/x86_64/os/"

images:
centos-stream-8: edge-centos-stream-8
centos-stream-9: CentOS-Stream-9-latest
rhel-8-4: RHEL-8.4.0-x86_64-nightly-latest
rhel-8-5: RHEL-8.5.0-x86_64-nightly-latest
rhel-8-6: RHEL-8.6.0-x86_64-nightly-latest
rhel-8-7: RHEL-8.7.0-x86_64-nightly-latest
rhel-8-8: RHEL-8.8.0-x86_64-nightly-latest
rhel-8-9: RHEL-8.9.0-x86_64-nightly-latest
rhel-8-10: RHEL-8.10.0-x86_64-nightly-latest
rhel-9-0: RHEL-9.0.0-x86_64-nightly-latest
rhel-9-1: RHEL-9.1.0-x86_64-nightly-latest
rhel-9-2: RHEL-9.2.0-x86_64-nightly-latest
rhel-9-3: RHEL-9.3.0-x86_64-nightly-latest
fedora-34: Fedora-Cloud-Base-34
fedora-35: Fedora-Cloud-Base-35
rhel-9-4: RHEL-9.4.0-x86_64-nightly-latest
remote-35: Fedora-Cloud-Base-35
fedora-36: edge-fedora-36
fedora-37: edge-fedora-37
fedora-38: edge-fedora-38
fedora-rawhide: Fedora-Cloud-Base-rawhide-latest
fedora-39: edge-fedora-39
fedora-rawhide: edge-fedora-rawhide

image_url:
centos-stream-9: https://composes.stream.centos.org/production/latest-CentOS-Stream/compose/BaseOS/x86_64/images
centos-stream-8: https://cloud.centos.org/centos/8-stream/x86_64/images
fedora-36: https://dl.fedoraproject.org/pub/fedora/linux/releases/36/Cloud/x86_64/images
fedora-37: https://dl.fedoraproject.org/pub/fedora/linux/releases/37/Cloud/x86_64/images
fedora-38: https://dl.fedoraproject.org/pub/fedora/linux/releases/38/Cloud/x86_64/images
fedora-39: https://dl.fedoraproject.org/pub/fedora/linux/development/39/Cloud/x86_64/images
fedora-rawhide: https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Cloud/x86_64/images

os_distro:
centos-stream-9: centos
centos-stream-8: centos
fedora-36: fedora
fedora-37: fedora
fedora-38: fedora
fedora-39: fedora
fedora-rawhide: fedora

0 comments on commit 9a87db3

Please sign in to comment.