Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
feat(ci): Added ability to run the workflow manually and fix: general…
Browse files Browse the repository at this point in the history
… fixes (#17)
  • Loading branch information
noelmiller authored Feb 20, 2024
1 parent c243690 commit 42d6877
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
push:
branches:
- main
workflow_dispatch:

jobs:
push-image:
Expand Down Expand Up @@ -49,4 +50,4 @@ jobs:
run: exit 1
- name: Exit
shell: bash
run: exit 0
run: exit 0
7 changes: 5 additions & 2 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Used by buildah build --build-arg to create multiple different versions of the image
ARG VERSION=39

FROM fedora:${VERSION}

# Set version for the environment variables in the container.
ARG VERSION=39

ENV ARCH="x86_64"
ENV IMAGE_NAME="base-main"
ENV IMAGE_REPO="ghcr.io/ublue-os"
Expand All @@ -17,5 +21,4 @@ RUN dnf install -y make && make install-deps

VOLUME /isogenerator/output

ENTRYPOINT ["make", "output/${IMAGE_NAME}-${IMAGE_TAG}.iso"]
CMD [ "ARCH=${ARCH}", "VERSION=${VERSION}", "IMAGE_REPO=${IMAGE_REPO}", "IMAGE_NAME=${IMAGE_NAME}", "IMAGE_TAG=${IMAGE_TAG}", "VARIANT=${VARIANT}", "WEB_UI=${WEB_UI}"]
ENTRYPOINT ["sh", "-c", "make output/${IMAGE_NAME}-${IMAGE_TAG}.iso ARCH=${ARCH} VERSION=${VERSION} IMAGE_REPO=${IMAGE_REPO} IMAGE_NAME=${IMAGE_NAME} IMAGE_TAG=${IMAGE_TAG} VARIANT=${VARIANT} WEB_UI=${WEB_UI}"]
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $(IMAGE_NAME)-$(IMAGE_TAG).iso: output/$(IMAGE_NAME)-$(IMAGE_TAG).iso

# Step 6: Build end ISO file
output/$(IMAGE_NAME)-$(IMAGE_TAG).iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.txt
mkdir $(_BASE_DIR)/output
mkdir $(_BASE_DIR)/output || true
xorriso -dialog on < $(_BASE_DIR)/xorriso/input.txt

# Step 1: Generate Lorax Templates
Expand All @@ -48,7 +48,7 @@ lorax_templates/%.tmpl: lorax_templates/%.tmpl.in
boot.iso: lorax_templates/set_installer.tmpl lorax_templates/configure_upgrades.tmpl
rm -Rf $(_BASE_DIR)/results
lorax -p $(IMAGE_NAME) -v $(VERSION) -r $(VERSION) -t $(VARIANT) \
--isfinal --buildarch=$(ARCH) --volid=$(IMAGE_NAME)-$(ARCH)-$(VERSION) \
--isfinal --buildarch=$(ARCH) --volid=$(IMAGE_NAME)-$(ARCH)-$(IMAGE_TAG) \
$(_LORAX_ARGS) \
--repo /etc/yum.repos.d/fedora.repo \
--repo /etc/yum.repos.d/fedora-updates.repo \
Expand All @@ -59,7 +59,7 @@ boot.iso: lorax_templates/set_installer.tmpl lorax_templates/configure_upgrades.

# Step 3: Download container image
container/$(IMAGE_NAME)-$(IMAGE_TAG):
mkdir container
mkdir container || true
podman pull $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
podman save --format oci-dir -o $(_BASE_DIR)/container/$(IMAGE_NAME)-$(IMAGE_TAG) $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
podman rmi $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# UBlueOS ISO Generator
This action is used to generate the ISO images for UBlueOS.


## Makefile
A Makefile is provided for ease of use. There are separate targets for each file generated, however `make` can be used to generate the final image and `make clean` can be used to clean up the workspace.

Expand All @@ -10,17 +9,21 @@ See [Customizing](#customizing) for information about customizing the image that
## Container
A container with the necessary tools already installed is provided at `ghcr.io/ublue-os/isogenerator:latest`

To use the container file, run `docker --privileged --volume .:/isogenerator/output ghcr.io/ublue-os/isogenerator`
To use the container file, run `docker run --privileged --volume .:/isogenerator/output ghcr.io/ublue-os/isogenerator`.

This will create an ISO with the baked in defaults of the container image.

See [Customizing](#customizing) for information about customizing the image that gets created. The variable can either be defined as environment variables or as command arguments.
Examples:
Environment Variable

Creating Bluefin GTS ISO
```bash
docker --privileged --volume .:/isogenerator/output -e VERSION=39 ghcr.io/ublue-os/isogenerator
docker run --rm --privileged --volume .:/isogenerator/output -e VERSION=38 -e IMAGE_NAME=bluefin -e IMAGE_TAG=gts -e VARIANT=Silverblue ghcr.io/ublue-os/isogenerator:38
```
Command Argument

Creating Bazzite Latest ISO
```bash
docker --privileged --volume .:/isogenerator/output ghcr.io/ublue-os/isogenerator VERSION=39
docker run --rm --privileged --volume .:/isogenerator/output -e VERSION=39 -e IMAGE_NAME=bazzite -e IMAGE_TAG=latest -e VARIANT=Kinoite ghcr.io/ublue-os/isogenerator:39
```

## Customizing
Expand Down
11 changes: 5 additions & 6 deletions xorriso/gen_input.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
echo "-indev $(pwd)/boot.iso"
echo "-outdev $(pwd)/output/@IMAGE_NAME@-@IMAGE_TAG@.iso"
echo "-boot_image any replay"
echo "-volid @IMAGE_NAME@-@ARCH@-@IMAGE_TAG@"
echo "-joliet on"
echo "-compliance joliet_long_names"
cd container
for file in $(find @IMAGE_NAME@-@IMAGE_TAG@)
do
echo "-map $(pwd)/${file} ${file}"
echo "-chmod 0444 ${file}"
for file in $(find @IMAGE_NAME@-@IMAGE_TAG@); do
echo "-map $(pwd)/${file} ${file}"
echo "-chmod 0444 ${file}"
done
echo "-end"
echo "-end"

0 comments on commit 42d6877

Please sign in to comment.