mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
stuff
This commit is contained in:
parent
63edb6f07f
commit
cae70ddc22
9 changed files with 73 additions and 68 deletions
6
.github/workflows/bot_commands.yml
vendored
6
.github/workflows/bot_commands.yml
vendored
|
|
@ -85,9 +85,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
pr: ${{ github.event.issue.number }}
|
pr: ${{ github.event.issue.number }}
|
||||||
parent_job_name: Run ISO Tests
|
parent_job_name: Run ISO Tests
|
||||||
iso_name-38: ${{ needs.load_vars.outputs.IMAGE_NAME }}-38.iso
|
|
||||||
iso_name-39: ${{ needs.load_vars.outputs.IMAGE_NAME }}-39.iso
|
|
||||||
iso_name-40: ${{ needs.load_vars.outputs.IMAGE_NAME }}-40.iso
|
|
||||||
|
|
||||||
run_test_deployment:
|
run_test_deployment:
|
||||||
name: Run ISO Deployment Tests
|
name: Run ISO Deployment Tests
|
||||||
|
|
@ -106,6 +103,3 @@ jobs:
|
||||||
with:
|
with:
|
||||||
pr: ${{ github.event.issue.number }}
|
pr: ${{ github.event.issue.number }}
|
||||||
parent_job_name: Run ISO Deployment Tests
|
parent_job_name: Run ISO Deployment Tests
|
||||||
iso_name-38: ${{ needs.load_vars.outputs.IMAGE_NAME }}-38.iso
|
|
||||||
iso_name-39: ${{ needs.load_vars.outputs.IMAGE_NAME }}-39.iso
|
|
||||||
iso_name-40: ${{ needs.load_vars.outputs.IMAGE_NAME }}-40.iso
|
|
||||||
|
|
|
||||||
5
.github/workflows/build_container.yml
vendored
5
.github/workflows/build_container.yml
vendored
|
|
@ -32,11 +32,6 @@ jobs:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
fetch-tags: 'true'
|
fetch-tags: 'true'
|
||||||
|
|
||||||
- name: Debug
|
|
||||||
run: |
|
|
||||||
export
|
|
||||||
set
|
|
||||||
|
|
||||||
- name: Switch branch
|
- name: Switch branch
|
||||||
if: inputs.pr
|
if: inputs.pr
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ _LORAX_TEMPLATES += $(call get_templates,flatpak)
|
||||||
_TEMPLATE_VARS += FLATPAK_DIR FLATPAK_REMOTE_NAME FLATPAK_REMOTE_REFS FLATPAK_REMOTE_URL _FLATPAK_REPO_GPG _FLATPAK_REPO_URL
|
_TEMPLATE_VARS += FLATPAK_DIR FLATPAK_REMOTE_NAME FLATPAK_REMOTE_REFS FLATPAK_REMOTE_URL _FLATPAK_REPO_GPG _FLATPAK_REPO_URL
|
||||||
else
|
else
|
||||||
ifneq ($(FLATPAK_REMOTE_REFS_DIR),)
|
ifneq ($(FLATPAK_REMOTE_REFS_DIR),)
|
||||||
COLLECTED_REFS = $(foreach file,$(shell ls $(FLATPAK_REMOTE_REFS_DIR)/*),$(shell cat $(file)))
|
COLLECTED_REFS = $(foreach file,$(filter-out README.md Makefile,$(wildcard $(FLATPAK_REMOTE_REFS_DIR)/*)),$(shell cat $(file)))
|
||||||
FLATPAK_REMOTE_REFS += $(sort $(COLLECTED_REFS))
|
FLATPAK_REMOTE_REFS += $(sort $(COLLECTED_REFS))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,24 @@
|
||||||
# Configuration vars
|
# Configuration vars
|
||||||
## Formatting = UPPERCASE
|
## Formatting = UPPERCASE
|
||||||
# General
|
# General
|
||||||
export ADDITIONAL_TEMPLATES =
|
export ADDITIONAL_TEMPLATES :=
|
||||||
export ARCH = x86_64
|
export ARCH := x86_64
|
||||||
export EXTRA_BOOT_PARAMS =
|
export EXTRA_BOOT_PARAMS :=
|
||||||
export IMAGE_NAME = base
|
export IMAGE_NAME := base
|
||||||
export IMAGE_REPO = quay.io/fedora-ostree-desktops
|
export IMAGE_REPO := quay.io/fedora-ostree-desktops
|
||||||
export IMAGE_TAG = $(VERSION)
|
export IMAGE_TAG := $(VERSION)
|
||||||
REPOS = $(subst :,\:,$(wildcard /etc/yum.repos.d/*.repo))
|
REPOS := $(subst :,\:,$(wildcard /etc/yum.repos.d/*.repo))
|
||||||
export ROOTFS_SIZE = 4
|
export ROOTFS_SIZE := 4
|
||||||
export VARIANT = Server
|
export VARIANT := Server
|
||||||
export VERSION = 39
|
export VERSION := 39
|
||||||
export WEB_UI = false
|
export WEB_UI := false
|
||||||
# Flatpak
|
# Flatpak
|
||||||
export FLATPAK_REMOTE_NAME = flathub
|
export FLATPAK_REMOTE_NAME := flathub
|
||||||
export FLATPAK_REMOTE_URL = https://flathub.org/repo/flathub.flatpakrepo
|
export FLATPAK_REMOTE_URL := https://flathub.org/repo/flathub.flatpakrepo
|
||||||
export FLATPAK_REMOTE_REFS =
|
export FLATPAK_REMOTE_REFS :=
|
||||||
export FLATPAK_REMOTE_REFS_DIR =
|
export FLATPAK_REMOTE_REFS_DIR :=
|
||||||
export FLATPAK_DIR =
|
export FLATPAK_DIR :=
|
||||||
# Secure boot
|
# Secure boot
|
||||||
export ENROLLMENT_PASSWORD =
|
export ENROLLMENT_PASSWORD :=
|
||||||
export SECURE_BOOT_KEY_URL =
|
export SECURE_BOOT_KEY_URL :=
|
||||||
export ISO_NAME = build/deploy.iso
|
export ISO_NAME := build/deploy.iso
|
||||||
46
action.yml
46
action.yml
|
|
@ -66,6 +66,9 @@ inputs:
|
||||||
description: "Name of the resulting ISO. Relative paths are relative to github.workspace"
|
description: "Name of the resulting ISO. Relative paths are relative to github.workspace"
|
||||||
required: false
|
required: false
|
||||||
default: build/deploy.iso
|
default: build/deploy.iso
|
||||||
|
make_action:
|
||||||
|
description: "Overrides the default make action"
|
||||||
|
required: false
|
||||||
repos:
|
repos:
|
||||||
description: List of repo files for Lorax to use
|
description: List of repo files for Lorax to use
|
||||||
required: false
|
required: false
|
||||||
|
|
@ -92,11 +95,11 @@ inputs:
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
iso_name:
|
iso_name:
|
||||||
value: ${{ steps.rename_iso.outputs.iso_name }}
|
value: ${{ steps.docker.outputs.iso_name }}
|
||||||
description: The name of the resulting .iso
|
description: The name of the resulting .iso
|
||||||
iso_path:
|
iso_path:
|
||||||
value: ${{ steps.rename_iso.outputs.iso_path }}
|
value: ${{ steps.docker.outputs.iso_path }}
|
||||||
description: The name and path of the resulting .iso
|
description: The path of the resulting .iso
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
|
|
@ -139,44 +142,18 @@ runs:
|
||||||
id: flatpak_dependencies
|
id: flatpak_dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
image="${{ inputs.image_repo }}/${{ inputs.image_name }}:${{ inputs.image_tag }}"
|
cd ${{ github.action_path }}
|
||||||
# Make temp space
|
make flatpaks/repo
|
||||||
FLATPAK_DIR=$(basename $(mktemp -d -p ${{ github.workspace }} flatpak.XXX))
|
|
||||||
# Get list of refs from directory
|
|
||||||
sudo mkdir /github || true
|
|
||||||
sudo ln -s ${{ github.workspace }} /github/workspace
|
|
||||||
DIR_REFS=$(cat ${{ inputs.flatpak_remote_refs_dir }}/* | tr '\n' ' ' )
|
|
||||||
# Generate install script
|
|
||||||
cat << EOF > ${{ github.workspace }}/${FLATPAK_DIR}/script.sh
|
|
||||||
mkdir -p /flatpak/flatpak /flatpak/triggers
|
|
||||||
mkdir /var/tmp || true
|
|
||||||
chmod -R 1777 /var/tmp
|
|
||||||
flatpak config --system --set languages "*"
|
|
||||||
flatpak remote-add --system ${{ inputs.flatpak_remote_name }} ${{ inputs.flatpak_remote_url }}
|
|
||||||
flatpak install --system -y ${{ inputs.flatpak_remote_refs }} ${DIR_REFS}
|
|
||||||
ostree init --repo=/flatpak_dir/repo --mode=archive-z2
|
|
||||||
for i in \$(ostree refs --repo=\${FLATPAK_SYSTEM_DIR}/repo | grep '^deploy/' | sed 's/^deploy\///g')
|
|
||||||
do
|
|
||||||
echo "Copying \${i}..."
|
|
||||||
ostree --repo=/flatpak_dir/repo pull-local \${FLATPAK_SYSTEM_DIR}/repo \$(ostree --repo=\${FLATPAK_SYSTEM_DIR}/repo rev-parse ${{ inputs.flatpak_remote_name }}/\${i})
|
|
||||||
mkdir -p \$(dirname /flatpak_dir/repo/refs/heads/\${i})
|
|
||||||
ostree --repo=\${FLATPAK_SYSTEM_DIR}/repo rev-parse ${{ inputs.flatpak_remote_name }}/\${i} > /flatpak_dir/repo/refs/heads/\${i}
|
|
||||||
done
|
|
||||||
flatpak build-update-repo /flatpak_dir/repo
|
|
||||||
ostree refs --repo=/flatpak_dir/repo
|
|
||||||
EOF
|
|
||||||
docker run --rm --privileged --entrypoint bash -e FLATPAK_SYSTEM_DIR=/flatpak/flatpak -e FLATPAK_TRIGGERSDIR=/flatpak/triggers --volume ${{ github.workspace }}/${FLATPAK_DIR}:/flatpak_dir ${image} /flatpak_dir/script.sh
|
|
||||||
echo "flatpak_dir=${FLATPAK_DIR}" >> $GITHUB_OUTPUT
|
|
||||||
docker rmi ${image}
|
|
||||||
|
|
||||||
- name: Run docker image
|
- name: Run docker image
|
||||||
|
id: docker
|
||||||
env:
|
env:
|
||||||
ACTION_REPO: ${{ github.action_repository }}
|
ACTION_REPO: ${{ github.action_repository }}
|
||||||
ACTION_REF: ${{ github.action_ref }}
|
ACTION_REF: ${{ github.action_ref }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
image=$(echo "ghcr.io/${ACTION_REPO}" | tr [:upper:] [:lower:])
|
image=$(echo "ghcr.io/${ACTION_REPO}" | tr [:upper:] [:lower:])
|
||||||
# Check if running inside01 of the action repo
|
# Check if running inside of the action repo
|
||||||
if [[ -z "${ACTION_REPO}" ]]
|
if [[ -z "${ACTION_REPO}" ]]
|
||||||
then
|
then
|
||||||
image=$(echo "ghcr.io/${{ github.repository }}" | tr [:upper:] [:lower:])
|
image=$(echo "ghcr.io/${{ github.repository }}" | tr [:upper:] [:lower:])
|
||||||
|
|
@ -208,6 +185,7 @@ runs:
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
docker run --privileged --volume ${{ github.workspace }}:/github/workspace/ ${cache} ${image}:${tag} \
|
docker run --privileged --volume ${{ github.workspace }}:/github/workspace/ ${cache} ${image}:${tag} \
|
||||||
|
${{ inputs.make_action }} \
|
||||||
ADDITIONAL_TEMPLATES="${{ inputs.additional_templates }}" \
|
ADDITIONAL_TEMPLATES="${{ inputs.additional_templates }}" \
|
||||||
ARCH="${{ inputs.arch }}" \
|
ARCH="${{ inputs.arch }}" \
|
||||||
DNF_CACHE="/cache/dnf" \
|
DNF_CACHE="/cache/dnf" \
|
||||||
|
|
@ -225,6 +203,8 @@ runs:
|
||||||
VARIANT="${{ inputs.variant }}" \
|
VARIANT="${{ inputs.variant }}" \
|
||||||
VERSION="${{ inputs.version }}" \
|
VERSION="${{ inputs.version }}" \
|
||||||
WEB_UI="${{ inputs.web_ui }}"
|
WEB_UI="${{ inputs.web_ui }}"
|
||||||
|
echo "iso_path=$(dirname ${{ inputs.iso_name }})" >> $GITHUB_OUTPUT
|
||||||
|
echo "iso_name=$(basename ${{ inputs.iso_name }})" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Save dnf cache
|
- name: Save dnf cache
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
install-deps:
|
|
||||||
|
|
||||||
clean:
|
|
||||||
37
flatpaks/Makefile
Normal file
37
flatpaks/Makefile
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
full_list: repo
|
||||||
|
cat list.txt >&2
|
||||||
|
|
||||||
|
|
||||||
|
repo: script.sh
|
||||||
|
image="$(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)"
|
||||||
|
$(if $(GITHUB_WORKSPACE),$(eval FLATPAK_DIR=$(shell mktemp -d -p $(GITHUB_WORKSPACE) flatpak.XXX),$(PWD)))
|
||||||
|
$(if $(GITHUB_WORKSPACE),cp script.sh $(GITHUB_WORKSPACE)/$(FLATPAK_DIR)/)
|
||||||
|
docker run --rm --privileged --entrypoint bash -e FLATPAK_SYSTEM_DIR=/flatpak/flatpak -e FLATPAK_TRIGGERSDIR=/flatpak/triggers --volume $(_BASE_DIR)/flatpaks:/flatpak_dir ${image} /flatpak_dir/script.sh
|
||||||
|
$(if $(GITHUB_OUTPUT),echo "flatpak_dir=$(notdir $(FLATPAK_DIR))" >> $(GITHUB_OUTPUT))
|
||||||
|
docker rmi ${image}
|
||||||
|
|
||||||
|
script.sh:
|
||||||
|
cat << EOF > script.sh
|
||||||
|
mkdir -p /flatpak/flatpak /flatpak/triggers
|
||||||
|
mkdir /var/tmp || true
|
||||||
|
chmod -R 1777 /var/tmp
|
||||||
|
flatpak config --system --set languages "*"
|
||||||
|
flatpak remote-add --system $(FLATPAK_REMOTE_NAME) $(FLATPAK_REMOTE_URL)
|
||||||
|
flatpak install --system -y $(FLATPAK_REMOTE_REFS)
|
||||||
|
ostree init --repo=/flatpak_dir/repo --mode=archive-z2
|
||||||
|
for i in \$$(ostree refs --repo=\$${FLATPAK_SYSTEM_DIR}/repo | grep '^deploy/' | sed 's/^deploy\///g')
|
||||||
|
do
|
||||||
|
echo "Copying \$${i}..."
|
||||||
|
ostree --repo=/flatpak_dir/repo pull-local \$${FLATPAK_SYSTEM_DIR}/repo \$$(ostree --repo=\$${FLATPAK_SYSTEM_DIR}/repo rev-parse $(FLATPAK_REMOTE_NAME)/\$${i})
|
||||||
|
mkdir -p \$(dirname /flatpak_dir/repo/refs/heads/\${i})
|
||||||
|
ostree --repo=\$${FLATPAK_SYSTEM_DIR}/repo rev-parse $(FLATPAK_REMOTE_NAME)/\$${i} > /flatpak_dir/repo/refs/heads/\$${i}
|
||||||
|
done
|
||||||
|
flatpak build-update-repo /flatpak_dir/repo
|
||||||
|
ostree refs --repo=/flatpak_dir/repo > /flatpak_dir/list.txt
|
||||||
|
EOF
|
||||||
|
|
||||||
|
install-deps:
|
||||||
|
|
||||||
|
clean:
|
||||||
|
|
||||||
|
.ONESHELL:
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
ISO_NAME=deploy.iso
|
ISO_NAME=deploy.iso
|
||||||
ISO_TESTS=$(wildcard install_*) $(if $(FLATPAK_REMOTE_REFS) $(FLATPAK_DIR),$(wildcard flatpak_*))
|
ISO_TESTS=$(wildcard install_*) $(if $(FLATPAK_REMOTE_REFS),$(wildcard flatpak_*))$(if $(FLATPAK_DIR),$(wildcard flatpak_*))
|
||||||
|
|
||||||
all: $(ISO_TESTS) clean
|
all: $(ISO_TESTS) clean
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,8 @@ files/install.iso: files/grub.cfg
|
||||||
-indev ../../$(ISO_NAME)
|
-indev ../../$(ISO_NAME)
|
||||||
-outdev files/install.iso
|
-outdev files/install.iso
|
||||||
-boot_image any replay
|
-boot_image any replay
|
||||||
|
-joliet on
|
||||||
|
-compliance joliet_long_names
|
||||||
-map files/ks.cfg ks.cfg
|
-map files/ks.cfg ks.cfg
|
||||||
-chmod 0444 ks.cfg
|
-chmod 0444 ks.cfg
|
||||||
-map files/grub.cfg boot/grub2/grub.cfg
|
-map files/grub.cfg boot/grub2/grub.cfg
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue