Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a package list file per image in the channel #66

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions channels/sl-micro-61-baremetal.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
[
{
"metadata": {
"name": "baremetal-v2.2.0-3.12-os"
},
"spec": {
"version": "v2.2.0-3.12",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sl-micro/6.1/baremetal-os-container:2.2.0-3.12",
"displayName": "SL Micro Baremetal 6.1 OS",
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1732723935
}
}
},
{
"metadata": {
"name": "baremetal-v2.2.0-3.9-os"
Expand All @@ -14,6 +29,21 @@
}
}
},
{
"metadata": {
"name": "baremetal-v2.2.0-3.8-os"
},
"spec": {
"version": "v2.2.0-3.8",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sl-micro/6.1/baremetal-os-container:2.2.0-3.8",
"displayName": "SL Micro Baremetal 6.1 OS",
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1731339707
}
}
},
{
"metadata": {
"name": "baremetal-v2.2.0-3.7-iso"
Expand All @@ -28,5 +58,35 @@
"created": 1730920423
}
}
},
{
"metadata": {
"name": "baremetal-v2.2.0-3.5-iso"
},
"spec": {
"version": "v2.2.0-3.5",
"type": "iso",
"metadata": {
"uri": "registry.suse.com/suse/sl-micro/6.1/baremetal-iso-image:2.2.0-3.5",
"displayName": "SL Micro Baremetal 6.1 ISO",
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1730283106
}
}
},
{
"metadata": {
"name": "baremetal-v2.2.0-3.4-iso"
},
"spec": {
"version": "v2.2.0-3.4",
"type": "iso",
"metadata": {
"uri": "registry.suse.com/suse/sl-micro/6.1/baremetal-iso-image:2.2.0-3.4",
"displayName": "SL Micro Baremetal 6.1 ISO",
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1730116249
}
}
}
]
Binary file added channels/sl-micro-61-baremetal.packages.tar
Binary file not shown.
60 changes: 60 additions & 0 deletions channels/sl-micro-61-base.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
[
{
"metadata": {
"name": "base-v2.2.0-3.12-os"
},
"spec": {
"version": "v2.2.0-3.12",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sl-micro/6.1/base-os-container:2.2.0-3.12",
"displayName": "SL Micro Base 6.1 OS",
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1732723652
}
}
},
{
"metadata": {
"name": "base-v2.2.0-3.9-os"
Expand All @@ -14,6 +29,21 @@
}
}
},
{
"metadata": {
"name": "base-v2.2.0-3.8-os"
},
"spec": {
"version": "v2.2.0-3.8",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sl-micro/6.1/base-os-container:2.2.0-3.8",
"displayName": "SL Micro Base 6.1 OS",
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1731339461
}
}
},
{
"metadata": {
"name": "base-v2.2.0-3.7-iso"
Expand All @@ -28,5 +58,35 @@
"created": 1730920380
}
}
},
{
"metadata": {
"name": "base-v2.2.0-3.5-iso"
},
"spec": {
"version": "v2.2.0-3.5",
"type": "iso",
"metadata": {
"uri": "registry.suse.com/suse/sl-micro/6.1/base-iso-image:2.2.0-3.5",
"displayName": "SL Micro Base 6.1 ISO",
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1730283062
}
}
},
{
"metadata": {
"name": "base-v2.2.0-3.4-iso"
},
"spec": {
"version": "v2.2.0-3.4",
"type": "iso",
"metadata": {
"uri": "registry.suse.com/suse/sl-micro/6.1/base-iso-image:2.2.0-3.4",
"displayName": "SL Micro Base 6.1 ISO",
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1730116208
}
}
}
]
Binary file added channels/sl-micro-61-base.packages.tar
Binary file not shown.
60 changes: 60 additions & 0 deletions channels/sl-micro-61-kvm.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
[
{
"metadata": {
"name": "kvm-v2.2.0-3.15-os"
},
"spec": {
"version": "v2.2.0-3.15",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sl-micro/6.1/kvm-os-container:2.2.0-3.15",
"displayName": "SL Micro KVM 6.1 OS",
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1732723835
}
}
},
{
"metadata": {
"name": "kvm-v2.2.0-3.12-os"
Expand All @@ -14,6 +29,21 @@
}
}
},
{
"metadata": {
"name": "kvm-v2.2.0-3.11-os"
},
"spec": {
"version": "v2.2.0-3.11",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sl-micro/6.1/kvm-os-container:2.2.0-3.11",
"displayName": "SL Micro KVM 6.1 OS",
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1731339615
}
}
},
{
"metadata": {
"name": "kvm-v2.2.0-3.9-iso"
Expand All @@ -28,5 +58,35 @@
"created": 1730920378
}
}
},
{
"metadata": {
"name": "kvm-v2.2.0-3.7-iso"
},
"spec": {
"version": "v2.2.0-3.7",
"type": "iso",
"metadata": {
"uri": "registry.suse.com/suse/sl-micro/6.1/kvm-iso-image:2.2.0-3.7",
"displayName": "SL Micro KVM 6.1 ISO",
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1730283049
}
}
},
{
"metadata": {
"name": "kvm-v2.2.0-3.6-iso"
},
"spec": {
"version": "v2.2.0-3.6",
"type": "iso",
"metadata": {
"uri": "registry.suse.com/suse/sl-micro/6.1/kvm-iso-image:2.2.0-3.6",
"displayName": "SL Micro KVM 6.1 ISO",
"platforms": ["linux/x86_64","linux/aarch64"],
"created": 1730116199
}
}
}
]
Binary file added channels/sl-micro-61-kvm.packages.tar
Binary file not shown.
60 changes: 60 additions & 0 deletions channels/sl-micro-61-rt.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
[
{
"metadata": {
"name": "rt-v2.2.0-3.12-os"
},
"spec": {
"version": "v2.2.0-3.12",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sl-micro/6.1/rt-os-container:2.2.0-3.12",
"displayName": "SL Micro RT 6.1 OS",
"platforms": ["linux/x86_64"],
"created": 1732724266
}
}
},
{
"metadata": {
"name": "rt-v2.2.0-3.9-os"
Expand All @@ -14,6 +29,21 @@
}
}
},
{
"metadata": {
"name": "rt-v2.2.0-3.8-os"
},
"spec": {
"version": "v2.2.0-3.8",
"type": "container",
"metadata": {
"upgradeImage": "registry.suse.com/suse/sl-micro/6.1/rt-os-container:2.2.0-3.8",
"displayName": "SL Micro RT 6.1 OS",
"platforms": ["linux/x86_64"],
"created": 1731339988
}
}
},
{
"metadata": {
"name": "rt-v2.2.0-3.7-iso"
Expand All @@ -28,5 +58,35 @@
"created": 1730920760
}
}
},
{
"metadata": {
"name": "rt-v2.2.0-3.5-iso"
},
"spec": {
"version": "v2.2.0-3.5",
"type": "iso",
"metadata": {
"uri": "registry.suse.com/suse/sl-micro/6.1/rt-iso-image:2.2.0-3.5",
"displayName": "SL Micro RT 6.1 ISO",
"platforms": ["linux/x86_64"],
"created": 1730283402
}
}
},
{
"metadata": {
"name": "rt-v2.2.0-3.4-iso"
},
"spec": {
"version": "v2.2.0-3.4",
"type": "iso",
"metadata": {
"uri": "registry.suse.com/suse/sl-micro/6.1/rt-iso-image:2.2.0-3.4",
"displayName": "SL Micro RT 6.1 ISO",
"platforms": ["linux/x86_64"],
"created": 1730116564
}
}
}
]
Binary file added channels/sl-micro-61-rt.packages.tar
Binary file not shown.
11 changes: 11 additions & 0 deletions refresh_channels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ function process_repo() {
local intermediate_entry="{\"uri\":\"$image_uri\",\"created\":\"$image_creation_date\",\"version\":\"$version\",\"managedOSVersionName\":\"$managed_os_version_name\",\"displayName\":\"$display_name\",\"platforms\":$platforms}"
echo "Intermediate: $intermediate_entry"
local intermediate_list=("${intermediate_list[@]}" "$intermediate_entry")
if [[ "${repo_type}" == "os" ]]; then
podman pull "${image_uri}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find podman within the GitHub Actions runner image, you may have to add a apt-get -y install podman step in the workflow.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I was looking in the wrong place :P

podman run --rm "${image_uri}" rpm -qa --qf "%{NAME}|%{EPOCH}|%{VERSION}|%{RELEASE}|%{ARCH}|%{DISTURL}|%{LICENSE}\n" | sort > "channels/${managed_os_version_name}.packages"
podman rmi "${image_uri}"
fi

img_count=$((img_count + 1))
done
Expand Down Expand Up @@ -212,6 +217,12 @@ while IFS=\= read watch; do

# Validate the JSON file
cat $file | jq empty

# Create tarball for packages list of ech image in the channel
while IFS= read -r -d '' pkgs_file; do
tar rf "channels/${file_name}.packages.tar" "${pkgs_file}"
rm "${pkgs_file}"
done < <(find channels/ -mindepth 1 -maxdepth 1 -type f -name "*.packages" -print0)
done <<END
$watches
END