diff --git a/README.md b/README.md index b8da5e4..53d9e5f 100644 --- a/README.md +++ b/README.md @@ -3,163 +3,10 @@ # Build Container Installer Action -This action is used to generate an ISO for installing an OSTree stored in a container image. This utilizes the anaconda command `ostreecontainer` +This action is used to generate an ISO for installing an OSTree stored in a container image. This utilizes the anaconda command `ostreecontainer`, which also support bootc. -## Usage +**See the [Wiki](https://github.com/JasonN3/build-container-installer/wiki) for development and usage information.** -This action is designed to be called from a GitHub workflow using the following format - -```yaml -- name: Build ISO - uses: jasonn3/build-container-installer@main - id: build - with: - arch: ${{ env.ARCH}} - image_name: ${{ env.IMAGE_NAME}} - image_repo: ${{ env.IMAGE_REPO}} - image_tag: ${{ env.IMAGE_TAG }} - version: ${{ env.VERSION }} - variant: ${{ env.VARIANT }} - iso_name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ env.VERSION }}.iso - -# This example is for uploading your ISO as a Github artifact. You can do something similar using any cloud storage, so long as you copy the output -- name: Upload ISO as artifact - id: upload - uses: actions/upload-artifact@v4 - with: - name: ${{ steps.build.outputs.iso_name }} - path: | - ${{ steps.build.outputs.iso_path }} - ${{ steps.build.outputs.iso_path }}-CHECKSUM - if-no-files-found: error - retention-days: 0 - compression-level: 0 -``` - -See [Customizing](#customizing) for information about customizing the ISO that gets created using `with` - -## Customizing - -The following variables can be used to customize the created ISO. - -### Inputs - -| Variable | Description | Default Value | Action | Container/Makefile | -| ----------------------- | ---------------------------------------------------------------------------- | -------------------------------------------- | ------------------ | ------------------ | -| additional_templates | Space delimited list of additional Lorax templates to include | \[empty\] | :white_check_mark: | :white_check_mark: | -| arch | Architecture for image to build | x86_64 | :white_check_mark: | :white_check_mark: | -| enrollment_password | Used for supporting secure boot (requires SECURE_BOOT_KEY_URL to be defined) | container-installer | :white_check_mark: | :white_check_mark: | -| extra_boot_params | Extra params used by grub to boot the anaconda installer | \[empty\] | :white_check_mark: | :white_check_mark: | -| flatpak_remote_name | Name of the Flatpak repo on the destination OS | flathub | :white_check_mark: | :white_check_mark: | -| flatpak_remote_refs | Space separated list of flatpak refs to install | \[empty\] | :white_check_mark: | :white_check_mark: | -| flatpak_remote_refs_dir | Directory that contains files that list the flatpak refs to install | \[empty\] | :white_check_mark: | :white_check_mark: | -| flatpak_remote_url | URL of the flatpakrepo file | | :white_check_mark: | :white_check_mark: | -| image_name | Name of the source container image | base | :white_check_mark: | :white_check_mark: | -| image_repo | Repository containing the source container image | quay.io/fedora-ostree-desktops | :white_check_mark: | :white_check_mark: | -| image_signed | Whether the container image is signed. The policy to test the signing must be configured inside the container image | true | :white_check_mark: | :white_check_mark: | -| image_src | Overrides the source of the container image. Must be formatted for the skopeo copy command | \[empty\] | :white_check_mark: | :white_check_mark: | -| image_tag | Tag of the source container image | *VERSION* | :white_check_mark: | :white_check_mark: | -| iso_name | Name of the ISO you wish to output when completed | build/deploy.iso | :white_check_mark: | :white_check_mark: | -| make_target | Overrides the default make target | *ISO_NAME*-Checksum | :white_check_mark: | :x: | -| repos | List of repo files for Lorax to use | /etc/yum.repos.d/*.repo | :white_check_mark: | :white_check_mark: | -| rootfs_size | The size (in GiB) for the squashfs runtime volume | 2 | :white_check_mark: | :white_check_mark: | -| secure_boot_key_url | Secure boot key that is installed from URL location\*\* | \[empty\] | :white_check_mark: | :white_check_mark: | -| variant | Source container variant\* | Server | :white_check_mark: | :white_check_mark: | -| version | Fedora version of installer to build | 39 | :white_check_mark: | :white_check_mark: | -| web_ui | Enable Anaconda WebUI (experimental) | false | :white_check_mark: | :white_check_mark: | - -\*Available options for VARIANT can be found by running `dnf provides system-release`. -Variant will be the third item in the package name. Example: `fedora-release-kinoite-39-34.noarch` will be kinoite - -\*\* If you need to reference a local file, you can use `file://*path*` - -### Outputs - -| Variable | Description | Usage | -| -------- | ----------------------------------------| ------------------------------------------------ | -| iso_name | The name of the resulting .iso | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_name }} | -| iso_path | The name and path of the resulting .iso | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_name }} | - -For outputs, see example above. - -## Development - -### Makefile - -The Makefile contains all commands that are run the action. 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. The resulting ISO will be stored in the `build` directory. - -You can use `make install-deps` to install the required packages. - -See [Customizing](#customizing) for information about customizing the ISO that gets created. All variables should be specified in CAPITALIZED form. - -### Container - -A container with `make install-deps` already run is provided at `ghcr.io/jasonn3/build-container-installer:latest` - -To use the container file, run `docker run --privileged --volume .:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:latest`. - -This will create an ISO with the baked in defaults of the container image. The resulting file will be called `deploy.iso` - -See [Customizing](#customizing) for information about customizing the ISO that gets created. All variables should be specified in CAPITALIZED form. -Examples: - -Building an ISO to install Fedora 38 - -```bash -docker run --rm --privileged --volume .:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:latest VERSION=38 IMAGE_NAME=base IMAGE_TAG=38 VARIANT=Server -``` - -Building an ISO to install Fedora 39 - -```bash -docker run --rm --privileged --volume .:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:latest VERSION=39 IMAGE_NAME=base IMAGE_TAG=39 VARIANT=Server -``` - -### VSCode Dev Container - -There is a dev container configuration provided for development. By default, it will use the existing container image available at `ghcr.io/jasonn3/build-container-installer:latest`. However, you can have it build a new image by editing `.devcontainer/devcontainer.json` and replacing `image` with `build`. `Ctrl+/` can be used to comment and uncomment blocks of code within VSCode. - -The code from VSCode will be available at `/workspaces/build-container-installer` once the container has started. - -Privileged is required for access to loop devices for lorax. - -Use existing container image: - -```diff -{ - "name": "Existing Image", -- "build": { -- "context": "..", -- "dockerfile": "../Containerfile", -- "args": { -- "version": "39" -- } -- }, -+ "image": "ghcr.io/jasonn3/build-container-installer:latest", - "overrideCommand": true, - "shutdownAction": "stopContainer", - "privileged": true -} -``` - -Build a new container image: - -```diff -{ - "name": "New Image", -+ "build": { -+ "context": "..", -+ "dockerfile": "../Containerfile", -+ "args": { -+ "version": "39" -+ } -+ }, -- "image": "ghcr.io/jasonn3/build-container-installer:latest", - "overrideCommand": true, - "shutdownAction": "stopContainer", - "privileged": true -} -``` ## Star History diff --git a/docs/Home.md b/docs/Home.md deleted file mode 100644 index f321463..0000000 --- a/docs/Home.md +++ /dev/null @@ -1,11 +0,0 @@ -Welcome to the build-container-installer wiki! - -## Index - -- Development - - [Using the Makefile](Development_Makefile) - - [Using the Container](Development_Container) - - [Using the VSCode Dev Container](Development_VSCode) - -- Examples - - [Adding Flatpaks](Examples_Adding-Flatpak) diff --git a/docs/Makefile b/docs/Makefile index 78dcdf4..9bfcf11 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -8,6 +8,6 @@ docs: mv "$${source_file}" "$${final_file}"; \ no_ext_source=$${source_file:0:-3}; \ no_ext_final=$${final_file:0:-3}; \ - sed -i "s;($${no_ext_source});($${no_ext_final});g" *.md; \ + sed -i "s;(\(../\)*$${source_file});($${no_ext_final});g" $$(find -name '*.md'); \ done find . -type d -empty -delete \ No newline at end of file diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..2091ec8 --- /dev/null +++ b/docs/README.md @@ -0,0 +1 @@ +These are the files for the [wiki](https://github.com/JasonN3/build-container-installer/wiki) \ No newline at end of file diff --git a/docs/_Sidebar.md b/docs/_Sidebar.md index 9d985ca..93379d1 100644 --- a/docs/_Sidebar.md +++ b/docs/_Sidebar.md @@ -1,8 +1,8 @@ -- [Home](Home) +- [Home](home.md) - Development - - [Using the Makefile](Development/Makefile) - - [Using the Container](Development/Container) - - [Using the VSCode Dev Container](Development/VSCode) + - [Using the Makefile](development/makefile.md) + - [Using the Container](development/container.md) + - [Using the VSCode Dev Container](development/vscode.md) - Examples - - [Adding Flatpaks](Examples/Adding-Flatpaks) + - [Adding Flatpaks](examples/adding-flatpaks.md) diff --git a/docs/Development/Container.md b/docs/development/container.md similarity index 81% rename from docs/Development/Container.md rename to docs/development/container.md index 8b7934d..29d4a7a 100644 --- a/docs/Development/Container.md +++ b/docs/development/container.md @@ -6,7 +6,7 @@ To use the container file, run `podman run --privileged --volume .:/build-contai This will create an ISO with the baked in defaults of the container image. The resulting file will be called `deploy.iso` -See [Customizing](#customizing) for information about customizing the ISO that gets created. The variables can be defined as environment variables or command arguments. All variables should be specified in CAPITALIZED form. +See [Inputs](../usage.md#inputs) for information about customizing the ISO that gets created. The variables can be defined as environment variables or command arguments. All variables should be specified in CAPITALIZED form. Examples: Building an ISO to install Fedora 39 diff --git a/docs/Development/Makefile.md b/docs/development/makefile.md similarity index 73% rename from docs/Development/Makefile.md rename to docs/development/makefile.md index 1e93e39..a94535e 100644 --- a/docs/Development/Makefile.md +++ b/docs/development/makefile.md @@ -4,4 +4,4 @@ The Makefile contains all the commands that are run in the action. There are sep `make install-deps` can be used to install the necessary packages. -See [Inputs](../#Inputs) for information about the available parameters. All variables should be specified in CAPITALIZED form. +See [Inputs](../usage.md#inputs) for information about the available parameters. All variables should be specified in CAPITALIZED form. diff --git a/docs/Development/VSCode.md b/docs/development/vscode.md similarity index 100% rename from docs/Development/VSCode.md rename to docs/development/vscode.md diff --git a/docs/Examples/Adding-Flatpaks.md b/docs/examples/adding-flatpaks.md similarity index 100% rename from docs/Examples/Adding-Flatpaks.md rename to docs/examples/adding-flatpaks.md diff --git a/docs/home.md b/docs/home.md new file mode 100644 index 0000000..6f88490 --- /dev/null +++ b/docs/home.md @@ -0,0 +1,11 @@ +Welcome to the build-container-installer wiki! + +## Index + +- Development + - [Using the Makefile](development/makefile.md) + - [Using the Container](development/container.md) + - [Using the VSCode Dev Container](development/vscode.md) + +- Examples + - [Adding Flatpaks](examples/adding-flatpaks.md) diff --git a/docs/usage.md b/docs/usage.md new file mode 100644 index 0000000..eb31549 --- /dev/null +++ b/docs/usage.md @@ -0,0 +1,70 @@ +# Usage + +This action is designed to be called from a GitHub workflow using the following format + +```yaml +- name: Build ISO + uses: jasonn3/build-container-installer@main + id: build + with: + arch: ${{ env.ARCH}} + image_name: ${{ env.IMAGE_NAME}} + image_repo: ${{ env.IMAGE_REPO}} + image_tag: ${{ env.IMAGE_TAG }} + version: ${{ env.VERSION }} + variant: ${{ env.VARIANT }} + iso_name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ env.VERSION }}.iso + +# This example is for uploading your ISO as a Github artifact. You can do something similar using any cloud storage, so long as you copy the output +- name: Upload ISO as artifact + id: upload + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.build.outputs.iso_name }} + path: | + ${{ steps.build.outputs.iso_path }} + ${{ steps.build.outputs.iso_path }}-CHECKSUM + if-no-files-found: error + retention-days: 0 + compression-level: 0 +``` + +## Inputs +| Variable | Description | Default Value | Action | Container/Makefile | +| ----------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------- | ------------------ | ------------------ | +| additional_templates | Space delimited list of additional Lorax templates to include | \[empty\] | :white_check_mark: | :white_check_mark: | +| arch | Architecture for image to build | x86_64 | :white_check_mark: | :white_check_mark: | +| enrollment_password | Used for supporting secure boot (requires SECURE_BOOT_KEY_URL to be defined) | container-installer | :white_check_mark: | :white_check_mark: | +| extra_boot_params | Extra params used by grub to boot the anaconda installer | \[empty\] | :white_check_mark: | :white_check_mark: | +| flatpak_remote_name | Name of the Flatpak repo on the destination OS | flathub | :white_check_mark: | :white_check_mark: | +| flatpak_remote_refs | Space separated list of flatpak refs to install | \[empty\] | :white_check_mark: | :white_check_mark: | +| flatpak_remote_refs_dir | Directory that contains files that list the flatpak refs to install | \[empty\] | :white_check_mark: | :white_check_mark: | +| flatpak_remote_url | URL of the flatpakrepo file | | :white_check_mark: | :white_check_mark: | +| image_name | Name of the source container image | base | :white_check_mark: | :white_check_mark: | +| image_repo | Repository containing the source container image | quay.io/fedora-ostree-desktops | :white_check_mark: | :white_check_mark: | +| image_signed | Whether the container image is signed. The policy to test the signing must be configured inside the container image | true | :white_check_mark: | :white_check_mark: | +| image_src | Overrides the source of the container image. Must be formatted for the skopeo copy command | \[empty\] | :white_check_mark: | :white_check_mark: | +| image_tag | Tag of the source container image | *VERSION* | :white_check_mark: | :white_check_mark: | +| iso_name | Name of the ISO you wish to output when completed | build/deploy.iso | :white_check_mark: | :white_check_mark: | +| make_target | Overrides the default make target | *ISO_NAME*-Checksum | :white_check_mark: | :x: | +| repos | List of repo files for Lorax to use | /etc/yum.repos.d/*.repo | :white_check_mark: | :white_check_mark: | +| rootfs_size | The size (in GiB) for the squashfs runtime volume | 2 | :white_check_mark: | :white_check_mark: | +| secure_boot_key_url | Secure boot key that is installed from URL location\*\* | \[empty\] | :white_check_mark: | :white_check_mark: | +| variant | Source container variant\* | Server | :white_check_mark: | :white_check_mark: | +| version | Fedora version of installer to build | 39 | :white_check_mark: | :white_check_mark: | +| web_ui | Enable Anaconda WebUI (experimental) | false | :white_check_mark: | :white_check_mark: | + + +\*Available options for VARIANT can be found by running `dnf provides system-release`. +Variant will be the third item in the package name. Example: `fedora-release-kinoite-39-34.noarch` will be kinoite + +\*\* If you need to reference a local file, you can use `file://*path*` + + + +## Outputs + +| Variable | Description | Usage | +| -------- | ----------------------------------------| ------------------------------------------------ | +| iso_name | The name of the resulting .iso | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_name }} | +| iso_path | The name and path of the resulting .iso | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_name }} | \ No newline at end of file