Skip to content

Commit

Permalink
new trial file
Browse files Browse the repository at this point in the history
Signed-off-by: Lokesh Mandvekar <[email protected]>
  • Loading branch information
lsm5 committed Jan 24, 2024
1 parent f53a635 commit 4b62658
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/fcos-podman-next-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ jobs:
run: |
pip3 install git+https://github.com/packit/wait-for-copr.git@main
- name: Set up cosa
run: |
# TBD
- name: Check out code
uses: actions/checkout@v4

Expand Down Expand Up @@ -64,20 +68,13 @@ jobs:
org.opencontainers.image.description=FCOS image with rpms from rhcontainerbot/podman-next copr
org.opencontainers.image.revision=${{ github.sha }}
- name: Set up cosa
run: |
git clone https://github.com/coreos/coreos-assembler
- name: Build Machine images
run: |
# TBD


- name: Add Machine images to Manifest
# TBD


- name: Echo Outputs
run: |
echo "Image: ${{ steps.build_image_multiarch.outputs.image }}"
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/machine-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Build FCOS image with packages from rhcontainerbot/podman-next

on:
push:
branches:
- main
# Run everyday at midnight and pull the latest packages from the copr
schedule:
- cron: '0 0 * * *'

env:
MACHINE_IMAGE_NAME: machine-images
# IMAGE_ARCHS has to be comma separated
IMAGE_ARCHS: amd64, arm64
IMAGE_REGISTRY: quay.io/podman
COPR_OWNER: rhcontainerbot
COPR_PROJECT: podman-next

jobs:
fcos-podman-next-image-build:
runs-on: ubuntu-latest

steps:
- name: Install qemu dependency
run: |
sudo apt update
sudo apt -y install qemu-user-static
- name: Set up cosa
run: |
podman pull quay.io/coreos-assembler/coreos-assembler
mkdir fcos
cd fcos
echo "" >> ~/.bashrc
cat ./contrib/podman-next/machine-image/cosa-snippet >> ~/.bashrc
- name: Check out code
uses: actions/checkout@v4

- name: Build FCOS Image
id: build_image_multiarch
# Ref: https://github.com/redhat-actions/buildah-build
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.COPR_PROJECT }} podman-${{ env.SHORT_SHA }}
archs: ${{ env.IMAGE_ARCHS }}
containerfiles: ./contrib/podman-next/fcos-podmanimage/Containerfile
labels: |
org.opencontainers.image.title=fcos-podman-next image
org.opencontainers.image.source=https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/contrib/podman-next/fcos-podmanimage/Containerfile
org.opencontainers.image.url=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
org.opencontainers.image.description=FCOS image with rpms from rhcontainerbot/podman-next copr
org.opencontainers.image.revision=${{ github.sha }}
- name: Build Machine images
run: |
cosa shell
cosa init https://github.com/coreos/fedora-coreos-config
cosa fetch
cosa build
- name: Add Machine images to Manifest
# TBD

- name: Echo Outputs
run: |
echo "Image: ${{ steps.build_image_multiarch.outputs.image }}"
echo "Tags: ${{ steps.build_image_multiarch.outputs.tags }}"
echo "Tagged Image: ${{ steps.build_image_multiarch.outputs.image-with-tag }}"
- name: Check images created
run: buildah images | grep '${{ env.IMAGE_NAME }}'

- name: Check image metadata
run: |
set -x
# COPR_PROJECT envvar is used for the `podman-next` floating tag
buildah inspect ${{ steps.build_image_multiarch.outputs.image }}:${{ env.COPR_PROJECT }} | jq ".OCIv1.architecture"
buildah inspect ${{ steps.build_image_multiarch.outputs.image }}:${{ env.COPR_PROJECT }} | jq ".Docker.architecture"
buildah inspect ${{ steps.build_image_multiarch.outputs.image }}:podman-${{ env.SHORT_SHA }} | jq ".OCIv1.architecture"
buildah inspect ${{ steps.build_image_multiarch.outputs.image }}:podman-${{ env.SHORT_SHA }} | jq ".Docker.architecture"
- name: Push to Quay
id: push-to-quay
# Ref: https://github.com/redhat-actions/push-to-registry
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ env.MACHINE_IMAGE_NAME }}
tags: ${{ steps.build_image_multiarch.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ secrets.QUAY_PODMAN_USERNAME }}
password: ${{ secrets.QUAY_PODMAN_PASSWORD }}

0 comments on commit 4b62658

Please sign in to comment.