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

Copy Wiki from main repo #128

Merged
merged 33 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e0c8880
copy wiki from main repo
JasonN3 Jul 9, 2024
9d426b5
set branch
JasonN3 Jul 9, 2024
945607b
include workflow itself
JasonN3 Jul 9, 2024
8bf355e
missing curly brace
JasonN3 Jul 9, 2024
b67043a
checkout main repo
JasonN3 Jul 9, 2024
65e87a5
missing end curly brace
JasonN3 Jul 9, 2024
395ed5f
only update for main
JasonN3 Jul 9, 2024
8452800
show what would be found
JasonN3 Jul 9, 2024
67d033a
any branch during testing
JasonN3 Jul 9, 2024
ae57d3e
reverse command
JasonN3 Jul 9, 2024
ab48a37
rename file
JasonN3 Jul 9, 2024
c4051d7
remove extra quotes
JasonN3 Jul 9, 2024
a5f0fd3
add echo
JasonN3 Jul 9, 2024
f9e8302
set to bash
JasonN3 Jul 9, 2024
ca9e034
replace in files
JasonN3 Jul 9, 2024
5e3f189
wrap lines
JasonN3 Jul 9, 2024
0179c97
escape
JasonN3 Jul 9, 2024
6f9a2e0
use semicolons instead
JasonN3 Jul 9, 2024
8fc8681
only remove extension
JasonN3 Jul 9, 2024
9a68f88
remove escaping
JasonN3 Jul 9, 2024
8d32784
missing s
JasonN3 Jul 9, 2024
2a32fba
remove empty directories
JasonN3 Jul 9, 2024
c8d7beb
cleanup debug
JasonN3 Jul 9, 2024
87cb3f1
limit to main
JasonN3 Jul 9, 2024
37ce02c
Apply suggestions from code review
JasonN3 Jul 9, 2024
926b721
more fixes
JasonN3 Jul 9, 2024
f7ac8aa
grammar
JasonN3 Jul 9, 2024
05b44b8
Apply suggestions from code review
JasonN3 Jul 9, 2024
c575461
add fixes
JasonN3 Jul 9, 2024
1efd5f3
move docs to wiki
JasonN3 Aug 20, 2024
f5d3369
fixes
JasonN3 Aug 20, 2024
6349427
use xargs and add usage example
JasonN3 Aug 21, 2024
78fd604
Merge branch 'main' into wiki
JasonN3 Aug 21, 2024
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
50 changes: 50 additions & 0 deletions .github/workflows/update_wiki.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Update Wiki
on:
push:
branches:
- main
paths:
- 'docs/**'
- '.github/workflows/update_wiki.yml'

jobs:
update-wiki:
name: Update Wiki
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Install packages
run: |
apt install -y make rsync
# Checkout Main Repo
- uses: actions/checkout@v2

# Checkout Wiki Repo
- uses: actions/checkout@v2
with:
repository: ${{github.repository}}.wiki
persist-credentials: true
path: wiki
ref: master

# Generate final files
- name: Generate Files
run: |
cd ${GITHUB_WORKSPACE}/docs
make

# Copy Docs
- name: Copy files
run: |
rsync -av --exclude='.git/*' ${GITHUB_WORKSPACE}/docs/ ${GITHUB_WORKSPACE}/wiki/

# Push Changes
- name: Push changes
run: |
cd ${GITHUB_WORKSPACE}/wiki/
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Add changes"
git push
126 changes: 2 additions & 124 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# 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 supports bootc.

## Usage

Expand Down Expand Up @@ -36,130 +36,8 @@ This action is designed to be called from a GitHub workflow using the following
compression-level: 0
```

See [Customizing](#customizing) for information about customizing the ISO that gets created using `with`
**See the [Wiki](https://github.com/JasonN3/build-container-installer/wiki) for development and usage information.**
JasonN3 marked this conversation as resolved.
Show resolved Hide resolved

## 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 | <https://flathub.org/repo/flathub.flatpakrepo> | :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

Expand Down
12 changes: 12 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
SHELL = /bin/bash

docs:
find -name '*.md' -print0 | xargs -0 -I {} bash -c ' \
source_file=$${1:2}; \
final_file=$${source_file//\//_}; \
mv "$${source_file}" "$${final_file}"; \
no_ext_source=$${source_file:0:-3}; \
no_ext_final=$${final_file:0:-3}; \
sed -i "s;(\(../\)*$${source_file});($${no_ext_final});g" $$(find -name '*.md'); \
' _ {}
find . -type d -empty -delete
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
These are the files for the [wiki](https://github.com/JasonN3/build-container-installer/wiki)
8 changes: 8 additions & 0 deletions docs/_Sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- [Home](home.md)
- 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)
22 changes: 22 additions & 0 deletions docs/development/container.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Using the 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 `podman 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 [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
```bash
podman 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
```

Building an ISO to install Fedora 40
```bash
podman run --rm --privileged --volume .:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:latest VERSION=40 IMAGE_NAME=base IMAGE_TAG=40 VARIANT=Server
```

The same commands are also available using `docker` by replacing `podman` with `docker` in each command.
7 changes: 7 additions & 0 deletions docs/development/makefile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Using the Makefile

The Makefile contains all the commands that are run in 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.

`make install-deps` can be used to install the necessary packages.

See [Inputs](../usage.md#inputs) for information about the available parameters. All variables should be specified in CAPITALIZED form.
46 changes: 46 additions & 0 deletions docs/development/vscode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Using the 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
}
```

74 changes: 74 additions & 0 deletions docs/examples/adding-flatpaks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Adding Flatpaks

- [Directly using refs](#directly-using-refs)
- [Using a directory](#using-a-directory)

## Directly using refs

Action:
Specify the following in your workflow:

```yaml
- name: Build ISO
uses: jasonn3/build-container-installer@main
id: build
with:
flatpak_remote_name: flathub
flatpak_remote_url: https://flathub.org/repo/flathub.flatpakrepo
flatpak_remote_refs: app/org.videolan.VLC/x86_64/stable runtime/org.kde.Platform/x86_64/5.15-23.08
```

Podman:
Run the following command:

```bash
podman run --privileged --volume ./:/github/workspace/ ghcr.io/jasonn3/build-container-installer:main \
FLATPAK_REMOTE_NAME=flathub \
FLATPAK_REMOTE_URL=https://flathub.org/repo/flathub.flatpakrepo \
FLATPAK_REMOTE_REFS="app/org.videolan.VLC/x86_64/stable runtime/org.kde.Platform/x86_64/5.15-23.08"
```

---

## Using a directory

Action:

1. Create a directory within your GitHub repo named flatpak_refs
1. Create a file within flatpak_refs with the following content

```plaintext
app/org.videolan.VLC/x86_64/stable
runtime/org.kde.Platform/x86_64/5.15-23.08
```

Specify the following in your workflow:

```yaml
- name: Build ISO
uses: jasonn3/build-container-installer@main
id: build
with:
flatpak_remote_name: flathub
flatpak_remote_url: https://flathub.org/repo/flathub.flatpakrepo
flatpak_remote_refs_dir: /github/workspace/flatpak_refs
```

Podman:

1. Create a directory named flatpak_refs
1. Create a file within flatpak_refs with the following content

```plaintext
app/org.videolan.VLC/x86_64/stable
runtime/org.kde.Platform/x86_64/5.15-23.08
```

Run the following command:

```bash
podman run --privileged --volume ./:/github/workspace/ ghcr.io/jasonn3/build-container-installer:main \
FLATPAK_REMOTE_NAME=flathub \
FLATPAK_REMOTE_URL=https://flathub.org/repo/flathub.flatpakrepo \
FLATPAK_REMOTE_REFS="app/org.videolan.VLC/x86_64/stable runtime/org.kde.Platform/x86_64/5.15-23.08"
```
11 changes: 11 additions & 0 deletions docs/home.md
Original file line number Diff line number Diff line change
@@ -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)
Loading