From e0c888058b1000b0a7e3bfaa7494f50f1c310c39 Mon Sep 17 00:00:00 2001 From: Jason Nagin <33561705+JasonN3@users.noreply.github.com> Date: Tue, 9 Jul 2024 09:33:52 -0400 Subject: [PATCH] copy wiki from main repo --- .github/workflows/update_wiki.yml | 32 +++++++++++++++++ docs/Development_Container.md | 22 ++++++++++++ docs/Development_Makefile.md | 7 ++++ docs/Development_VSCode.md | 43 +++++++++++++++++++++++ docs/Examples_Adding-Flatpaks.md | 58 +++++++++++++++++++++++++++++++ docs/Home.md | 11 ++++++ docs/_Sidebar.md | 8 +++++ 7 files changed, 181 insertions(+) create mode 100644 .github/workflows/update_wiki.yml create mode 100644 docs/Development_Container.md create mode 100644 docs/Development_Makefile.md create mode 100644 docs/Development_VSCode.md create mode 100644 docs/Examples_Adding-Flatpaks.md create mode 100644 docs/Home.md create mode 100644 docs/_Sidebar.md diff --git a/.github/workflows/update_wiki.yml b/.github/workflows/update_wiki.yml new file mode 100644 index 0000000..957c3b1 --- /dev/null +++ b/.github/workflows/update_wiki.yml @@ -0,0 +1,32 @@ +name: Update Wiki +on: + push: + paths: + - 'docs/**' + +jobs: + update-wiki: + name: Update Wiki + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Install rsync + run: | + sudo apt install -y rsync + - uses: actions/checkout@v2 + with: + repository: ${{github.repository}}.wiki + persist-credentials: true + path: wiki + - name: Copy files + run: | + rsync -av --exclude=.git/* ${GITHUB_WORKSPACE}/docs/ ${GITHUB_WORKSPACE/wiki/ + - name: Push changes + run: | + cd ${GITHUB_WORKSPACE/wiki/ + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git commit -m "Add changes" + git push \ No newline at end of file diff --git a/docs/Development_Container.md b/docs/Development_Container.md new file mode 100644 index 0000000..f75b9f4 --- /dev/null +++ b/docs/Development_Container.md @@ -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 [Customizing](#customizing) for information about customizing the ISO that gets created. The variable can either be defined as environment variables. All variable should be specified CAPITALIZED. +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. diff --git a/docs/Development_Makefile.md b/docs/Development_Makefile.md new file mode 100644 index 0000000..b41c66b --- /dev/null +++ b/docs/Development_Makefile.md @@ -0,0 +1,7 @@ +# Using the Makefile + +The Makefile contains all of 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](./..#Inputs) for information about the available parameters. All variable should be specified CAPITALIZED. diff --git a/docs/Development_VSCode.md b/docs/Development_VSCode.md new file mode 100644 index 0000000..661727e --- /dev/null +++ b/docs/Development_VSCode.md @@ -0,0 +1,43 @@ +# 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: +``` +{ + "name": "Existing Dockerfile", +// "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: +``` +{ + "name": "Existing Dockerfile", + "build": { + "context": "..", + "dockerfile": "../Containerfile", + "args": { + "version": "39" + } + }, + //"image": "ghcr.io/jasonn3/build-container-installer:latest", + "overrideCommand": true, + "shutdownAction": "stopContainer", + "privileged": true +} +``` diff --git a/docs/Examples_Adding-Flatpaks.md b/docs/Examples_Adding-Flatpaks.md new file mode 100644 index 0000000..a85ebab --- /dev/null +++ b/docs/Examples_Adding-Flatpaks.md @@ -0,0 +1,58 @@ +# 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 +``` +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 +``` +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" +``` diff --git a/docs/Home.md b/docs/Home.md new file mode 100644 index 0000000..f321463 --- /dev/null +++ b/docs/Home.md @@ -0,0 +1,11 @@ +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/_Sidebar.md b/docs/_Sidebar.md new file mode 100644 index 0000000..8c08b51 --- /dev/null +++ b/docs/_Sidebar.md @@ -0,0 +1,8 @@ +- [Home](Home) +- Development + - [Using the Makefile](Development_Makefile) + - [Using the Container](Development_Container) + - [Using the VSCode Dev Container](Development_VSCode) + +- Examples + - [Adding Flatpaks](Examples_Adding-Flatpak)