mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
Compare commits
91 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ab1e18f83 | ||
|
|
c9ef3de332 | ||
|
|
e310904cc7 | ||
|
|
33d0e5a5c2 | ||
|
|
3b090e7c2e | ||
|
|
6810b148ad | ||
|
|
d77e956373 | ||
|
|
91208e0329 | ||
|
|
45fec1fc9d | ||
|
|
d2186329e4 | ||
|
|
46786df344 | ||
|
|
362fea7d5d | ||
|
|
f09a756b7a | ||
|
|
e80a97fbb0 | ||
|
|
312375b2cd | ||
|
|
ec2a9f4e3f | ||
|
|
a1ce6da2d6 | ||
|
|
f9395d5ae1 | ||
|
|
0180c50030 | ||
|
|
237ff3e130 | ||
|
|
f10dd64668 | ||
|
|
54d9614590 | ||
|
|
aa74d32215 | ||
|
|
f98ebd1420 | ||
|
|
776a9a7e98 | ||
|
|
ceccfc98ef | ||
|
|
909d1a1bd8 | ||
|
|
edf9c39029 | ||
|
|
92531089f9 | ||
|
|
2b91de5959 | ||
|
|
326734dccb | ||
|
|
03ed84acd8 | ||
|
|
19c4aae2f2 | ||
|
|
3d7e6b3725 | ||
|
|
e0e4de8f9a | ||
|
|
383427c619 | ||
|
|
ee3a60c6a1 | ||
|
|
6e803c8fcb | ||
|
|
575e169bf9 | ||
|
|
80921040ca | ||
|
|
8346576816 | ||
|
|
02c3b10f56 | ||
|
|
b669420287 | ||
|
|
662f1a94e4 | ||
|
|
7e04293093 | ||
|
|
2c44ea7043 | ||
|
|
bcc5ae23a1 | ||
|
|
7311a1d4c8 | ||
|
|
5d818dc7f1 | ||
|
|
41e2ae1242 | ||
|
|
e514eda574 | ||
|
|
1c3069fbf3 | ||
|
|
1de61a8083 | ||
|
|
b5c953d8d3 | ||
|
|
f2305bbaf8 | ||
|
|
fadeb6fffb | ||
|
|
8196066a63 | ||
|
|
2a907a79c3 | ||
|
|
12d7515a8b | ||
|
|
d24a21a449 | ||
|
|
e8288bd5a9 | ||
|
|
4ae1721311 | ||
|
|
3b58e69ec4 | ||
|
|
c1c16f6420 | ||
|
|
a4afd2efe6 | ||
|
|
5ee3e3cb8f | ||
|
|
bcfbc02ded | ||
|
|
3d85c93010 | ||
|
|
3dc05c0efc | ||
|
|
10524ae6ea | ||
|
|
4ae7d1893c | ||
|
|
bbac3469b1 | ||
|
|
6f1f78fa89 | ||
|
|
4fac21d55f | ||
|
|
f4fd87855a | ||
|
|
4710f3002d | ||
|
|
2d28aec740 | ||
|
|
13bbd2a24d | ||
|
|
df936e3365 | ||
|
|
c3dfff5c5b | ||
|
|
bfa150ceeb | ||
|
|
54d89036fb | ||
|
|
0b68c00dcf | ||
|
|
5ea604d405 | ||
|
|
8746fd7f0d | ||
|
|
8d9ceeb579 | ||
|
|
ef90875a1c | ||
|
|
17927f37f8 | ||
|
|
38f41f7acc | ||
|
|
c4a0406395 | ||
|
|
41838b9ab6 |
73 changed files with 2486 additions and 360 deletions
2
.codacy/markdownlint.rb
Normal file
2
.codacy/markdownlint.rb
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
all
|
||||||
|
rule 'MD033', :allowed_elements => ["a","img","picture","source"]
|
||||||
5
.dockerignore
Normal file
5
.dockerignore
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
.devcontainer
|
||||||
|
.github
|
||||||
|
.gitignore
|
||||||
|
action.yml
|
||||||
|
Containerfile
|
||||||
6
.github/ISSUE_TEMPLATE/bug_report.md
vendored
6
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
|
@ -12,6 +12,7 @@ A clear and concise description of what the bug is.
|
||||||
|
|
||||||
**To Reproduce**
|
**To Reproduce**
|
||||||
Steps to reproduce the behavior:
|
Steps to reproduce the behavior:
|
||||||
|
|
||||||
1. Go to '...'
|
1. Go to '...'
|
||||||
2. Click on '....'
|
2. Click on '....'
|
||||||
3. Scroll down to '....'
|
3. Scroll down to '....'
|
||||||
|
|
@ -24,8 +25,9 @@ A clear and concise description of what you expected to happen.
|
||||||
If applicable, add screenshots to help explain your problem.
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
**Desktop (please complete the following information):**
|
**Desktop (please complete the following information):**
|
||||||
- OS: [e.g. iOS]
|
|
||||||
- Version [e.g. 22]
|
- OS: [e.g. iOS]
|
||||||
|
- Version [e.g. 22]
|
||||||
|
|
||||||
**Additional context**
|
**Additional context**
|
||||||
Add any other context about the problem here.
|
Add any other context about the problem here.
|
||||||
|
|
|
||||||
17
.github/dependabot.yml
vendored
Normal file
17
.github/dependabot.yml
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
# To get started with Dependabot version updates, you'll need to specify which
|
||||||
|
# package ecosystems to update and where the package manifests are located.
|
||||||
|
# Please see the documentation for all configuration options:
|
||||||
|
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions" # See documentation for possible values
|
||||||
|
directory: "/" # Location of package manifests
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
- package-ecosystem: "github-actions" # See documentation for possible values
|
||||||
|
directory: "/external" # Location of package manifests
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
ignore:
|
||||||
|
- dependency-name: "lorax"
|
||||||
105
.github/workflows/bot_commands.yml
vendored
Normal file
105
.github/workflows/bot_commands.yml
vendored
Normal file
|
|
@ -0,0 +1,105 @@
|
||||||
|
name: Bot commands
|
||||||
|
on: issue_comment
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
permissions:
|
||||||
|
name: Check Permissions
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check association
|
||||||
|
run: |
|
||||||
|
allowed=("OWNER" "COLLABORATOR")
|
||||||
|
value="\<${{ github.event.issue.author_association }}\>"
|
||||||
|
|
||||||
|
if [[ ${allowed[@]} =~ $value ]]
|
||||||
|
then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
load_vars:
|
||||||
|
uses: ./.github/workflows/build_vars.yml
|
||||||
|
|
||||||
|
run-all_tests:
|
||||||
|
name: Run All Tests
|
||||||
|
if: >
|
||||||
|
github.event.issue.pull_request &&
|
||||||
|
contains(github.event.comment.body, '/run tests')
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
statuses: write
|
||||||
|
needs:
|
||||||
|
- permissions
|
||||||
|
uses: ./.github/workflows/tests.yml
|
||||||
|
with:
|
||||||
|
pr: ${{ github.event.issue.number }}
|
||||||
|
parent_job_name: Run All Tests
|
||||||
|
|
||||||
|
run_build_container:
|
||||||
|
name: Run Build Container
|
||||||
|
if: >
|
||||||
|
github.event.issue.pull_request &&
|
||||||
|
contains(github.event.comment.body, '/run build container')
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
statuses: write
|
||||||
|
needs:
|
||||||
|
- permissions
|
||||||
|
uses: ./.github/workflows/build_container.yml
|
||||||
|
with:
|
||||||
|
pr: ${{ github.event.issue.number }}
|
||||||
|
parent_job_name: Run Build Container
|
||||||
|
|
||||||
|
run_build_iso:
|
||||||
|
name: Run Build ISO
|
||||||
|
if: >
|
||||||
|
github.event.issue.pull_request &&
|
||||||
|
contains(github.event.comment.body, '/run build iso')
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
statuses: write
|
||||||
|
needs:
|
||||||
|
- permissions
|
||||||
|
uses: ./.github/workflows/build_iso.yml
|
||||||
|
with:
|
||||||
|
pr: ${{ github.event.issue.number }}
|
||||||
|
parent_job_name: Run Build ISO
|
||||||
|
|
||||||
|
run_test_iso:
|
||||||
|
name: Run ISO Tests
|
||||||
|
if: >
|
||||||
|
github.event.issue.pull_request &&
|
||||||
|
contains(github.event.comment.body, '/run test iso')
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
statuses: write
|
||||||
|
needs:
|
||||||
|
- permissions
|
||||||
|
- load_vars
|
||||||
|
uses: ./.github/workflows/test_iso.yml
|
||||||
|
with:
|
||||||
|
pr: ${{ github.event.issue.number }}
|
||||||
|
parent_job_name: Run ISO Tests
|
||||||
|
|
||||||
|
run_test_deployment:
|
||||||
|
name: Run ISO Deployment Tests
|
||||||
|
if: >
|
||||||
|
github.event.issue.pull_request &&
|
||||||
|
contains(github.event.comment.body, '/run test iso')
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
statuses: write
|
||||||
|
needs:
|
||||||
|
- permissions
|
||||||
|
- load_vars
|
||||||
|
- run_test_iso
|
||||||
|
uses: ./.github/workflows/test_deployment.yml
|
||||||
|
with:
|
||||||
|
pr: ${{ github.event.issue.number }}
|
||||||
|
parent_job_name: Run ISO Deployment Tests
|
||||||
104
.github/workflows/build-and-test.yml
vendored
104
.github/workflows/build-and-test.yml
vendored
|
|
@ -1,104 +0,0 @@
|
||||||
name: Create and publish an ISO
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
# Test Values
|
|
||||||
env:
|
|
||||||
ARCH: 'x86_64'
|
|
||||||
IMAGE_NAME: 'base'
|
|
||||||
IMAGE_REPO: 'quay.io/fedora-ostree-desktops'
|
|
||||||
VERSION: '39'
|
|
||||||
VARIANT: 'Server'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-container:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
ghcr.io/${{ github.repository }}
|
|
||||||
tags: |
|
|
||||||
type=ref,event=branch
|
|
||||||
type=ref,event=pr
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
|
|
||||||
- name: Buildah Build
|
|
||||||
id: build-image
|
|
||||||
uses: redhat-actions/buildah-build@v2
|
|
||||||
with:
|
|
||||||
containerfiles: Containerfile
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
|
|
||||||
- name: Push image
|
|
||||||
uses: redhat-actions/push-to-registry@v2
|
|
||||||
with:
|
|
||||||
image: ${{ steps.build-image.outputs.image }}
|
|
||||||
tags: ${{ steps.build-image.outputs.tags }}
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ github.token }}
|
|
||||||
|
|
||||||
|
|
||||||
build-and-push-iso:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs:
|
|
||||||
- build-container
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Lowercase Registry
|
|
||||||
id: registry_case
|
|
||||||
uses: ASzc/change-string-case-action@v6
|
|
||||||
with:
|
|
||||||
string: ${{ env.IMAGE_REPO }}
|
|
||||||
|
|
||||||
- name: Get image version
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
tags: |
|
|
||||||
type=ref,event=branch
|
|
||||||
type=ref,event=pr
|
|
||||||
|
|
||||||
- name: Build ISO
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
arch: ${{ env.ARCH}}
|
|
||||||
image_name: ${{ env.IMAGE_NAME}}
|
|
||||||
image_repo: ${{ env.IMAGE_REPO}}
|
|
||||||
version: ${{ env.VERSION }}
|
|
||||||
variant: ${{ env.VARIANT }}
|
|
||||||
action_version: ${{ steps.meta.outputs.tags || 'latest' }}
|
|
||||||
|
|
||||||
- name: Rename ISO
|
|
||||||
run: |
|
|
||||||
mv build/deploy.iso build/${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso
|
|
||||||
|
|
||||||
- name: Upload ISO as artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso
|
|
||||||
path: build/*.iso
|
|
||||||
if-no-files-found: error
|
|
||||||
retention-days: 0
|
|
||||||
compression-level: 0
|
|
||||||
overwrite: true
|
|
||||||
144
.github/workflows/build_container.yml
vendored
Normal file
144
.github/workflows/build_container.yml
vendored
Normal file
|
|
@ -0,0 +1,144 @@
|
||||||
|
name: Build Container
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
pr:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
parent_job_name:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-container:
|
||||||
|
if: >
|
||||||
|
github.event_name == 'push' ||
|
||||||
|
github.event_name == 'issue_comment' ||
|
||||||
|
github.event_name == 'workflow_dispatch'
|
||||||
|
name: Build Container Image
|
||||||
|
env:
|
||||||
|
JOB_NAME: Build Container Image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
statuses: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
fetch-depth: 0
|
||||||
|
fetch-tags: 'true'
|
||||||
|
|
||||||
|
- name: Switch branch
|
||||||
|
if: inputs.pr
|
||||||
|
env:
|
||||||
|
GITHUB_USER: ${{ github.actor }}
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y hub
|
||||||
|
hub pr checkout ${{ inputs.pr }}
|
||||||
|
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Get Current Job Log URL
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: Tiryoh/gha-jobid-action@v1
|
||||||
|
id: jobs
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
job_name: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }}"
|
||||||
|
per_page: 100
|
||||||
|
|
||||||
|
- name: Set status
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: myrotvorets/set-commit-status-action@v2.0.1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
status: pending
|
||||||
|
context: ${{ env.JOB_NAME }}
|
||||||
|
sha: ${{ env.sha }}
|
||||||
|
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||||
|
|
||||||
|
- name: Docker meta
|
||||||
|
if: inputs.pr == ''
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
ghcr.io/${{ github.repository }}
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
type=raw,value=${{ github.sha }}
|
||||||
|
type=semver,pattern=v{{version}}
|
||||||
|
type=semver,pattern=v{{major}}.{{minor}}
|
||||||
|
type=semver,pattern=v{{major}}.{{minor}}.{{patch}}
|
||||||
|
|
||||||
|
- name: Docker meta for PR
|
||||||
|
if: inputs.pr
|
||||||
|
id: meta_pr
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
ghcr.io/${{ github.repository }}
|
||||||
|
tags: |
|
||||||
|
pr-${{ inputs.pr }}
|
||||||
|
${{ github.sha }}
|
||||||
|
|
||||||
|
- name: Buildah Build
|
||||||
|
id: build-image
|
||||||
|
uses: redhat-actions/buildah-build@v2
|
||||||
|
with:
|
||||||
|
containerfiles: Containerfile
|
||||||
|
tags: ${{ steps.meta.outputs.tags || steps.meta_pr.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels || steps.meta_pr.outputs.labels }}
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3.6.0
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Push image
|
||||||
|
uses: redhat-actions/push-to-registry@v2
|
||||||
|
with:
|
||||||
|
image: ${{ steps.build-image.outputs.image }}
|
||||||
|
tags: ${{ steps.build-image.outputs.tags }}
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Set status
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: myrotvorets/set-commit-status-action@v2.0.1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
status: ${{ job.status }}
|
||||||
|
context: ${{ env.JOB_NAME }}
|
||||||
|
sha: ${{ env.sha }}
|
||||||
|
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||||
|
|
||||||
|
- name: Install Cosign
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
uses: sigstore/cosign-installer@v3.10.0
|
||||||
|
|
||||||
|
- name: Sign the images
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
env:
|
||||||
|
TAGS: ${{ steps.build-image.outputs.tags }}
|
||||||
|
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
|
||||||
|
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
|
||||||
|
run: |
|
||||||
|
images=""
|
||||||
|
digest=""
|
||||||
|
for tag in ${TAGS}; do
|
||||||
|
if [[ -z "${digest}" ]]
|
||||||
|
then
|
||||||
|
digest=$(cat $(echo ${tag} | tr '/:' '--')_digest.txt)
|
||||||
|
fi
|
||||||
|
images+="${tag}@${digest} "
|
||||||
|
done
|
||||||
|
cosign sign --key env://COSIGN_PRIVATE_KEY --yes ${images}
|
||||||
144
.github/workflows/build_iso.yml
vendored
Normal file
144
.github/workflows/build_iso.yml
vendored
Normal file
|
|
@ -0,0 +1,144 @@
|
||||||
|
name: Build ISO
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
pr:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
parent_job_name:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
load_vars:
|
||||||
|
name: Load Variables
|
||||||
|
uses: ./.github/workflows/build_vars.yml
|
||||||
|
|
||||||
|
build_iso:
|
||||||
|
name: Build ISO
|
||||||
|
env:
|
||||||
|
JOB_NAME: Build ISO
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- load_vars
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
statuses: write
|
||||||
|
continue-on-error: false
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix: ${{ fromJson(needs.load_vars.outputs.BUILD_MATRIX) }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Switch branch
|
||||||
|
if: inputs.pr
|
||||||
|
env:
|
||||||
|
GITHUB_USER: ${{ github.actor }}
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y hub
|
||||||
|
hub pr checkout ${{ inputs.pr }}
|
||||||
|
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Get Current Job Log URL
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: Tiryoh/gha-jobid-action@v1
|
||||||
|
id: jobs
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
job_name: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }})"
|
||||||
|
per_page: 100
|
||||||
|
|
||||||
|
- name: Set status
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: myrotvorets/set-commit-status-action@v2.0.1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
status: pending
|
||||||
|
context: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }})"
|
||||||
|
sha: ${{ env.sha }}
|
||||||
|
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||||
|
|
||||||
|
- name: Free Disk Space (Ubuntu)
|
||||||
|
uses: jlumbroso/free-disk-space@main
|
||||||
|
with:
|
||||||
|
# this might remove tools that are actually needed,
|
||||||
|
# if set to "true" but frees about 6 GB
|
||||||
|
tool-cache: false
|
||||||
|
|
||||||
|
# all of these default to true, but feel free to set to
|
||||||
|
# "false" if necessary for your workflow
|
||||||
|
android: true
|
||||||
|
dotnet: true
|
||||||
|
haskell: true
|
||||||
|
large-packages: true
|
||||||
|
docker-images: true
|
||||||
|
swap-storage: true
|
||||||
|
|
||||||
|
- name: Lowercase Registry
|
||||||
|
id: registry_case
|
||||||
|
uses: ASzc/change-string-case-action@v6
|
||||||
|
with:
|
||||||
|
string: ${{ needs.load_vars.outputs.IMAGE_REPO }}
|
||||||
|
|
||||||
|
- name: Get image version
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
|
||||||
|
- name: Login to Registry
|
||||||
|
run: |
|
||||||
|
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
|
|
||||||
|
- name: Build ISO
|
||||||
|
uses: ./
|
||||||
|
id: build
|
||||||
|
with:
|
||||||
|
arch: ${{ needs.load_vars.outputs.ARCH }}
|
||||||
|
image_name: ${{ matrix.image_name }}
|
||||||
|
image_repo: ${{ matrix.image_repo}}
|
||||||
|
image_src: ${{ matrix.image_src }}
|
||||||
|
image_tag: ${{ matrix.version }}
|
||||||
|
version: ${{ matrix.version }}
|
||||||
|
repos: ${{ matrix.repos }}
|
||||||
|
variant: ${{ needs.load_vars.outputs.VARIANT }}
|
||||||
|
flatpak_remote_refs: ${{ matrix.flatpaks == 'flatpak_refs' && needs.load_vars.outputs.FLATPAK_REMOTE_REFS || '' }}
|
||||||
|
flatpak_remote_refs_dir: ${{ matrix.flatpaks == 'flatpak_refs_dir' && needs.load_vars.outputs.FLATPAK_REMOTE_REFS_DIR || '' }}
|
||||||
|
secure_boot_key_url: ${{ needs.load_vars.outputs.SECURE_BOOT_KEY_URL }}
|
||||||
|
enrollment_password: ${{ needs.load_vars.outputs.ENROLLMENT_PASSWORD }}
|
||||||
|
iso_name: build/${{ matrix.image_name }}-${{ matrix.version }}${{ matrix.flatpaks == 'false' && '' || format('-{0}', matrix.flatpaks) }}.iso
|
||||||
|
|
||||||
|
- name: Upload ISO as artifact
|
||||||
|
if: matrix.version != 'fake'
|
||||||
|
id: upload
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.image_name }}-${{ matrix.version }}${{ matrix.flatpaks == 'false' && '' || format('-{0}', matrix.flatpaks) }}
|
||||||
|
path: |
|
||||||
|
build/${{ matrix.image_name }}-${{ matrix.version }}${{ matrix.flatpaks == 'false' && '' || format('-{0}', matrix.flatpaks) }}.iso
|
||||||
|
build/${{ matrix.image_name }}-${{ matrix.version }}${{ matrix.flatpaks == 'false' && '' || format('-{0}', matrix.flatpaks) }}.iso-CHECKSUM
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 0
|
||||||
|
compression-level: 0
|
||||||
|
overwrite: true
|
||||||
|
|
||||||
|
- name: Set status
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: myrotvorets/set-commit-status-action@v2.0.1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
status: ${{ job.status }}
|
||||||
|
context: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }})"
|
||||||
|
sha: ${{ env.sha }}
|
||||||
|
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||||
|
|
||||||
82
.github/workflows/build_vars.yml
vendored
Normal file
82
.github/workflows/build_vars.yml
vendored
Normal file
|
|
@ -0,0 +1,82 @@
|
||||||
|
name: Build Vars
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
outputs:
|
||||||
|
ARCH:
|
||||||
|
value: 'x86_64'
|
||||||
|
BUILD_MATRIX:
|
||||||
|
value: '
|
||||||
|
{
|
||||||
|
"version": [
|
||||||
|
"41",
|
||||||
|
"42",
|
||||||
|
"43"
|
||||||
|
],
|
||||||
|
"flatpaks": [
|
||||||
|
"false",
|
||||||
|
"flatpak_refs_dir",
|
||||||
|
"flatpak_refs"
|
||||||
|
],
|
||||||
|
"image_repo": [
|
||||||
|
"ghcr.io/ublue-os",
|
||||||
|
"quay.io/fedora",
|
||||||
|
"quay.io/fedora-ostree-desktops"
|
||||||
|
],
|
||||||
|
"include": [
|
||||||
|
{
|
||||||
|
"image_repo": "ghcr.io/ublue-os",
|
||||||
|
"image_name": "base-main",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image_repo": "quay.io/fedora",
|
||||||
|
"image_name": "fedora-bootc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image_repo": "quay.io/fedora-ostree-desktops",
|
||||||
|
"image_name": "base-atomic"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
{
|
||||||
|
"image_repo": "quay.io/fedora",
|
||||||
|
"flatpaks": "flatpak_refs_dir"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image_repo": "quay.io/fedora",
|
||||||
|
"flatpaks": "flatpak_refs"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image_repo": "quay.io/fedora-ostree-desktops",
|
||||||
|
"flatpaks": "flatpak_refs_dir"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image_repo": "quay.io/fedora-ostree-desktops",
|
||||||
|
"flatpaks": "flatpak_refs"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image_repo": "ghcr.io/ublue-os",
|
||||||
|
"version": "43"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}'
|
||||||
|
VARIANT:
|
||||||
|
value: 'Server'
|
||||||
|
FLATPAK_REMOTE_REFS_DIR:
|
||||||
|
value: flatpak_refs
|
||||||
|
FLATPAK_REMOTE_REFS:
|
||||||
|
value: "app/org.mozilla.firefox/x86_64/stable app/org.videolan.VLC/x86_64/stable"
|
||||||
|
SECURE_BOOT_KEY_URL:
|
||||||
|
value: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der'
|
||||||
|
ENROLLMENT_PASSWORD:
|
||||||
|
value: 'container-installer'
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
load-vars:
|
||||||
|
name: Load Variables
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Sucess
|
||||||
|
run:
|
||||||
|
echo "Vars loaded"
|
||||||
143
.github/workflows/clean_repo.yml
vendored
Normal file
143
.github/workflows/clean_repo.yml
vendored
Normal file
|
|
@ -0,0 +1,143 @@
|
||||||
|
name: Clean Container Registry
|
||||||
|
on:
|
||||||
|
# schedule:
|
||||||
|
# - cron: '0 21 * * 0'
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
delete_untagged:
|
||||||
|
name: Delete Untagged Packages
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Delete Untagged Packages
|
||||||
|
uses: Chizkiyahu/delete-untagged-ghcr-action@v5
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.PACKAGE_DELETER }}
|
||||||
|
repository_owner: ${{ github.repository_owner }}
|
||||||
|
repository: ${{ github.repository }}
|
||||||
|
untagged_only: true
|
||||||
|
owner_type: user
|
||||||
|
|
||||||
|
delete_old_pr:
|
||||||
|
name: Delete Old PR Packages
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: read
|
||||||
|
steps:
|
||||||
|
- name: Delete Old PR Packages
|
||||||
|
id: all_tags
|
||||||
|
run: |
|
||||||
|
curl -L \
|
||||||
|
-H "Accept: application/vnd.github+json" \
|
||||||
|
-H "Authorization: Bearer ${{ github.token }}" \
|
||||||
|
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
|
"https://api.github.com/user/packages/container/build-container-installer/versions" > all_packages.json
|
||||||
|
curl -L \
|
||||||
|
-H "Accept: application/vnd.github+json" \
|
||||||
|
-H "Authorization: Bearer ${{ github.token }}" \
|
||||||
|
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
|
https://api.github.com/repos/${{ github.repository }}/pulls | \
|
||||||
|
jq -r '.[] | select(.state == "open") | .number' | \
|
||||||
|
sed 's/^/pr-/g' > open_prs
|
||||||
|
cat << EOF | python
|
||||||
|
import json
|
||||||
|
import re
|
||||||
|
|
||||||
|
prs = open("open_prs", "r")
|
||||||
|
open_prs = prs.readlines()
|
||||||
|
open_prs = [x.strip() for x in open_prs]
|
||||||
|
|
||||||
|
all_packages = open('all_packages.json')
|
||||||
|
data = json.load(all_packages)
|
||||||
|
|
||||||
|
delete_versions = open("delete_versions", "w")
|
||||||
|
|
||||||
|
for i in data:
|
||||||
|
delete = True
|
||||||
|
for tag in i['metadata']['container']['tags']:
|
||||||
|
if not re.match('pr-.*', tag):
|
||||||
|
delete = False
|
||||||
|
continue
|
||||||
|
if tag in open_prs:
|
||||||
|
delete = False
|
||||||
|
if delete:
|
||||||
|
print("delete", i['id'])
|
||||||
|
delete_versions.write(str(i['id']))
|
||||||
|
delete_versions.write("\n")
|
||||||
|
print(i['metadata']['container']['tags'])
|
||||||
|
EOF
|
||||||
|
|
||||||
|
for id in $(cat delete_versions)
|
||||||
|
do
|
||||||
|
curl -L \
|
||||||
|
-X DELETE \
|
||||||
|
-H "Accept: application/vnd.github+json" \
|
||||||
|
-H "Authorization: Bearer ${{ secrets.PACKAGE_DELETER }}" \
|
||||||
|
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
|
https://api.github.com/user/packages/container/build-container-installer/versions/${id}
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
delete_old_branches:
|
||||||
|
name: Delete Old Branch Packages
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: read
|
||||||
|
steps:
|
||||||
|
- name: Delete Old Branch Packages
|
||||||
|
run: |
|
||||||
|
curl -L \
|
||||||
|
-H "Accept: application/vnd.github+json" \
|
||||||
|
-H "Authorization: Bearer ${{ github.token }}" \
|
||||||
|
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
|
"https://api.github.com/user/packages/container/build-container-installer/versions" > all_packages.json
|
||||||
|
curl -L \
|
||||||
|
-H "Accept: application/vnd.github+json" \
|
||||||
|
-H "Authorization: Bearer ${{ github.token }}" \
|
||||||
|
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
|
https://api.github.com/repos/${{ github.repository }}/branches | jq -r '.[].name' > branches
|
||||||
|
|
||||||
|
cat << EOF | python
|
||||||
|
import json
|
||||||
|
import re
|
||||||
|
|
||||||
|
branches_f = open("branches", "r")
|
||||||
|
branches = branches_f.readlines()
|
||||||
|
branches = [x.strip() for x in branches]
|
||||||
|
|
||||||
|
all_packages_f = open('all_packages.json')
|
||||||
|
data = json.load(all_packages_f)
|
||||||
|
|
||||||
|
delete_versions = open("delete_versions", "w")
|
||||||
|
|
||||||
|
for i in data:
|
||||||
|
delete = True
|
||||||
|
for tag in i['metadata']['container']['tags']:
|
||||||
|
if re.match('v[0-9]+\\\.[0-9]+\\\.[0-9]+', tag):
|
||||||
|
delete = False
|
||||||
|
continue
|
||||||
|
if re.match('pr-.*', tag):
|
||||||
|
delete = False
|
||||||
|
continue
|
||||||
|
if tag in branches:
|
||||||
|
delete = False
|
||||||
|
continue
|
||||||
|
if tag == "latest":
|
||||||
|
delete = False
|
||||||
|
if delete:
|
||||||
|
print("delete", i['id'])
|
||||||
|
delete_versions.write(str(i['id']))
|
||||||
|
delete_versions.write("\n")
|
||||||
|
print(i['metadata']['container']['tags'])
|
||||||
|
EOF
|
||||||
|
|
||||||
|
for id in $(cat delete_versions)
|
||||||
|
do
|
||||||
|
curl -L \
|
||||||
|
-X DELETE \
|
||||||
|
-H "Accept: application/vnd.github+json" \
|
||||||
|
-H "Authorization: Bearer ${{ secrets.PACKAGE_DELETER }}" \
|
||||||
|
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
|
https://api.github.com/user/packages/container/build-container-installer/versions/${id}
|
||||||
|
done
|
||||||
32
.github/workflows/stale.yml
vendored
Normal file
32
.github/workflows/stale.yml
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
|
||||||
|
#
|
||||||
|
# You can adjust the behavior by modifying this file.
|
||||||
|
# For more information, see:
|
||||||
|
# https://github.com/actions/stale
|
||||||
|
name: Mark stale issues and pull requests
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 21 * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stale:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@v9
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
stale-issue-message: 'Issue is stale and will be closed in 14 days if there is no further activity'
|
||||||
|
stale-pr-message: 'Pull request is stale and will be closed in 14 days if there is no further activity'
|
||||||
|
stale-issue-label: 'no-issue-activity'
|
||||||
|
stale-pr-label: 'no-pr-activity'
|
||||||
|
days-before-stale: 60
|
||||||
|
days-before-close: 17
|
||||||
|
remove-stale-when-updated: true
|
||||||
|
only-issue-labels: help wanted
|
||||||
|
|
||||||
112
.github/workflows/test_deployment.yml
vendored
Normal file
112
.github/workflows/test_deployment.yml
vendored
Normal file
|
|
@ -0,0 +1,112 @@
|
||||||
|
name: Test Deployment
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
pr:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
parent_job_name:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
load_vars:
|
||||||
|
name: Load Variables
|
||||||
|
uses: ./.github/workflows/build_vars.yml
|
||||||
|
|
||||||
|
test-deployment:
|
||||||
|
name: Test deployment
|
||||||
|
env:
|
||||||
|
JOB_NAME: Test deployment
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- load_vars
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
statuses: write
|
||||||
|
continue-on-error: false
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix: ${{ fromJson(needs.load_vars.outputs.BUILD_MATRIX) }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Switch branch
|
||||||
|
if: inputs.pr
|
||||||
|
env:
|
||||||
|
GITHUB_USER: ${{ github.actor }}
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y hub
|
||||||
|
hub pr checkout ${{ inputs.pr }}
|
||||||
|
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Get Current Job Log URL
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: Tiryoh/gha-jobid-action@v1
|
||||||
|
id: jobs
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
job_name: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }})"
|
||||||
|
per_page: 100
|
||||||
|
|
||||||
|
- name: Set status
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: myrotvorets/set-commit-status-action@v2.0.1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
status: pending
|
||||||
|
context: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }})"
|
||||||
|
sha: ${{ env.sha }}
|
||||||
|
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||||
|
|
||||||
|
- name: Install test tools
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y unzip make
|
||||||
|
sudo make test/vm/install-deps PACKAGE_MANAGER=apt-get
|
||||||
|
|
||||||
|
- name: Download generated ISO
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.image_name }}-${{ matrix.version }}${{ matrix.flatpaks == 'false' && '' || format('-{0}', matrix.flatpaks) }}
|
||||||
|
|
||||||
|
- name: Run VM Tests
|
||||||
|
env:
|
||||||
|
VM_USER: core
|
||||||
|
VM_PASS: foobar
|
||||||
|
VM_IP: "127.0.0.1"
|
||||||
|
VM_PORT: "5555"
|
||||||
|
run: |
|
||||||
|
make test/vm \
|
||||||
|
ARCH=${{ needs.load_vars.outputs.ARCH}} \
|
||||||
|
ENROLLMENT_PASSWORD=${{ needs.load_vars.outputs.ENROLLMENT_PASSWORD }} \
|
||||||
|
${{ matrix.flatpaks == 'flatpak_refs' && format('FLATPAK_REMOTE_REFS="{0}"', needs.load_vars.outputs.FLATPAK_REMOTE_REFS) || '' }} \
|
||||||
|
${{ matrix.flatpaks == 'flatpak_refs_dir' && format('FLATPAK_REMOTE_REFS_DIR="{0}"', needs.load_vars.outputs.FLATPAK_REMOTE_REFS_DIR) || '' }} \
|
||||||
|
IMAGE_NAME=${{ matrix.image_name }} \
|
||||||
|
IMAGE_REPO=${{ matrix.image_repo }} \
|
||||||
|
IMAGE_TAG=${{ matrix.version }} \
|
||||||
|
ISO_NAME=${{ matrix.image_name }}-${{ matrix.version }}${{ matrix.flatpaks == 'false' && '' || format('-{0}', matrix.flatpaks) }}.iso \
|
||||||
|
${{ matrix.repos != '' && format('REPOS="{0}"', matrix.repos) || '' }} \
|
||||||
|
SECURE_BOOT_KEY_URL=${{ needs.load_vars.outputs.SECURE_BOOT_KEY_URL }} \
|
||||||
|
VARIANT=${{ needs.load_vars.outputs.VARIANT }} \
|
||||||
|
VERSION=${{ matrix.version }} \
|
||||||
|
VM_IP=${VM_IP} \
|
||||||
|
VM_PASS=${VM_PASS} \
|
||||||
|
VM_PORT=${VM_PORT} \
|
||||||
|
VM_USER=${VM_USER}
|
||||||
|
|
||||||
|
- name: Set status
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: myrotvorets/set-commit-status-action@v2.0.1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
status: ${{ job.status }}
|
||||||
|
context: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }})"
|
||||||
|
sha: ${{ env.sha }}
|
||||||
|
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||||
103
.github/workflows/test_iso.yml
vendored
Normal file
103
.github/workflows/test_iso.yml
vendored
Normal file
|
|
@ -0,0 +1,103 @@
|
||||||
|
name: Test ISO
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
pr:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
parent_job_name:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
load_vars:
|
||||||
|
name: Load Variables
|
||||||
|
uses: ./.github/workflows/build_vars.yml
|
||||||
|
|
||||||
|
test-iso:
|
||||||
|
name: Test ISO
|
||||||
|
env:
|
||||||
|
JOB_NAME: Test ISO
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- load_vars
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
statuses: write
|
||||||
|
continue-on-error: false
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix: ${{ fromJson(needs.load_vars.outputs.BUILD_MATRIX) }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Switch branch
|
||||||
|
if: inputs.pr
|
||||||
|
env:
|
||||||
|
GITHUB_USER: ${{ github.actor }}
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y hub
|
||||||
|
hub pr checkout ${{ inputs.pr }}
|
||||||
|
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Get Current Job Log URL
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: Tiryoh/gha-jobid-action@v1
|
||||||
|
id: jobs
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
job_name: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }})"
|
||||||
|
per_page: 100
|
||||||
|
|
||||||
|
- name: Set status
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: myrotvorets/set-commit-status-action@v2.0.1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
status: pending
|
||||||
|
context: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }})"
|
||||||
|
sha: ${{ env.sha }}
|
||||||
|
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||||
|
|
||||||
|
- name: Install test tools
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y make
|
||||||
|
sudo make test/iso/install-deps PACKAGE_MANAGER=apt-get
|
||||||
|
|
||||||
|
- name: Download generated ISO
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.image_name }}-${{ matrix.version }}${{ matrix.flatpaks == 'false' && '' || format('-{0}', matrix.flatpaks) }}
|
||||||
|
|
||||||
|
- name: Run ISO checks
|
||||||
|
run: |
|
||||||
|
make test/iso \
|
||||||
|
ARCH=${{ needs.load_vars.outputs.ARCH}} \
|
||||||
|
ENROLLMENT_PASSWORD=${{ needs.load_vars.outputs.ENROLLMENT_PASSWORD }} \
|
||||||
|
${{ matrix.flatpaks == 'flatpak_refs' && format('FLATPAK_REMOTE_REFS="{0}"', needs.load_vars.outputs.FLATPAK_REMOTE_REFS) || '' }} \
|
||||||
|
${{ matrix.flatpaks == 'flatpak_refs_dir' && format('FLATPAK_REMOTE_REFS_DIR="{0}"', needs.load_vars.outputs.FLATPAK_REMOTE_REFS_DIR) || '' }} \
|
||||||
|
IMAGE_NAME=${{ matrix.image_name }} \
|
||||||
|
IMAGE_REPO=${{ matrix.image_repo }} \
|
||||||
|
IMAGE_TAG=${{ matrix.version }} \
|
||||||
|
ISO_NAME=${{ matrix.image_name }}-${{ matrix.version }}${{ matrix.flatpaks == 'false' && '' || format('-{0}', matrix.flatpaks) }}.iso \
|
||||||
|
${{ matrix.repos != '' && format('REPOS="{0}"', matrix.repos) || '' }} \
|
||||||
|
SECURE_BOOT_KEY_URL=${{ needs.load_vars.outputs.SECURE_BOOT_KEY_URL }} \
|
||||||
|
VARIANT=${{ needs.load_vars.outputs.VARIANT }} \
|
||||||
|
VERSION=${{ matrix.version }}
|
||||||
|
|
||||||
|
- name: Set status
|
||||||
|
if: inputs.pr && always()
|
||||||
|
uses: myrotvorets/set-commit-status-action@v2.0.1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
status: ${{ job.status }}
|
||||||
|
context: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }})"
|
||||||
|
sha: ${{ env.sha }}
|
||||||
|
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||||
30
.github/workflows/test_repo.yml
vendored
Normal file
30
.github/workflows/test_repo.yml
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
name: Test Repo
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
variables:
|
||||||
|
name: Check variables are listed
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Run test
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y make
|
||||||
|
sudo make test/repo/install-deps
|
||||||
|
make test/repo
|
||||||
60
.github/workflows/tests.yml
vendored
Normal file
60
.github/workflows/tests.yml
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
name: All Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
pr:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
parent_job_name:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_container:
|
||||||
|
name: Build Container
|
||||||
|
uses: ./.github/workflows/build_container.yml
|
||||||
|
secrets: inherit
|
||||||
|
with:
|
||||||
|
pr: ${{ inputs.pr }}
|
||||||
|
parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Build Container
|
||||||
|
|
||||||
|
build_isos:
|
||||||
|
name: Build ISOs
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
|
uses: ./.github/workflows/build_iso.yml
|
||||||
|
with:
|
||||||
|
pr: ${{ inputs.pr }}
|
||||||
|
parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Build ISOs
|
||||||
|
|
||||||
|
test_isos:
|
||||||
|
name: Test ISOs
|
||||||
|
needs:
|
||||||
|
- build_isos
|
||||||
|
uses: ./.github/workflows/test_iso.yml
|
||||||
|
with:
|
||||||
|
pr: ${{ inputs.pr }}
|
||||||
|
parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Test ISOs
|
||||||
|
|
||||||
|
test_deployments:
|
||||||
|
name: Test Deployments
|
||||||
|
needs:
|
||||||
|
- build_isos
|
||||||
|
uses: ./.github/workflows/test_deployment.yml
|
||||||
|
with:
|
||||||
|
pr: ${{ inputs.pr }}
|
||||||
|
parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Test Deployments
|
||||||
50
.github/workflows/update_wiki.yml
vendored
Normal file
50
.github/workflows/update_wiki.yml
vendored
Normal file
|
|
@ -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: |
|
||||||
|
sudo apt install -y make rsync
|
||||||
|
# Checkout Main Repo
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
|
# Checkout Wiki Repo
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
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 "action@github.com"
|
||||||
|
git config --local user.name "GitHub Action"
|
||||||
|
git add .
|
||||||
|
git commit -m "Add changes"
|
||||||
|
git push
|
||||||
10
.gitignore
vendored
10
.gitignore
vendored
|
|
@ -1,14 +1,16 @@
|
||||||
/debugdata
|
/debugdata
|
||||||
/build
|
/build
|
||||||
|
/flatpaks/script.sh
|
||||||
|
/flatpaks/repo
|
||||||
|
/flatpaks/list.txt
|
||||||
|
/lorax_templates/post_*
|
||||||
/pkglists
|
/pkglists
|
||||||
/repos
|
/repos/*.repo
|
||||||
/results
|
/results
|
||||||
/lorax_templates/*.tmpl
|
|
||||||
/xorriso/input.txt
|
/xorriso/input.txt
|
||||||
/xorriso/*.sh
|
|
||||||
/original-pkgsizes.txt
|
/original-pkgsizes.txt
|
||||||
/final-pkgsizes.txt
|
/final-pkgsizes.txt
|
||||||
/lorax.conf
|
/lorax.conf
|
||||||
/output
|
/output
|
||||||
/*.log
|
/*.log
|
||||||
|
/cache
|
||||||
7
.gitmodules
vendored
Normal file
7
.gitmodules
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
[submodule "external/fedora-lorax-templates"]
|
||||||
|
path = external/fedora-lorax-templates
|
||||||
|
url = https://pagure.io/fedora-lorax-templates.git
|
||||||
|
branch = f40
|
||||||
|
[submodule "external/lorax"]
|
||||||
|
path = external/lorax
|
||||||
|
url = https://github.com/weldr/lorax.git
|
||||||
1
.mdlrc
Normal file
1
.mdlrc
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
style "#{File.dirname(__FILE__)}/.codacy/markdownlint.rb"
|
||||||
5
.vscode/settings.json
vendored
Normal file
5
.vscode/settings.json
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"files.associations": {
|
||||||
|
"Makefile.inputs": "makefile"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
FROM fedora:39
|
FROM fedora:42
|
||||||
|
|
||||||
ARG VERSION=39
|
ARG VERSION=42
|
||||||
|
|
||||||
ENV ARCH="x86_64"
|
ENV ARCH="x86_64"
|
||||||
ENV IMAGE_NAME="base"
|
ENV IMAGE_NAME="base"
|
||||||
|
|
@ -11,16 +11,15 @@ ENV VERSION="${VERSION}"
|
||||||
ENV WEB_UI="false"
|
ENV WEB_UI="false"
|
||||||
|
|
||||||
RUN mkdir /build-container-installer
|
RUN mkdir /build-container-installer
|
||||||
COPY /lorax_templates /build-container-installer/lorax_templates
|
|
||||||
COPY /xorriso /build-container-installer/xorriso
|
COPY / /build-container-installer/
|
||||||
COPY /Makefile /build-container-installer
|
|
||||||
COPY /entrypoint.sh /
|
|
||||||
|
|
||||||
WORKDIR /build-container-installer
|
WORKDIR /build-container-installer
|
||||||
|
|
||||||
RUN dnf install -y make && make install-deps
|
|
||||||
|
|
||||||
VOLUME /build-container-installer/build
|
VOLUME /build-container-installer/build
|
||||||
|
VOLUME /build-container-installer/repos
|
||||||
|
VOLUME /cache
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
|
RUN dnf install -y make && make install-deps && dnf clean all
|
||||||
|
|
||||||
|
ENTRYPOINT ["/bin/bash", "/build-container-installer/entrypoint.sh"]
|
||||||
|
|
||||||
|
|
|
||||||
210
Makefile
210
Makefile
|
|
@ -1,106 +1,148 @@
|
||||||
# Configuration vars
|
include Makefile.inputs
|
||||||
## Formatting = UPPERCASE
|
|
||||||
ARCH = x86_64
|
|
||||||
VERSION = 39
|
|
||||||
IMAGE_REPO = quay.io/fedora-ostree-desktops
|
|
||||||
IMAGE_NAME = base
|
|
||||||
IMAGE_TAG = $(VERSION)
|
|
||||||
VARIANT = Server
|
|
||||||
WEB_UI = false
|
|
||||||
REPOS = /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora-updates.repo
|
|
||||||
ADDITIONAL_TEMPLATES = ""
|
|
||||||
ROOTFS_SIZE = 4
|
|
||||||
|
|
||||||
# Generated vars
|
###################
|
||||||
|
# Hidden vars
|
||||||
|
|
||||||
|
export SHELL := /bin/sh
|
||||||
|
# Cache
|
||||||
|
export DNF_CACHE :=
|
||||||
|
export PACKAGE_MANAGER := dnf
|
||||||
|
|
||||||
|
# Functions
|
||||||
|
## Formatting = lowercase
|
||||||
|
# Get a list of templates for the feature
|
||||||
|
# $1 = feature
|
||||||
|
define get_templates
|
||||||
|
$(wildcard lorax_templates/$(1)_*.tmpl)
|
||||||
|
$(foreach file,$(notdir $(wildcard lorax_templates/scripts/post/$(1)_*)),lorax_templates/post_$(file).tmpl)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define install_pkg
|
||||||
|
$(PACKAGE_MANAGER) install -y $(if $(findstring dnf,$(PACKAGE_MANAGER)),--disablerepo='*-testing')
|
||||||
|
endef
|
||||||
|
export install_pkg
|
||||||
|
|
||||||
|
# Generated/internal vars
|
||||||
## Formatting = _UPPERCASE
|
## Formatting = _UPPERCASE
|
||||||
_BASE_DIR = $(shell pwd)
|
_IMAGE_REPO_ESCAPED := $(subst /,\/,$(IMAGE_REPO))
|
||||||
_IMAGE_REPO_ESCAPED = $(subst /,\/,$(IMAGE_REPO))
|
_IMAGE_REPO_DOUBLE_ESCAPED := $(subst \,\\\,$(_IMAGE_REPO_ESCAPED))
|
||||||
_IMAGE_REPO_DOUBLE_ESCAPED = $(subst \,\\\,$(_IMAGE_REPO_ESCAPED))
|
_LORAX_ARGS :=
|
||||||
_VOLID = $(firstword $(subst -, ,$(IMAGE_NAME)))-$(ARCH)-$(IMAGE_TAG)
|
export _LORAX_TEMPLATES := $(call get_templates,install) lorax_templates/install_include_post.tmpl
|
||||||
_REPO_FILES = $(subst /etc/yum.repos.d,repos,$(REPOS))
|
_REPO_FILES := $(subst /etc/yum.repos.d,repos,$(REPOS))
|
||||||
_LORAX_TEMPLATES = $(subst .in,,$(shell ls lorax_templates/*.tmpl.in))
|
_TEMP_DIR := $(shell mktemp -d)
|
||||||
|
_TEMPLATE_VARS := ARCH IMAGE_NAME IMAGE_REPO _IMAGE_REPO_DOUBLE_ESCAPED _IMAGE_REPO_ESCAPED IMAGE_SIGNED IMAGE_TAG REPOS _RHEL VARIANT VERSION WEB_UI
|
||||||
|
_VOLID := $(firstword $(subst -, ,$(IMAGE_NAME)))-$(ARCH)-$(IMAGE_TAG)
|
||||||
|
|
||||||
ifeq ($(VARIANT),Server)
|
ifeq ($(findstring redhat.repo,$(REPOS)),redhat.repo)
|
||||||
_LORAX_ARGS = --macboot --noupgrade
|
export _RHEL := true
|
||||||
|
export _LORAX_TEMPLATES += $(call get_templates,rhel)
|
||||||
else
|
else
|
||||||
_LORAX_ARGS = --nomacboot
|
undefine _RHEL
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(_RHEL),true)
|
||||||
|
_LORAX_ARGS += --nomacboot --noupgrade
|
||||||
|
else ifeq ($(VARIANT),Server)
|
||||||
|
_LORAX_ARGS += --macboot --noupgrade --squashfs-only
|
||||||
|
else
|
||||||
|
_LORAX_ARGS += --nomacboot --squashfs-only
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(WEB_UI),true)
|
ifeq ($(WEB_UI),true)
|
||||||
_LORAX_ARGS += -i anaconda-webui
|
_LORAX_ARGS += -i anaconda-webui
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Step 7: Buid end ISO
|
ifneq ($(DNF_CACHE),)
|
||||||
|
_LORAX_ARGS += --cachedir $(DNF_CACHE)
|
||||||
|
export _LORAX_TEMPLATES += $(call get_templates,cache)
|
||||||
|
_TEMPLATE_VARS += DNF_CACHE
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(FLATPAK_DIR),)
|
||||||
|
_FLATPAK_REPO_GPG := $(shell curl -L $(FLATPAK_REMOTE_URL) | grep -i '^GPGKey=' | cut -d= -f2)
|
||||||
|
export _FLATPAK_REPO_URL := $(shell curl -L $(FLATPAK_REMOTE_URL) | grep -i '^URL=' | cut -d= -f2)
|
||||||
|
_LORAX_ARGS += -i flatpak-libs
|
||||||
|
export _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
|
||||||
|
else
|
||||||
|
ifneq ($(FLATPAK_REMOTE_REFS_DIR),)
|
||||||
|
COLLECTED_REFS := $(foreach file,$(filter-out README.md Makefile,$(wildcard $(FLATPAK_REMOTE_REFS_DIR)/*)),$(shell cat $(file)))
|
||||||
|
export FLATPAK_REMOTE_REFS += $(sort $(COLLECTED_REFS))
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(FLATPAK_REMOTE_REFS),)
|
||||||
|
_FLATPAK_REPO_GPG := $(shell curl -L $(FLATPAK_REMOTE_URL) | grep -i '^GPGKey=' | cut -d= -f2)
|
||||||
|
export _FLATPAK_REPO_URL := $(shell curl -L $(FLATPAK_REMOTE_URL) | grep -i '^URL=' | cut -d= -f2)
|
||||||
|
_LORAX_ARGS += -i flatpak-libs
|
||||||
|
export _LORAX_TEMPLATES += $(call get_templates,flatpak) \
|
||||||
|
external/fedora-lorax-templates/ostree-based-installer/lorax-embed-flatpaks.tmpl
|
||||||
|
_TEMPLATE_VARS += FLATPAK_DIR FLATPAK_REMOTE_NAME FLATPAK_REMOTE_REFS FLATPAK_REMOTE_URL _FLATPAK_REPO_GPG _FLATPAK_REPO_URL
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
ifneq ($(SECURE_BOOT_KEY_URL),)
|
||||||
|
export _LORAX_TEMPLATES += $(call get_templates,secureboot)
|
||||||
|
_TEMPLATE_VARS += ENROLLMENT_PASSWORD
|
||||||
|
endif
|
||||||
|
|
||||||
|
_SUBDIRS := container external flatpak_refs lorax_templates repos xorriso test
|
||||||
|
|
||||||
|
# Create checksum
|
||||||
## Default action
|
## Default action
|
||||||
build/deploy.iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.txt
|
$(ISO_NAME)-CHECKSUM: $(ISO_NAME)
|
||||||
mkdir $(_BASE_DIR)/build || true
|
cd $(dir $(ISO_NAME)) && sha256sum $(notdir $(ISO_NAME)) > $(notdir $(ISO_NAME))-CHECKSUM
|
||||||
xorriso -dialog on < $(_BASE_DIR)/xorriso/input.txt
|
|
||||||
implantisomd5 build/deploy.iso
|
|
||||||
|
|
||||||
# Step 1: Generate Lorax Templates
|
# Build end ISO
|
||||||
lorax_templates/%.tmpl: lorax_templates/%.tmpl.in
|
$(ISO_NAME): results/images/boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.txt
|
||||||
$(eval _VARS = IMAGE_NAME IMAGE_TAG _IMAGE_REPO_DOUBLE_ESCAPED)
|
$(if $(wildcard $(dir $(ISO_NAME))),,mkdir -p $(dir $(ISO_NAME)); chmod ugo=rwX $(dir $(ISO_NAME)))
|
||||||
$(foreach var,$(_VARS),$(var)=$($(var))) envsubst '$(foreach var,$(_VARS),$$$(var))' < $(_BASE_DIR)/lorax_templates/$*.tmpl.in > $(_BASE_DIR)/lorax_templates/$*.tmpl
|
xorriso -dialog on < xorriso/input.txt
|
||||||
|
implantisomd5 $(ISO_NAME)
|
||||||
|
chmod ugo=r $(ISO_NAME)
|
||||||
|
$(if $(GITHUB_OUTPUT), echo "iso_name=$(ISO_NAME)" >> $(GITUHB_OUTPUT))
|
||||||
|
|
||||||
|
# Download the secure boot key
|
||||||
|
sb_pubkey.der:
|
||||||
|
curl --fail -L -o sb_pubkey.der $(SECURE_BOOT_KEY_URL)
|
||||||
|
|
||||||
# Step 2: Replace vars in repo files
|
# Build boot.iso using Lorax
|
||||||
repos/%.repo: /etc/yum.repos.d/%.repo
|
results/images/boot.iso: external/lorax/branch-$(VERSION) $(filter lorax_templates/%,$(_LORAX_TEMPLATES)) $(filter repos/%,$(_REPO_FILES)) $(if $(SECURE_BOOT_KEY_URL),sb_pubkey.der)
|
||||||
mkdir repos || true
|
$(if $(wildcard results), rm -Rf results)
|
||||||
cp /etc/yum.repos.d/$*.repo $(_BASE_DIR)/repos/$*.repo
|
$(if $(wildcard /etc/rpm/macros.image-language-conf),mv /etc/rpm/macros.image-language-conf $(_TEMP_DIR)/macros.image-language-conf)
|
||||||
sed -i "s/\$$releasever/${VERSION}/g" $(_BASE_DIR)/repos/$*.repo
|
|
||||||
sed -i "s/\$$basearch/${ARCH}/g" $(_BASE_DIR)/repos/$*.repo
|
|
||||||
|
|
||||||
# Don't do anything for custom repos
|
|
||||||
%.repo:
|
|
||||||
|
|
||||||
# Step 3: Build boot.iso using Lorax
|
|
||||||
boot.iso: $(_LORAX_TEMPLATES) $(_REPO_FILES)
|
|
||||||
rm -Rf $(_BASE_DIR)/results || true
|
|
||||||
rm /etc/rpm/macros.image-language-conf || true
|
|
||||||
lorax -p $(IMAGE_NAME) -v $(VERSION) -r $(VERSION) -t $(VARIANT) \
|
lorax -p $(IMAGE_NAME) -v $(VERSION) -r $(VERSION) -t $(VARIANT) \
|
||||||
--isfinal --squashfs-only --buildarch=$(ARCH) --volid=$(_VOLID) \
|
--isfinal --buildarch=$(ARCH) --volid=$(_VOLID) --sharedir $(PWD)/external/lorax/share/templates.d/99-generic \
|
||||||
$(_LORAX_ARGS) \
|
$(_LORAX_ARGS) \
|
||||||
$(foreach file,$(_REPO_FILES),--repo $(_BASE_DIR)/$(file)) \
|
$(foreach file,$(_REPO_FILES),--repo $(patsubst repos/%,$(PWD)/repos/%,$(file))) \
|
||||||
$(foreach file,$(_LORAX_TEMPLATES),--add-template $(_BASE_DIR)/$(file)) \
|
$(foreach file,$(_LORAX_TEMPLATES),--add-template $(PWD)/$(file)) \
|
||||||
$(foreach file,$(ADDITIONAL_TEMPLATES),--add-template $(file)) \
|
$(foreach file,$(ADDITIONAL_TEMPLATES),--add-template $(file)) \
|
||||||
--rootfs-size $(ROOTFS_SIZE) \
|
$(foreach file,$(_FLATPAK_TEMPLATES),--add-template $(file)) \
|
||||||
$(_BASE_DIR)/results/
|
$(foreach file,$(_EXTERNAL_TEMPLATES),--add-template $(PWD)/external/$(file)) \
|
||||||
mv $(_BASE_DIR)/results/images/boot.iso $(_BASE_DIR)/
|
--rootfs-size $(ROOTFS_SIZE) \
|
||||||
|
$(foreach var,$(_TEMPLATE_VARS),--add-template-var "$(shell echo $(var) | tr '[:upper:]' '[:lower:]')=$($(var))") \
|
||||||
# Step 4: Download container image
|
results/
|
||||||
container/$(IMAGE_NAME)-$(IMAGE_TAG):
|
$(if $(wildcard $(_TEMP_DIR)/macros.image-language-conf),mv -f $(_TEMP_DIR)/macros.image-language-conf /etc/rpm/macros.image-language-conf)
|
||||||
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)
|
|
||||||
|
|
||||||
# Step 5: Generate xorriso script
|
|
||||||
xorriso/%.sh: xorriso/%.sh.in
|
|
||||||
$(eval _VARS = IMAGE_NAME IMAGE_TAG ARCH VERSION)
|
|
||||||
$(foreach var,$(_VARS),$(var)=$($(var))) envsubst '$(foreach var,$(_VARS),$$$(var))' < $(_BASE_DIR)/xorriso/$*.sh.in > $(_BASE_DIR)/xorriso/$*.sh
|
|
||||||
|
|
||||||
# Step 6: Generate xorriso input
|
|
||||||
xorriso/input.txt: xorriso/gen_input.sh
|
|
||||||
bash $(_BASE_DIR)/xorriso/gen_input.sh | tee $(_BASE_DIR)/xorriso/input.txt
|
|
||||||
|
|
||||||
|
|
||||||
|
FILES_TO_CLEAN := $(wildcard build debugdata pkglists results original-pkgsizes.txt final-pkgsizes.txt lorax.conf *.iso *log)
|
||||||
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -Rf $(_BASE_DIR)/build || true
|
rm -Rf $(FILES_TO_CLEAN)
|
||||||
rm -Rf $(_BASE_DIR)/container || true
|
$(foreach DIR,$(_SUBDIRS),$(MAKE) -w -C $(DIR) clean;)
|
||||||
rm -Rf $(_BASE_DIR)/debugdata || true
|
|
||||||
rm -Rf $(_BASE_DIR)/pkglists || true
|
|
||||||
rm -Rf $(_BASE_DIR)/repos || true
|
|
||||||
rm -Rf $(_BASE_DIR)/results || true
|
|
||||||
rm -f $(_BASE_DIR)/lorax_templates/*.tmpl || true
|
|
||||||
rm -f $(_BASE_DIR)/xorriso/input.txt || true
|
|
||||||
rm -f $(_BASE_DIR)/xorriso/*.sh || true
|
|
||||||
rm -f $(_BASE_DIR)/{original,final}-pkgsizes.txt || true
|
|
||||||
rm -f $(_BASE_DIR)/lorax.conf || true
|
|
||||||
rm -f $(_BASE_DIR)/*.iso || true
|
|
||||||
rm -f $(_BASE_DIR)/*.log || true
|
|
||||||
|
|
||||||
|
.PHONY: install-deps
|
||||||
install-deps:
|
install-deps:
|
||||||
dnf install -y lorax xorriso podman
|
$(install_pkg) lorax xorriso coreutils gettext syslinux-nonlinux
|
||||||
|
$(foreach DIR,$(filter-out test,$(_SUBDIRS)),$(MAKE) -w -C $(DIR) install-deps;)
|
||||||
.PHONY: clean install-deps
|
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: $(_SUBDIRS) $(wildcard test/*) $(wildcard test/*/*)
|
||||||
|
test $(addsuffix /*,$(_SUBDIRS)):
|
||||||
|
$(eval DIR=$(firstword $(subst /, ,$@)))
|
||||||
|
$(if $(filter-out $(DIR),$@), $(eval TARGET=$(subst $(DIR)/,,$@)),$(eval TARGET=))
|
||||||
|
$(MAKE) -w -C $(DIR) $(TARGET)
|
||||||
|
|
||||||
|
.DEFAULT:
|
||||||
|
$(eval DIR=$(firstword $(subst /, ,$@)))
|
||||||
|
$(if $(filter-out $(DIR),$@), $(eval TARGET=$(subst $(DIR)/,,$@)),$(eval TARGET=))
|
||||||
|
$(MAKE) -w -C $(DIR) $(TARGET)
|
||||||
|
|
|
||||||
26
Makefile.inputs
Normal file
26
Makefile.inputs
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
# Configuration vars
|
||||||
|
## Formatting = UPPERCASE
|
||||||
|
# General
|
||||||
|
export ADDITIONAL_TEMPLATES :=
|
||||||
|
export ARCH := x86_64
|
||||||
|
export EXTRA_BOOT_PARAMS :=
|
||||||
|
export IMAGE_NAME := base
|
||||||
|
export IMAGE_REPO := quay.io/fedora-ostree-desktops
|
||||||
|
export IMAGE_SRC :=
|
||||||
|
export IMAGE_TAG = $(VERSION)
|
||||||
|
export IMAGE_SIGNED := true
|
||||||
|
REPOS := $(subst :,\:,$(wildcard /etc/yum.repos.d/*.repo))
|
||||||
|
export ROOTFS_SIZE := 4
|
||||||
|
export VARIANT := Server
|
||||||
|
export VERSION := 39
|
||||||
|
export WEB_UI := false
|
||||||
|
# Flatpak
|
||||||
|
export FLATPAK_REMOTE_NAME := flathub
|
||||||
|
export FLATPAK_REMOTE_URL := https://flathub.org/repo/flathub.flatpakrepo
|
||||||
|
export FLATPAK_REMOTE_REFS :=
|
||||||
|
export FLATPAK_REMOTE_REFS_DIR :=
|
||||||
|
export FLATPAK_DIR :=
|
||||||
|
# Secure boot
|
||||||
|
export ENROLLMENT_PASSWORD :=
|
||||||
|
export SECURE_BOOT_KEY_URL :=
|
||||||
|
export ISO_NAME := build/deploy.iso
|
||||||
123
README.md
123
README.md
|
|
@ -1,109 +1,50 @@
|
||||||

|
[](https://github.com/jasonn3/build-container-installer/actions/workflows/tests.yml)
|
||||||
|
[](https://app.codacy.com/gh/JasonN3/build-container-installer/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
||||||
|
|
||||||
# Build Container Installer Action
|
# Build Container Installer Action
|
||||||
This action is used to enerate 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
|
## Usage
|
||||||
|
|
||||||
This action is designed to be called from a GitHub workflow using the following format
|
This action is designed to be called from a GitHub workflow using the following format
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Build ISO
|
- name: Build ISO
|
||||||
uses: jasonn3/build-container-installer/v1.0.0
|
uses: jasonn3/build-container-installer@main
|
||||||
|
id: build
|
||||||
with:
|
with:
|
||||||
arch: ${{ env.ARCH}}
|
arch: ${{ env.ARCH}}
|
||||||
image_name: ${{ env.IMAGE_NAME}}
|
image_name: ${{ env.IMAGE_NAME}}
|
||||||
image_repo: ${{ env.IMAGE_REPO}}
|
image_repo: ${{ env.IMAGE_REPO}}
|
||||||
|
image_tag: ${{ env.IMAGE_TAG }}
|
||||||
version: ${{ env.VERSION }}
|
version: ${{ env.VERSION }}
|
||||||
variant: ${{ env.VARIANT }}
|
variant: ${{ env.VARIANT }}
|
||||||
action_version: v1.0.0
|
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_name }}
|
||||||
|
${{ steps.build.outputs.iso_path }}/${{ steps.build.outputs.iso_name }}-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`
|
**See the [Wiki](https://github.com/JasonN3/build-container-installer/wiki) for development and usage information.**
|
||||||
|
|
||||||
## Customizing
|
|
||||||
The following variables can be used to customize the created ISO.
|
|
||||||
|
|
||||||
| Variable | Description | Default Value |
|
## Star History
|
||||||
| ----------------- | -------------------------------------------------------- | ------------------------------ |
|
|
||||||
| ARCH | Architecture for image to build | x86_64 |
|
|
||||||
| VERSION | Fedora version of installer to build | 39 |
|
|
||||||
| IMAGE_REPO | Repository containing the source container image | quay.io/fedora-ostree-desktops |
|
|
||||||
| IMAGE_NAME | Name of the source container image | base |
|
|
||||||
| IMAGE_TAG | Tag of the source container image | *VERSION* |
|
|
||||||
| EXTRA_BOOT_PARAMS | Extra params used by grub to boot the anaconda installer | \[empty\] |
|
|
||||||
| VARIANT | Source container variant\* | Server |
|
|
||||||
| WEB_UI | Enable Anaconda WebUI (experimental) | false |
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
## Development
|
|
||||||
### 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 [Customizing](#customizing) for information about customizing the ISO that gets created.
|
|
||||||
|
|
||||||
### 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.
|
|
||||||
|
|
||||||
See [Customizing](#customizing) for information about customizing the ISO that gets created. The variable can either be defined as environment variables.
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
Building an ISO to install Fedora 38
|
|
||||||
```bash
|
|
||||||
docker run --rm --privileged --volume .:/build-container-installer/build -e VERSION=38 -e IMAGE_NAME=base -e IMAGE_TAG=38 -e VARIANT=Server ghcr.io/jasonn3/build-container-installer:latest
|
|
||||||
```
|
|
||||||
|
|
||||||
Building an ISO to install Fedora 39
|
|
||||||
```bash
|
|
||||||
docker run --rm --privileged --volume .:/build-container-installer/build -e VERSION=39 -e IMAGE_NAME=base -e IMAGE_TAG=39 -e VARIANT=Server ghcr.io/jasonn3/build-container-installer:latest
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
|
<a href="https://star-history.com/#jasonn3/build-container-installer&Date">
|
||||||
|
<picture>
|
||||||
|
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=jasonn3/build-container-installer&type=Date&theme=dark" />
|
||||||
|
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=jasonn3/build-container-installer&type=Date" />
|
||||||
|
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=jasonn3/build-container-installer&type=Date" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
|
|
||||||
246
action.yml
246
action.yml
|
|
@ -2,10 +2,55 @@ name: Build Container Installer
|
||||||
description: Generates an ISO for installing an OSTree stored in a container image
|
description: Generates an ISO for installing an OSTree stored in a container image
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
|
action_version:
|
||||||
|
description: Version of the action container to run
|
||||||
|
deprecationMessage: No longer used. github.action_ref replaces the need for this. Will be removed in a future version.
|
||||||
|
required: false
|
||||||
|
additional_templates:
|
||||||
|
description: Space delimited list of additional Lorax templates to include
|
||||||
|
required: false
|
||||||
arch:
|
arch:
|
||||||
description: Architecture for image to build
|
description: Architecture for image to build
|
||||||
required: true
|
required: true
|
||||||
default: x86_64
|
default: x86_64
|
||||||
|
dnf_cache_key:
|
||||||
|
description: Overrides the dnf cache key
|
||||||
|
required: false
|
||||||
|
enable_cache_dnf:
|
||||||
|
description: Whether to enable caching for dnf
|
||||||
|
required: false
|
||||||
|
default: "true"
|
||||||
|
enable_cache_skopeo:
|
||||||
|
description: Whether to enable caching for skopeo
|
||||||
|
required: false
|
||||||
|
default: "false"
|
||||||
|
enable_flatpak_dependencies:
|
||||||
|
description: Whether to enable automatically determining Flatpak dependencies
|
||||||
|
required: false
|
||||||
|
default: "true"
|
||||||
|
enrollment_password:
|
||||||
|
description: Used for supporting secure boot (requires SECURE_BOOT_KEY_URL to be defined)
|
||||||
|
required: false
|
||||||
|
default: "container-installer"
|
||||||
|
extra_boot_params:
|
||||||
|
description: Extra params used by grub to boot the anaconda installer
|
||||||
|
required: false
|
||||||
|
flatpak_remote_name:
|
||||||
|
description: Name of the Flatpak repo on the destination OS
|
||||||
|
required: false
|
||||||
|
default: "flathub"
|
||||||
|
flatpak_remote_refs:
|
||||||
|
description: Space separated list of flatpak refs to install
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
flatpak_remote_refs_dir:
|
||||||
|
description: Directory that contains files that list the flatpak refs to install
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
flatpak_remote_url:
|
||||||
|
description: URL of the flatpakrepo file
|
||||||
|
required: false
|
||||||
|
default: https://flathub.org/repo/flathub.flatpakrepo
|
||||||
image_name:
|
image_name:
|
||||||
description: Name of the source container image
|
description: Name of the source container image
|
||||||
required: true
|
required: true
|
||||||
|
|
@ -14,42 +59,201 @@ inputs:
|
||||||
description: Repository containing the source container image
|
description: Repository containing the source container image
|
||||||
required: true
|
required: true
|
||||||
default: quay.io/fedora-ostree-desktops
|
default: quay.io/fedora-ostree-desktops
|
||||||
|
image_signed:
|
||||||
|
description: Whether the container image is signed. The policy to test the signing must be configured inside the container image
|
||||||
|
required: false
|
||||||
|
default: "true"
|
||||||
|
image_src:
|
||||||
|
description: Overrides the source of the container image. Must be formatted for the skopeo copy command
|
||||||
|
required: false
|
||||||
|
image_tag:
|
||||||
|
description: Tag of the source container image
|
||||||
|
required: false
|
||||||
|
iso_name:
|
||||||
|
description: Name of the ISO you wish to output when completed
|
||||||
|
required: false
|
||||||
|
default: build/deploy.iso
|
||||||
|
make_target:
|
||||||
|
description: Overrides the default make target
|
||||||
|
required: false
|
||||||
|
repos:
|
||||||
|
description: List of repo files for Lorax to use
|
||||||
|
required: false
|
||||||
|
rootfs_size:
|
||||||
|
description: The size (in GiB) for the squashfs runtime volume
|
||||||
|
default: "2"
|
||||||
|
secure_boot_key_url:
|
||||||
|
description: Secure boot key that is installed from URL location
|
||||||
|
required: false
|
||||||
|
skopeo_cache_key:
|
||||||
|
description: Overrides the skopeo cache key
|
||||||
|
required: false
|
||||||
variant:
|
variant:
|
||||||
description: "Source container variant. Available options 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 kinonite"
|
description: "Source container variant. Available options 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"
|
||||||
required: true
|
required: true
|
||||||
default: Server
|
default: Server
|
||||||
version:
|
version:
|
||||||
description: Fedora version of installer to build
|
description: Fedora version of installer to build
|
||||||
required: true
|
required: true
|
||||||
default: "39"
|
default: "39"
|
||||||
image_tag:
|
|
||||||
description: Tag of the source container image. Defaults to the installer version
|
|
||||||
required: false
|
|
||||||
web_ui:
|
web_ui:
|
||||||
description: Enable Anaconda WebUI
|
description: Enable Anaconda WebUI
|
||||||
required: false
|
required: false
|
||||||
default: "false"
|
default: "false"
|
||||||
action_version:
|
|
||||||
description: Version of the action container to run
|
outputs:
|
||||||
required: true
|
iso_name:
|
||||||
default: "latest"
|
value: ${{ steps.docker.outputs.iso_name }}
|
||||||
additional_templates:
|
description: The name of the resulting .iso
|
||||||
description: Space delimetered list of additional Lorax templates to include
|
iso_path:
|
||||||
required: false
|
value: ${{ steps.docker.outputs.iso_path }}
|
||||||
|
description: The path of the resulting .iso
|
||||||
|
flatpak_refs:
|
||||||
|
value: ${{ steps.docker.outputs.flatpak_refs }}
|
||||||
|
description: The list of Flatpak refs
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: Run docker image
|
- name: Make cache directory
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
docker run --privileged --volume .:/github/workspace/ ghcr.io/jasonn3/build-container-installer:${{ inputs.action_version }} \
|
sudo mkdir /cache
|
||||||
ARCH=${{ inputs.arch }} \
|
sudo chmod 777 /cache
|
||||||
IMAGE_NAME=${{ inputs.image_name }} \
|
|
||||||
IMAGE_REPO=${{ inputs.image_repo }} \
|
|
||||||
VARIANT=${{ inputs.variant }} \
|
|
||||||
VERSION=${{ inputs.version }} \
|
|
||||||
IMAGE_TAG=${{ inputs.image_tag || inputs.version }} \
|
|
||||||
WEB_UI=${{ inputs.web_ui }} \
|
|
||||||
"ADDITIONAL_TEMPLATES=${{ inputs.additional_templates }}"
|
|
||||||
|
|
||||||
|
- name: Load dnf cache
|
||||||
|
id: load_dnf_cache
|
||||||
|
env:
|
||||||
|
dnf_cache_key: dnf-${{ inputs.version }}
|
||||||
|
if: inputs.enable_cache_dnf == 'true'
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: /cache/dnf
|
||||||
|
key: ${{ inputs.dnf_cache_key || env.dnf_cache_key }}
|
||||||
|
|
||||||
|
- name: Load skopeo cache
|
||||||
|
id: load_skopeo_cache
|
||||||
|
env:
|
||||||
|
skopeo_cache_key: skopeo-${{ inputs.image_name }}-${{ inputs.version || inputs.image_tag }}
|
||||||
|
if: inputs.enable_cache_skopeo == 'true'
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: /cache/skopeo
|
||||||
|
key: ${{ inputs.skopeo_cache_key || env.skopeo_cache_key }}
|
||||||
|
|
||||||
|
- name: Ensure cache directories exist
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir /cache/dnf || true
|
||||||
|
mkdir /cache/dnf_new || true
|
||||||
|
mkdir /cache/skopeo || true
|
||||||
|
|
||||||
|
- name: Determine Flatpak dependencies
|
||||||
|
if: inputs.enable_flatpak_dependencies == 'true' && (inputs.flatpak_remote_refs != '' || inputs.flatpak_remote_refs_dir != '')
|
||||||
|
id: flatpak_dependencies
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd ${{ github.action_path }}
|
||||||
|
make flatpaks/repo \
|
||||||
|
FLATPAK_REMOTE_NAME="${{ inputs.flatpak_remote_name }}" \
|
||||||
|
${{ inputs.flatpak_remote_refs && format('FLATPAK_REMOTE_REFS="{0}"', inputs.flatpak_remote_refs) || ''}} \
|
||||||
|
${{ inputs.flatpak_remote_refs_dir && format('FLATPAK_REMOTE_REFS_DIR="{0}/{1}"', github.workspace, inputs.flatpak_remote_refs_dir) || ''}} \
|
||||||
|
FLATPAK_REMOTE_URL="${{ inputs.flatpak_remote_url }}" \
|
||||||
|
IMAGE_NAME="${{ inputs.image_name }}" \
|
||||||
|
IMAGE_REPO="${{ inputs.image_repo }}" \
|
||||||
|
IMAGE_SRC="${{ inputs.image_src }}" \
|
||||||
|
IMAGE_TAG="${{ inputs.image_tag || inputs.version }}"
|
||||||
|
|
||||||
|
- name: Run docker image
|
||||||
|
id: docker
|
||||||
|
env:
|
||||||
|
ACTION_REPO: ${{ github.action_repository }}
|
||||||
|
ACTION_REF: ${{ github.action_ref }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
image=$(echo "ghcr.io/${ACTION_REPO}" | tr [:upper:] [:lower:])
|
||||||
|
# Check if running inside of the action repo
|
||||||
|
if [[ -z "${ACTION_REPO}" ]]
|
||||||
|
then
|
||||||
|
image=$(echo "ghcr.io/${{ github.repository }}" | tr [:upper:] [:lower:])
|
||||||
|
if [[ -n "${{ github.event.issue.number }}" ]]
|
||||||
|
then
|
||||||
|
tag="pr-${{ github.event.issue.number }}"
|
||||||
|
else
|
||||||
|
tag="${{ github.ref_name }}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
tag="${ACTION_REF}"
|
||||||
|
fi
|
||||||
|
if [[ "${{ inputs.enable_cache_dnf }}" == "true" ]]
|
||||||
|
then
|
||||||
|
cache="${cache} -v /cache/dnf:/cache/dnf"
|
||||||
|
fi
|
||||||
|
if [[ "${{ inputs.enable_cache_skopeo }}" == "true" ]]
|
||||||
|
then
|
||||||
|
cache="${cache} -v /cache/skopeo:/cache/skopeo"
|
||||||
|
fi
|
||||||
|
if [[ "${{ steps.load_dnf_cache.outputs.cache-hit }}" != "true" ]]
|
||||||
|
then
|
||||||
|
cache="${cache} -v /cache/dnf_new:/cache/dnf_new"
|
||||||
|
fi
|
||||||
|
vars=""
|
||||||
|
if [[ -n "${{ inputs.flatpak_remote_refs }}" ]] && [[ -n "${{ inputs.flatpak_remote_refs_dir }}" ]]
|
||||||
|
then
|
||||||
|
echo "ERROR: flatpak_remote_refs is mutually exclusive to flatpak_remote_refs_dir"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
docker run --privileged --volume ${{ github.workspace }}:/github/workspace/ ${cache} ${image}:${tag} \
|
||||||
|
${{ inputs.make_target }} \
|
||||||
|
ADDITIONAL_TEMPLATES="${{ inputs.additional_templates }}" \
|
||||||
|
ARCH="${{ inputs.arch }}" \
|
||||||
|
DNF_CACHE="/cache/dnf" \
|
||||||
|
ENROLLMENT_PASSWORD="${{ inputs.enrollment_password }}" \
|
||||||
|
EXTRA_BOOT_PARAMS="${{ inputs.extra_boot_params }}" \
|
||||||
|
FLATPAK_REMOTE_NAME="${{ inputs.flatpak_remote_name }}" \
|
||||||
|
${{ inputs.flatpak_remote_refs && format('FLATPAK_REMOTE_REFS="{0}"', inputs.flatpak_remote_refs) || ''}} \
|
||||||
|
${{ inputs.flatpak_remote_refs_dir && format('FLATPAK_REMOTE_REFS_DIR="/github/workspace/{0}"', inputs.flatpak_remote_refs_dir) || ''}} \
|
||||||
|
FLATPAK_REMOTE_URL="${{ inputs.flatpak_remote_url }}" \
|
||||||
|
FLATPAK_DIR="${{ steps.flatpak_dependencies.outputs.flatpak_dir && format('/github/workspace/{0}', steps.flatpak_dependencies.outputs.flatpak_dir) || '' }}" \
|
||||||
|
IMAGE_NAME="${{ inputs.image_name }}" \
|
||||||
|
IMAGE_REPO="${{ inputs.image_repo }}" \
|
||||||
|
IMAGE_SIGNED="${{ inputs.image_signed }}" \
|
||||||
|
IMAGE_SRC="${{ inputs.image_src }}" \
|
||||||
|
IMAGE_TAG="${{ inputs.image_tag || inputs.version }}" \
|
||||||
|
ISO_NAME=/github/workspace/${{ inputs.iso_name }} \
|
||||||
|
${{ inputs.repos && format('REPOS="{0}"', inputs.repos) || '' }} \
|
||||||
|
SECURE_BOOT_KEY_URL="${{ inputs.secure_boot_key_url }}" \
|
||||||
|
VARIANT="${{ inputs.variant }}" \
|
||||||
|
VERSION="${{ inputs.version }}" \
|
||||||
|
WEB_UI="${{ inputs.web_ui }}"
|
||||||
|
echo "iso_path=$(dirname ${{ inputs.iso_name }})" >> $GITHUB_OUTPUT
|
||||||
|
echo "iso_name=$(basename ${{ inputs.iso_name }})" >> $GITHUB_OUTPUT
|
||||||
|
if [[ "${{ steps.flatpak_dependencies.outputs.flatpak_dir }}" != '' ]]
|
||||||
|
then
|
||||||
|
echo "flatpak_refs=$(cat ${{ github.workspace }}/${{ steps.flatpak_dependencies.outputs.flatpak_dir }}/list.txt | tr '\n' ' ')" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
if [[ "${{ inputs.flatpak_remote_refs_dir }}" != '' ]]
|
||||||
|
then
|
||||||
|
echo "flatpak_refs=$(cat ${{ github.workspace }}/${{ inputs.flatpak_remote_refs_dir }}/* | tr '\n' ' ')" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "flatpak_refs=${{ inputs.flatpak_remote_refs}}" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Save dnf cache
|
||||||
|
env:
|
||||||
|
dnf_cache_key: dnf-${{ inputs.version }}
|
||||||
|
if: inputs.enable_cache_dnf == 'true' && steps.load_dnf_cache.outputs.cache-hit != 'true'
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: /cache/dnf_new
|
||||||
|
key: ${{ inputs.dnf_cache_key || env.dnf_cache_key }}
|
||||||
|
|
||||||
|
- name: Save skopeo cache
|
||||||
|
env:
|
||||||
|
skopeo_cache_key: skopeo-${{ inputs.image_name }}-${{ inputs.version || inputs.image_tag }}
|
||||||
|
if: inputs.enable_cache_skopeo == 'true' && steps.load_dnf_cache.outputs.cache-hit != 'true'
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: /cache/skopeo
|
||||||
|
key: ${{ inputs.skopeo_cache_key || env.skopeo_cache_key }}
|
||||||
|
|
|
||||||
11
container/Makefile
Normal file
11
container/Makefile
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
$(IMAGE_NAME)-$(IMAGE_TAG):
|
||||||
|
skopeo copy $(if $(IMAGE_SRC),$(IMAGE_SRC),docker://$(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)) oci:$(IMAGE_NAME)-$(IMAGE_TAG)
|
||||||
|
|
||||||
|
install-deps:
|
||||||
|
$(install_pkg) skopeo
|
||||||
|
|
||||||
|
FILES=$(filter-out Makefile,$(wildcard *))
|
||||||
|
clean:
|
||||||
|
ifneq ($(FILES),)
|
||||||
|
rm -Rf $(FILES)
|
||||||
|
endif
|
||||||
4
cosign.pub
Normal file
4
cosign.pub
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
-----BEGIN PUBLIC KEY-----
|
||||||
|
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEY4ljyIhI2w9DOptB4WT20S+K5ts3
|
||||||
|
GJTEKRkXmIYEXGfyKpJMdlGCWeg2kOam5dNhWKXXl46d3eBBo9S53TPpyQ==
|
||||||
|
-----END PUBLIC KEY-----
|
||||||
12
docs/Makefile
Normal file
12
docs/Makefile
Normal file
|
|
@ -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
docs/README.md
Normal file
1
docs/README.md
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
These are the files for the [wiki](https://github.com/JasonN3/build-container-installer/wiki)
|
||||||
11
docs/_Sidebar.md
Normal file
11
docs/_Sidebar.md
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
- [Home](home.md)
|
||||||
|
- [Usage](usage.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)
|
||||||
|
|
||||||
|
- [Known Errors](known_errors.md)
|
||||||
22
docs/development/container.md
Normal file
22
docs/development/container.md
Normal file
|
|
@ -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#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
docs/development/makefile.md
Normal file
7
docs/development/makefile.md
Normal file
|
|
@ -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#inputs) for information about the available parameters. All variables should be specified in CAPITALIZED form.
|
||||||
46
docs/development/vscode.md
Normal file
46
docs/development/vscode.md
Normal file
|
|
@ -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
docs/examples/adding-flatpaks.md
Normal file
74
docs/examples/adding-flatpaks.md
Normal file
|
|
@ -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"
|
||||||
|
```
|
||||||
14
docs/home.md
Normal file
14
docs/home.md
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
Welcome to the build-container-installer wiki!
|
||||||
|
|
||||||
|
## Index
|
||||||
|
|
||||||
|
- [Usage](usage.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)
|
||||||
|
|
||||||
|
- [Known Errors](known_errors.md)
|
||||||
7
docs/known_errors.md
Normal file
7
docs/known_errors.md
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# Known Errors
|
||||||
|
|
||||||
|
This page describes known errors and how to resolve them.
|
||||||
|
|
||||||
|
## failed to write boot loader configuration
|
||||||
|
|
||||||
|
Add `RUN bootupctl backend generate-update-metadata` at the end of your Dockerfile/Containerfile
|
||||||
68
docs/usage.md
Normal file
68
docs/usage.md
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
# 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_name }}
|
||||||
|
${{ steps.build.outputs.iso_path }}/${{ steps.build.outputs.iso_name }}-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 | <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 path to the resulting .iso | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_path }} |
|
||||||
|
|
@ -2,24 +2,18 @@
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
for entry in $@
|
# Create /dev/loop0 if it doesn't already exist. `losetup` has an issue creating it during the first run
|
||||||
do
|
mknod -m 0660 /dev/loop0 b 7 0 2>/dev/null || true
|
||||||
export $entry
|
|
||||||
done
|
|
||||||
|
|
||||||
# Pull container
|
if [[ -d /cache/skopeo ]]
|
||||||
make container/${IMAGE_NAME}-${IMAGE_TAG} $@
|
then
|
||||||
|
ln -s /cache/skopeo /build-container-installer/container
|
||||||
|
fi
|
||||||
|
|
||||||
# Build base ISO
|
if [[ ! -d /cache/dnf ]]
|
||||||
make boot.iso $@
|
then
|
||||||
|
mkdir /cache/dnf
|
||||||
# Add container to ISO
|
fi
|
||||||
make build/deploy.iso $@
|
|
||||||
|
|
||||||
# Make output dir in github workspace
|
|
||||||
mkdir /github/workspace/build || true
|
|
||||||
|
|
||||||
# Copy resulting iso to github workspace and fix permissions
|
|
||||||
cp build/deploy.iso /github/workspace/build
|
|
||||||
chmod -R ugo=rwX /github/workspace/build
|
|
||||||
|
|
||||||
|
# Run make command
|
||||||
|
make "$@"
|
||||||
|
|
|
||||||
12
external/Makefile
vendored
Normal file
12
external/Makefile
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
lorax/branch-$(VERSION):
|
||||||
|
git config advice.detachedHead false
|
||||||
|
cd lorax && git reset --hard HEAD && git checkout $(if $(_RHEL),rhel$(word 1,$(subst ., ,$(VERSION)))-branch,tags/$(shell cd lorax && git tag -l lorax-$(VERSION).* --sort=creatordate | grep -v 'lorax-40\.5' | tail -n 1))
|
||||||
|
touch lorax/branch-$(VERSION)
|
||||||
|
|
||||||
|
install-deps:
|
||||||
|
# Used by external/fedora-lorax-templates/ostree-based-installer/lorax-embed-flatpaks.tmpl
|
||||||
|
$(install_pkg) flatpak dbus-daemon ostree
|
||||||
|
# Used to clone proper lorax branch
|
||||||
|
$(install_pkg) git
|
||||||
|
|
||||||
|
clean:
|
||||||
1
external/fedora-lorax-templates
vendored
Submodule
1
external/fedora-lorax-templates
vendored
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit cc1155372046baa58f9d2cc27a9e5473bf05a3fb
|
||||||
1
external/lorax
vendored
Submodule
1
external/lorax
vendored
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit ffba3078beab843c5d663f6443dca28d8e820948
|
||||||
1
flatpak_refs/Firefox
Normal file
1
flatpak_refs/Firefox
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
app/org.mozilla.firefox/x86_64/stable
|
||||||
1
flatpak_refs/VLC
Normal file
1
flatpak_refs/VLC
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
app/org.videolan.VLC/x86_64/stable
|
||||||
43
flatpaks/Makefile
Normal file
43
flatpaks/Makefile
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
IMAGE := $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
|
||||||
|
FLATPAK_DIR := $(if $(GITHUB_WORKSPACE),$(shell mktemp -d -p $(GITHUB_WORKSPACE) flatpak.XXX),$(PWD)/flatpaks)
|
||||||
|
|
||||||
|
.PHONY: full_list
|
||||||
|
full_list: repo
|
||||||
|
cat $(FLATPAK_DIR)/list.txt >&2
|
||||||
|
|
||||||
|
|
||||||
|
repo: script.sh
|
||||||
|
$(if $(GITHUB_WORKSPACE),cp script.sh $(FLATPAK_DIR)/)
|
||||||
|
docker run --rm --privileged --entrypoint bash -e FLATPAK_SYSTEM_DIR=/flatpak/flatpak -e FLATPAK_TRIGGERSDIR=/flatpak/triggers --volume $(FLATPAK_DIR):/flatpak_dir $(IMAGE) /flatpak_dir/script.sh
|
||||||
|
$(if $(GITHUB_OUTPUT),echo "flatpak_dir=$(subst $(GITHUB_WORKSPACE)/,,$(FLATPAK_DIR))" >> $(GITHUB_OUTPUT))
|
||||||
|
docker rmi $(IMAGE)
|
||||||
|
|
||||||
|
script.sh:
|
||||||
|
cat << EOF > script.sh
|
||||||
|
which flatpak &> /dev/null || dnf install -y flatpak
|
||||||
|
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 | tee /flatpak_dir/list.txt
|
||||||
|
EOF
|
||||||
|
|
||||||
|
install-deps:
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(if $(wildcard script.sh),rm script.sh)
|
||||||
|
$(if $(wildcard repo),rm -Rf repo)
|
||||||
|
$(if $(wildcard list.txt),rm list.txt)
|
||||||
|
|
||||||
|
.ONESHELL:
|
||||||
52
lorax_templates/Makefile
Normal file
52
lorax_templates/Makefile
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
# Converts a post script to a template
|
||||||
|
# $1 = script to convert
|
||||||
|
# $2 = file on ISO to write
|
||||||
|
# $3 = whether to copy the '<%' lines to the template
|
||||||
|
define convert_post_to_tmpl
|
||||||
|
header=0; \
|
||||||
|
skip=0; \
|
||||||
|
while read -r line; \
|
||||||
|
do \
|
||||||
|
if [[ $$line =~ ^\<\% ]]; \
|
||||||
|
then \
|
||||||
|
if [[ '$(3)' == 'true' ]]; \
|
||||||
|
then \
|
||||||
|
echo $$line >> post_$(1).tmpl; \
|
||||||
|
fi; \
|
||||||
|
echo >> post_$(1).tmpl; \
|
||||||
|
else \
|
||||||
|
if [[ $$header == 0 ]]; \
|
||||||
|
then \
|
||||||
|
if [[ $$line =~ ^\#\#\ (.*)$$ ]]; \
|
||||||
|
then \
|
||||||
|
echo "append $(2) \"%post --erroronfail $${BASH_REMATCH[1]}\"" >> post_$(1).tmpl; \
|
||||||
|
skip=1; \
|
||||||
|
else \
|
||||||
|
echo "append $(2) \"%post --erroronfail\"" >> post_$(1).tmpl; \
|
||||||
|
fi; \
|
||||||
|
header=1; \
|
||||||
|
fi; \
|
||||||
|
if [[ $$skip == 0 ]]; \
|
||||||
|
then \
|
||||||
|
echo "append $(2) \"$${line//\"/\\\"}\"" >> post_$(1).tmpl; \
|
||||||
|
fi; \
|
||||||
|
skip=0; \
|
||||||
|
fi; \
|
||||||
|
done < scripts/post/$(1); \
|
||||||
|
echo "append $(2) \"%end\"" >> post_$(1).tmpl
|
||||||
|
endef
|
||||||
|
|
||||||
|
post_%.tmpl: scripts/post/%
|
||||||
|
$(call convert_post_to_tmpl,$*,usr/share/anaconda/post-scripts/$*.ks,true)
|
||||||
|
|
||||||
|
install_include_post.tmpl:
|
||||||
|
echo '<%page />' > install_include_post.tmpl
|
||||||
|
for file in $(patsubst post_%.tmpl, %, $(filter post_%, $(notdir $(_LORAX_TEMPLATES)))); do echo "append usr/share/anaconda/interactive-defaults.ks \"%include /usr/share/anaconda/post-scripts/$${file}.ks\"" >> install_include_post.tmpl; done
|
||||||
|
|
||||||
|
install-deps:
|
||||||
|
|
||||||
|
FILES=$(wildcard post_*) install_include_post.tmpl
|
||||||
|
clean:
|
||||||
|
ifneq ($(FILES),)
|
||||||
|
rm -Rf $(FILES)
|
||||||
|
endif
|
||||||
3
lorax_templates/cache_copy_dnf.tmpl
Normal file
3
lorax_templates/cache_copy_dnf.tmpl
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<%page args="dnf_cache"/>
|
||||||
|
|
||||||
|
runcmd bash -c "if [[ -e ${dnf_cache}_new ]]; then cp -R ${dnf_cache}/* ${dnf_cache}_new/; fi"
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
append usr/share/anaconda/interactive-defaults.ks "%post --erroronfail"
|
|
||||||
append usr/share/anaconda/interactive-defaults.ks "sed -i 's/container-image-reference=.*/container-image-reference=ostree-image-signed:docker:\/\/${_IMAGE_REPO_DOUBLE_ESCAPED}\/${IMAGE_NAME}:${IMAGE_TAG}/' /ostree/deploy/default/deploy/*.origin"
|
|
||||||
append usr/share/anaconda/interactive-defaults.ks "%end"
|
|
||||||
|
|
||||||
append usr/share/anaconda/post-scripts/configure_upgrades.ks "%post --erroronfail"
|
|
||||||
append usr/share/anaconda/post-scripts/configure_upgrades.ks "sed -i 's/container-image-reference=.*/container-image-reference=ostree-image-signed:docker:\/\/${_IMAGE_REPO_DOUBLE_ESCAPED}\/${IMAGE_NAME}:${IMAGE_TAG}/' /ostree/deploy/default/deploy/*.origin"
|
|
||||||
append usr/share/anaconda/post-scripts/configure_upgrades.ks "%end"
|
|
||||||
|
|
||||||
5
lorax_templates/flatpak_link.tmpl
Normal file
5
lorax_templates/flatpak_link.tmpl
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<%page args="flatpak_dir"/>
|
||||||
|
|
||||||
|
%if flatpak_dir != "":
|
||||||
|
symlink /run/install/repo/flatpak /flatpak
|
||||||
|
%endif
|
||||||
8
lorax_templates/flatpak_set_repo.tmpl
Normal file
8
lorax_templates/flatpak_set_repo.tmpl
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<%page args="flatpak_remote_name, _flatpak_repo_url, version"/>
|
||||||
|
% if int(version) >= 41:
|
||||||
|
append etc/anaconda/conf.d/anaconda.conf "[Payload]"
|
||||||
|
append etc/anaconda/conf.d/anaconda.conf "flatpak_remote = ${flatpak_remote_name} ${_flatpak_repo_url}"
|
||||||
|
% else:
|
||||||
|
replace "flatpak_manager\.add_remote\(\".*\", \".*\"\)" "flatpak_manager.add_remote(\"${flatpak_remote_name}\", \"${_flatpak_repo_url}\")" /usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py
|
||||||
|
replace "flatpak_manager\.replace_installed_refs_remote\(\".*\"\)" "flatpak_manager.replace_installed_refs_remote(\"${flatpak_remote_name}\")" /usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py
|
||||||
|
% endif
|
||||||
4
lorax_templates/install_set_installer.tmpl
Normal file
4
lorax_templates/install_set_installer.tmpl
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<%page args="image_name, image_tag"/>
|
||||||
|
|
||||||
|
append usr/share/anaconda/interactive-defaults.ks "ostreecontainer --url=/run/install/repo/${image_name}-${image_tag} --transport=oci --no-signature-verification"
|
||||||
|
|
||||||
16
lorax_templates/scripts/post/flatpak_configure
Normal file
16
lorax_templates/scripts/post/flatpak_configure
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
<%page args="_flatpak_repo_gpg, flatpak_remote_name"/>
|
||||||
|
|
||||||
|
if [[ -d /ostree/deploy/default/var/lib/flatpak/repo ]]
|
||||||
|
then
|
||||||
|
echo ${_flatpak_repo_gpg} | base64 -d > /ostree/deploy/default/var/lib/flatpak/repo/flathub.trustedkeys.gpg
|
||||||
|
elif [[ -d /var/lib/flatpak/repo ]]
|
||||||
|
then
|
||||||
|
echo ${_flatpak_repo_gpg} | base64 -d > /var/lib/flatpak/repo/flathub.trustedkeys.gpg
|
||||||
|
else
|
||||||
|
echo "Could not find Flatpaks repo"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${flatpak_remote_name}" != 'fedora' ]]
|
||||||
|
then
|
||||||
|
systemctl disable flatpak-add-fedora-repos.service
|
||||||
|
fi
|
||||||
18
lorax_templates/scripts/post/install_configure_upgrades
Normal file
18
lorax_templates/scripts/post/install_configure_upgrades
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<%page args="image_repo, _image_repo_double_escaped, image_name, image_signed, image_tag, _rhel, version"/>
|
||||||
|
|
||||||
|
if (which bootc &> /dev/null) && [ ${_rhel} == 'false' && ${version} -ge 39 ]
|
||||||
|
then
|
||||||
|
if [ ${image_signed} == 'true' ]
|
||||||
|
then
|
||||||
|
bootc switch --mutate-in-place --enforce-container-sigpolicy --transport registry ${image_repo}/${image_name}:${image_tag}
|
||||||
|
else
|
||||||
|
bootc switch --mutate-in-place --transport registry ${image_repo}/${image_name}:${image_tag}
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ ${image_signed} == 'true' ]
|
||||||
|
then
|
||||||
|
sed -i 's/container-image-reference=.*/container-image-reference=ostree-image-signed:docker:\/\/${_image_repo_double_escaped}\/${image_name}:${image_tag}/' /ostree/deploy/default/deploy/*.origin
|
||||||
|
else
|
||||||
|
sed -i 's/container-image-reference=.*/container-image-reference=ostree-unverified-image:docker:\/\/${_image_repo_double_escaped}\/${image_name}:${image_tag}/' /ostree/deploy/default/deploy/*.origin
|
||||||
|
fi
|
||||||
|
fi
|
||||||
26
lorax_templates/scripts/post/secureboot_enroll_key
Executable file
26
lorax_templates/scripts/post/secureboot_enroll_key
Executable file
|
|
@ -0,0 +1,26 @@
|
||||||
|
<%page args="enrollment_password"/>
|
||||||
|
## --nochroot
|
||||||
|
|
||||||
|
set -oue pipefail
|
||||||
|
|
||||||
|
readonly ENROLLMENT_PASSWORD=${enrollment_password}
|
||||||
|
readonly SECUREBOOT_KEY="/run/install/repo/sb_pubkey.der"
|
||||||
|
|
||||||
|
if [[ ! -d "/sys/firmware/efi" ]]; then
|
||||||
|
echo "EFI mode not detected. Skipping key enrollment."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -f "$SECUREBOOT_KEY" ]]; then
|
||||||
|
echo "Secure boot key not provided: $SECUREBOOT_KEY"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
SYS_ID="$(cat /sys/devices/virtual/dmi/id/product_name)"
|
||||||
|
if [[ ":Jupiter:Galileo:" =~ ":$SYS_ID:" ]]; then
|
||||||
|
echo "Steam Deck hardware detected. Skipping key enrollment."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
mokutil --timeout -1 || :
|
||||||
|
echo -e "$ENROLLMENT_PASSWORD\n$ENROLLMENT_PASSWORD" | mokutil --import "$SECUREBOOT_KEY" || :
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
append usr/share/anaconda/interactive-defaults.ks "ostreecontainer --url=/run/install/repo/${IMAGE_NAME}-${IMAGE_TAG} --transport=oci --no-signature-verification"
|
|
||||||
|
|
||||||
15
repos/Makefile
Normal file
15
repos/Makefile
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
repos: $(_REPO_FILES)
|
||||||
|
|
||||||
|
# Step 2: Replace vars in repo files
|
||||||
|
%.repo: /etc/yum.repos.d/%.repo
|
||||||
|
cp /etc/yum.repos.d/$*.repo $*.repo
|
||||||
|
sed -i "s/\$$releasever/$(VERSION)/g" $*.repo
|
||||||
|
sed -i "s/\$$basearch/$(ARCH)/g" $*.repo
|
||||||
|
|
||||||
|
install-deps:
|
||||||
|
|
||||||
|
FILES=$(wildcard *.repo)
|
||||||
|
clean:
|
||||||
|
ifneq ($(FILES),)
|
||||||
|
rm -Rf $(FILES)
|
||||||
|
endif
|
||||||
23
test/Makefile
Normal file
23
test/Makefile
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
all: $(filter-out README.md Makefile,$(wildcard *))
|
||||||
|
|
||||||
|
$(filter-out README.md Makefile,$(wildcard *)):
|
||||||
|
$(eval DIR=$(firstword $(subst /, ,$@)))
|
||||||
|
$(MAKE) -w -C $(DIR)
|
||||||
|
|
||||||
|
$(filter-out README.md Makefile,$(wildcard */*)):
|
||||||
|
$(eval DIR=$(firstword $(subst /, ,$@)))
|
||||||
|
$(eval TARGET=$(subst $(DIR)/,,$@))
|
||||||
|
$(MAKE) -w -C $(DIR) $(TARGET)
|
||||||
|
|
||||||
|
.DEFAULT:
|
||||||
|
$(eval DIR=$(firstword $(subst /, ,$@)))
|
||||||
|
$(if $(filter-out $(DIR),$@), $(eval TARGET=$(subst $(DIR)/,,$@)),$(eval TARGET=))
|
||||||
|
$(MAKE) -w -C $(DIR) $(TARGET)
|
||||||
|
|
||||||
|
install-deps:
|
||||||
|
$(foreach DIR,$(filter-out README.md Makefile,$(wildcard *)),$(MAKE) -w -C $(DIR) install-deps;)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(foreach DIR,$(filter-out README.md Makefile,$(wildcard *)),$(MAKE) -w -C $(DIR) clean;)
|
||||||
|
|
||||||
|
.PHONY: all $(filter-out README.md Makefile,$(wildcard *)) $(filter-out README.md Makefile,$(wildcard */*))
|
||||||
25
test/iso/Makefile
Normal file
25
test/iso/Makefile
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
ISO_NAME=deploy.iso
|
||||||
|
ISO_TESTS=$(wildcard install_*) $(if $(FLATPAK_REMOTE_REFS),$(wildcard flatpak_*))$(if $(FLATPAK_DIR),$(wildcard flatpak_*))
|
||||||
|
|
||||||
|
all: $(ISO_TESTS) clean
|
||||||
|
|
||||||
|
$(ISO_TESTS): mnt/iso
|
||||||
|
$(eval _VARS = ISO_NAME VERSION FLATPAK_REMOTE_NAME _FLATPAK_REPO_URL)
|
||||||
|
chmod +x $@
|
||||||
|
$(foreach var,$(_VARS),$(var)=$($(var))) ./$@
|
||||||
|
|
||||||
|
mnt/iso:
|
||||||
|
sudo modprobe loop
|
||||||
|
sudo mkdir -p mnt/iso mnt/install
|
||||||
|
sudo mount -o loop ../../$(ISO_NAME) mnt/iso
|
||||||
|
sudo mount -t squashfs -o loop mnt/iso/images/install.img mnt/install
|
||||||
|
|
||||||
|
clean:
|
||||||
|
sudo umount mnt/install || true
|
||||||
|
sudo umount mnt/iso || true
|
||||||
|
sudo rmdir mnt/install mnt/iso
|
||||||
|
|
||||||
|
install-deps:
|
||||||
|
$(install_pkg) isomd5sum coreutils squashfs-tools curl
|
||||||
|
|
||||||
|
.PHONY: all $(ISO_TESTS) clean
|
||||||
1
test/iso/README.md
Normal file
1
test/iso/README.md
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Place scripts that will test the ISO. The ISO file will be passed as the first argument
|
||||||
54
test/iso/flatpak_repo_updated.sh
Normal file
54
test/iso/flatpak_repo_updated.sh
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ ${VERSION} -ge 41 ]]
|
||||||
|
then
|
||||||
|
result=0
|
||||||
|
grep "^\[Payload\]" mnt/install/etc/anaconda/conf.d/anaconda.conf > /dev/null || {
|
||||||
|
echo "Missing [Payload] header"
|
||||||
|
result=1
|
||||||
|
}
|
||||||
|
grep "^flatpak_remote = ${FLATPAK_REMOTE_NAME} ${_FLATPAK_REPO_URL}" mnt/install/etc/anaconda/conf.d/anaconda.conf > /dev/null || {
|
||||||
|
echo "Missing flatpak_remote option"
|
||||||
|
result=1
|
||||||
|
}
|
||||||
|
exit ${result}
|
||||||
|
fi
|
||||||
|
|
||||||
|
add_line=$(grep flatpak_manager.add_remote mnt/install/usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py)
|
||||||
|
|
||||||
|
add_line_repo=$(echo "${add_line}" | grep "${FLATPAK_REMOTE_NAME}")
|
||||||
|
add_line_url=$(echo "${add_line}" | grep "${_FLATPAK_REPO_URL}")
|
||||||
|
|
||||||
|
result=0
|
||||||
|
if [ -z "${add_line_repo}" ]
|
||||||
|
then
|
||||||
|
echo "Repo name not updated on add_remote line"
|
||||||
|
echo "${add_line}"
|
||||||
|
result=1
|
||||||
|
else
|
||||||
|
echo "Repo name found on add_remote line"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${add_line_url}" ]
|
||||||
|
then
|
||||||
|
echo "Repo url not updated on add_remote line"
|
||||||
|
echo "${add_line}"
|
||||||
|
result=1
|
||||||
|
else
|
||||||
|
echo "Repo url found on add_remote line"
|
||||||
|
fi
|
||||||
|
|
||||||
|
replace_line=$(grep flatpak_manager.replace_installed_refs_remote mnt/install/usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py)
|
||||||
|
|
||||||
|
replace_line_repo=$(echo "${replace_line}" | grep "${FLATPAK_REMOTE_NAME}")
|
||||||
|
|
||||||
|
if [ -z "${replace_line_repo}" ]
|
||||||
|
then
|
||||||
|
echo "Repo name not updated on replace_installed_refs line"
|
||||||
|
echo "${replace_line}"
|
||||||
|
result=1
|
||||||
|
else
|
||||||
|
echo "Repo name found on replace_installed_refs line"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit ${result}
|
||||||
14
test/iso/install_hash.sh
Normal file
14
test/iso/install_hash.sh
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#set -ex
|
||||||
|
|
||||||
|
checkisomd5 "../../${ISO_NAME}"
|
||||||
|
if [[ $? != 0 ]]
|
||||||
|
then
|
||||||
|
echo "Found:"
|
||||||
|
checkisomd5 --md5sumonly "../../${ISO_NAME}"
|
||||||
|
echo "Expected:"
|
||||||
|
implantisomd5 --force "../../${ISO_NAME}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$(dirname "../../${ISO_NAME}")" && sha256sum -c "$(basename "${ISO_NAME}")-CHECKSUM"
|
||||||
14
test/iso/install_os-release.sh
Normal file
14
test/iso/install_os-release.sh
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
FOUND_VERSION=$(grep VERSION_ID mnt/install/etc/os-release | cut -d= -f2 | tr -d '"')
|
||||||
|
|
||||||
|
if [[ ${FOUND_VERSION} != ${VERSION} ]]
|
||||||
|
then
|
||||||
|
echo "Version mismatch"
|
||||||
|
echo "Expected: ${VERSION}"
|
||||||
|
echo "Found: ${FOUND_VERSION}"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "Correct version found"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
11
test/repo/Makefile
Normal file
11
test/repo/Makefile
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
REPO_TESTS=$(filter-out README.md Makefile,$(wildcard *))
|
||||||
|
|
||||||
|
all: $(REPO_TESTS)
|
||||||
|
|
||||||
|
$(REPO_TESTS):
|
||||||
|
chmod +x $@
|
||||||
|
./$@
|
||||||
|
|
||||||
|
install-deps:
|
||||||
|
|
||||||
|
.PHONY: $(REPO_TESTS)
|
||||||
122
test/repo/vars.py
Executable file
122
test/repo/vars.py
Executable file
|
|
@ -0,0 +1,122 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
makefile = open('../../Makefile.inputs', 'r')
|
||||||
|
makefile_lines = makefile.readlines()
|
||||||
|
|
||||||
|
inputs = {}
|
||||||
|
outputs = {}
|
||||||
|
errors = 0
|
||||||
|
|
||||||
|
for line in makefile_lines:
|
||||||
|
if line.startswith('#'):
|
||||||
|
makefile_lines.remove(line)
|
||||||
|
continue
|
||||||
|
parts = line.split('=', 1)
|
||||||
|
if parts[0].startswith('export'):
|
||||||
|
var_name = parts[0].strip().split(' ')[1].lower()
|
||||||
|
else:
|
||||||
|
var_name = parts[0].strip().lower()
|
||||||
|
inputs[var_name] = {'default_value': parts[1].strip(), 'makefile': True}
|
||||||
|
|
||||||
|
action = open('../../action.yml', 'r')
|
||||||
|
action_lines = action.readlines()
|
||||||
|
|
||||||
|
at_inputs = False
|
||||||
|
at_outputs = False
|
||||||
|
for line in action_lines:
|
||||||
|
if not at_inputs:
|
||||||
|
if line.strip() == 'inputs:':
|
||||||
|
at_inputs = True
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
if line.startswith(' '):
|
||||||
|
parts = line.strip().split(':', 1)
|
||||||
|
if parts[0] == 'description':
|
||||||
|
inputs[var_name]['description'] = parts[1].strip()
|
||||||
|
if parts[0] == 'deprecationMessage':
|
||||||
|
inputs[var_name]['deprecated'] = True
|
||||||
|
if parts[0] == 'default':
|
||||||
|
if 'default' in inputs[var_name]:
|
||||||
|
if inputs[var_name]['default_value'] != parts[1].strip().strip('"'):
|
||||||
|
print("ERROR: Default value for " + var_name + " in action.yml does not match Makefile")
|
||||||
|
errors += 1
|
||||||
|
else:
|
||||||
|
inputs[var_name]['default_value'] = parts[1].strip().strip('"')
|
||||||
|
elif line.startswith(' '):
|
||||||
|
var_name = line.strip().strip(':').lower()
|
||||||
|
if not var_name in inputs:
|
||||||
|
inputs[var_name] = {}
|
||||||
|
inputs[var_name]['action'] = True
|
||||||
|
else:
|
||||||
|
at_inputs = False
|
||||||
|
|
||||||
|
if not at_outputs:
|
||||||
|
if line.strip() == 'outputs:':
|
||||||
|
at_outputs = True
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
if line.startswith(' '):
|
||||||
|
parts = line.strip().split(':', 1)
|
||||||
|
if parts[0] == 'description':
|
||||||
|
outputs[var_name]['description'] = parts[1].strip()
|
||||||
|
if parts[0] == 'deprecationMessage':
|
||||||
|
outputs[var_name]['deprecated'] = True
|
||||||
|
if parts[0] == 'default':
|
||||||
|
outputs[var_name]['default_value'] = parts[1].strip().strip('"')
|
||||||
|
elif line.startswith(' '):
|
||||||
|
var_name = line.strip().strip(':').lower()
|
||||||
|
outputs[var_name] = {}
|
||||||
|
else:
|
||||||
|
at_outputs = False
|
||||||
|
|
||||||
|
|
||||||
|
readme = open('../../README.md', 'r')
|
||||||
|
readme_lines = readme.readlines()
|
||||||
|
|
||||||
|
at_inputs = False
|
||||||
|
skip_header = True
|
||||||
|
at_outputs = False
|
||||||
|
for line in readme_lines:
|
||||||
|
if not at_inputs:
|
||||||
|
if line.strip() == '### Inputs':
|
||||||
|
at_inputs = True
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
if skip_header:
|
||||||
|
if line.startswith('| -----'):
|
||||||
|
skip_header = False
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
if not line.startswith('|'):
|
||||||
|
at_inputs = False
|
||||||
|
continue
|
||||||
|
parts = line.split('|')
|
||||||
|
var_name = parts[1].strip().lower()
|
||||||
|
if not var_name in inputs:
|
||||||
|
print("ERROR: " + var_name + " is not listed in action.yml or Makefile")
|
||||||
|
errors += 1
|
||||||
|
continue
|
||||||
|
if 'description' in inputs[var_name]:
|
||||||
|
if parts[2].strip().strip('\*') != inputs[var_name]['description']:
|
||||||
|
print("WARNING: " + var_name + " description in README.md does not match action.yml")
|
||||||
|
if 'default_value' in inputs[var_name]:
|
||||||
|
if not parts[3].strip().strip('"<>').startswith('*'):
|
||||||
|
if inputs[var_name]['default_value'] == "":
|
||||||
|
if parts[3].strip().strip('"') != '\\[empty\\]':
|
||||||
|
print("ERROR: " + var_name + " default value in README.md does not match action.yml")
|
||||||
|
print("Found " + parts[3].strip().strip('"<>'))
|
||||||
|
print("Expected " + inputs[var_name]['default_value'])
|
||||||
|
errors += 1
|
||||||
|
elif parts[3].strip().strip('"<>') != inputs[var_name]['default_value']:
|
||||||
|
print("ERROR: " + var_name + " default value in README.md does not match action.yml")
|
||||||
|
print("Found " + parts[3].strip().strip('"<>'))
|
||||||
|
print("Expected " + inputs[var_name]['default_value'])
|
||||||
|
errors += 1
|
||||||
|
if 'action' in inputs[var_name] and inputs[var_name]['action']:
|
||||||
|
if parts[4].strip() != ':white_check_mark:':
|
||||||
|
print("WARNING: " + var_name + " not labeled as in action.yml in the README.md")
|
||||||
|
if 'makefile' in inputs[var_name] and inputs[var_name]['makefile']:
|
||||||
|
if parts[4].strip() != ':white_check_mark:':
|
||||||
|
print("WARNING: " + var_name + " not labeled as in Makefile in the README.md")
|
||||||
|
|
||||||
|
exit(errors)
|
||||||
100
test/vm/Makefile
Normal file
100
test/vm/Makefile
Normal file
|
|
@ -0,0 +1,100 @@
|
||||||
|
VM_TESTS=$(wildcard install_*) $(if $(FLATPAK_REMOTE_REFS),$(wildcard flatpak_*))$(if $(FLATPAK_DIR),$(wildcard flatpak_*))
|
||||||
|
|
||||||
|
all: $(VM_TESTS) clean
|
||||||
|
|
||||||
|
$(VM_TESTS): start_vm ansible_inventory
|
||||||
|
$(eval _VARS = IMAGE_REPO IMAGE_NAME IMAGE_TAG)
|
||||||
|
|
||||||
|
ansible -i ansible_inventory -m ansible.builtin.wait_for_connection vm
|
||||||
|
|
||||||
|
chmod +x $@
|
||||||
|
$(foreach var,$(_VARS),$(var)=$($(var))) ./$@
|
||||||
|
|
||||||
|
ansible_inventory:
|
||||||
|
echo "ungrouped:" > ansible_inventory
|
||||||
|
echo " hosts:" >> ansible_inventory
|
||||||
|
echo " vm:" >> ansible_inventory
|
||||||
|
echo " ansible_host: $(VM_IP)" >> ansible_inventory
|
||||||
|
echo " ansible_port: $(VM_PORT)" >> ansible_inventory
|
||||||
|
echo " ansible_user: $(VM_USER)" >> ansible_inventory
|
||||||
|
echo " ansible_password: $(VM_PASS)" >> ansible_inventory
|
||||||
|
echo " ansible_become_pass: $(VM_PASS)" >> ansible_inventory
|
||||||
|
echo " ansible_ssh_common_args: '-o StrictHostKeyChecking=no'" >> ansible_inventory
|
||||||
|
|
||||||
|
.PHONY: $(VM_TESTS) install-deps
|
||||||
|
|
||||||
|
install-deps:
|
||||||
|
$(install_pkg) qemu-system qemu-utils xorriso qemu-system-x86 ncat socat jq ansible curl
|
||||||
|
|
||||||
|
files/mnt/iso:
|
||||||
|
$(if $(wildcard files/mnt),,mkdir files/mnt)
|
||||||
|
$(if $(wildcard files/mnt/iso),,mkdir files/mnt/iso)
|
||||||
|
sudo mount -o loop ../../$(ISO_NAME) files/mnt/iso
|
||||||
|
|
||||||
|
files/grub.cfg: files/mnt/iso
|
||||||
|
cp files/mnt/iso/$(if $(_RHEL),isolinux/grub.conf,boot/grub2/grub.cfg) files/grub.cfg
|
||||||
|
sed -i 's/quiet/console=ttyS0,115200n8 inst.ks=cdrom:\/ks.cfg/' files/grub.cfg
|
||||||
|
sed -i 's/set default="1"/set default="0"/' files/grub.cfg
|
||||||
|
sed -i 's/set timeout=60/set timeout=1/' files/grub.cfg
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
$(if $(wildcard start_vm), kill "$(shell cat start_vm)")
|
||||||
|
$(if $(wildcard files/mnt/iso),sudo umount files/mnt/iso)
|
||||||
|
$(if $(wildcard files/mnt/iso),rmdir files/mnt/iso)
|
||||||
|
$(if $(wildcard ansible_inventory),rm ansible_inventory)
|
||||||
|
$(if $(wildcard files/install.iso),rm files/install.iso)
|
||||||
|
$(if $(wildcard files/disk.qcow2),rm files/disk.qcow2)
|
||||||
|
$(if $(wildcard install_os),rm install_os)
|
||||||
|
$(if $(wildcard start_vm),rm start_vm)
|
||||||
|
|
||||||
|
files/install.iso: files/grub.cfg
|
||||||
|
xorriso -dialog on << EOF
|
||||||
|
-indev ../../$(ISO_NAME)
|
||||||
|
-outdev files/install.iso
|
||||||
|
-boot_image any replay
|
||||||
|
-joliet on
|
||||||
|
-compliance joliet_long_names
|
||||||
|
-map files/ks.cfg ks.cfg
|
||||||
|
-chmod 0444 ks.cfg
|
||||||
|
-map files/grub.cfg $(if $(_RHEL),isolinux/grub.conf,boot/grub2/grub.cfg)
|
||||||
|
-end
|
||||||
|
EOF
|
||||||
|
|
||||||
|
files/disk.qcow2:
|
||||||
|
qemu-img create -f qcow2 files/disk.qcow2 50G
|
||||||
|
|
||||||
|
install_os: files/install.iso files/disk.qcow2
|
||||||
|
timeout 1h qemu-system-x86_64 -name "Anaconda" -boot d -m 4096 -cpu qemu64 -display none -cdrom files/install.iso -smp 2 -hda files/disk.qcow2 -serial telnet:localhost:4321,server=on,wait=off & QEMU_PID=$$!
|
||||||
|
echo "PID: $$QEMU_PID"
|
||||||
|
timeout 1m bash -c "while ! (echo > /dev/tcp/127.0.0.1/4321); do sleep 0.1; done"
|
||||||
|
(nc localhost 4321 | tee vm.stdout) &
|
||||||
|
wait $$QEMU_PID
|
||||||
|
touch install_os
|
||||||
|
|
||||||
|
.ONESHELL:
|
||||||
|
|
||||||
|
start_vm: install_os
|
||||||
|
mkfifo vm.stdin
|
||||||
|
qemu-system-x86_64 -name "Anaconda" \
|
||||||
|
-m 4096 -cpu qemu64 -display none -smp 2 \
|
||||||
|
-chardev socket,path=/tmp/qga.sock,server=on,wait=off,id=qga0 \
|
||||||
|
-device e1000,netdev=net0 \
|
||||||
|
-netdev user,id=net0,hostfwd=tcp::$(VM_PORT)-:22 \
|
||||||
|
-device virtio-serial \
|
||||||
|
-device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 \
|
||||||
|
-boot c -hda files/disk.qcow2 -serial telnet:localhost:4321,server=on,wait=off & export QEMU_PID=$$!
|
||||||
|
echo "PID: $$QEMU_PID"
|
||||||
|
|
||||||
|
timeout 1m bash -c "while ! (echo > /dev/tcp/127.0.0.1/4321); do sleep 0.1; done"
|
||||||
|
(tail -f vm.stdin | nc localhost 4321 | tee vm.stdout) &
|
||||||
|
|
||||||
|
timeout 30m bash -c "while ! (echo > /dev/tcp/$(VM_IP)/$(VM_PORT)); do sleep 1; done"
|
||||||
|
|
||||||
|
if ! (echo > /dev/tcp/$(VM_IP)/$(VM_PORT))
|
||||||
|
then
|
||||||
|
echo "SSH must be installed and enabled inside the container"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "VM ready for tests at IP $(VM_IP):$(VM_PORT)"
|
||||||
|
echo $$QEMU_PID > start_vm
|
||||||
1
test/vm/README.md
Normal file
1
test/vm/README.md
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Place scripts that will test the VM. The VM will be available at ${VM_IP} using username ${VM_USER} and password ${VM_PASS}
|
||||||
9
test/vm/files/ks.cfg
Normal file
9
test/vm/files/ks.cfg
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
lang en_US.UTF-8
|
||||||
|
keyboard us
|
||||||
|
timezone Americas/New_York
|
||||||
|
zerombr
|
||||||
|
clearpart --all --initlabel
|
||||||
|
autopart
|
||||||
|
poweroff
|
||||||
|
user --name=core --groups=wheel --password=foobar
|
||||||
|
%include /usr/share/anaconda/interactive-defaults.ks
|
||||||
18
test/vm/flatpak_fedora_repo_disabled.yml
Normal file
18
test/vm/flatpak_fedora_repo_disabled.yml
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/env -S ansible-playbook -i ./ansible_inventory
|
||||||
|
---
|
||||||
|
- name: Test fedora flatpak repo wasn't enabled
|
||||||
|
hosts: vm
|
||||||
|
gather_facts: no
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Collect facts about system services
|
||||||
|
service_facts:
|
||||||
|
register: services_state
|
||||||
|
|
||||||
|
- name: Check that flatpak-add-fedora-repos is disabled
|
||||||
|
when: services_state['ansible_facts']['services']['flatpak-add-fedora-repos.service'] is defined
|
||||||
|
ansible.builtin.assert:
|
||||||
|
that:
|
||||||
|
- services_state['ansible_facts']['services']['flatpak-add-fedora-repos.service']['status'] == 'disabled'
|
||||||
|
fail_msg: 'flatpak-add-fedora-repos.service is not disabled'
|
||||||
|
success_msg: 'flatpak-add-fedora-repos.service is correctly disabled'
|
||||||
25
test/vm/flatpak_installed.yml
Normal file
25
test/vm/flatpak_installed.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/usr/bin/env -S ansible-playbook -i ./ansible_inventory
|
||||||
|
---
|
||||||
|
- name: Test for installed flatpaks
|
||||||
|
hosts: vm
|
||||||
|
gather_facts: no
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
# Verifies that the flatpaks are installed
|
||||||
|
- name: Get list of installed Flatpaks
|
||||||
|
become: true
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: /usr/bin/flatpak list
|
||||||
|
register: flatpaks
|
||||||
|
|
||||||
|
- name: Check that VLC is installed
|
||||||
|
ansible.builtin.assert:
|
||||||
|
that:
|
||||||
|
- "'VLC' in flatpaks.stdout"
|
||||||
|
fail_msg: 'VLC is not installed'
|
||||||
|
|
||||||
|
- name: Check that Firefox is installed
|
||||||
|
ansible.builtin.assert:
|
||||||
|
that:
|
||||||
|
- "'Firefox' in flatpaks.stdout"
|
||||||
|
fail_msg: 'Firefox is not installed'
|
||||||
12
test/vm/flatpak_update.yml
Normal file
12
test/vm/flatpak_update.yml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env -S ansible-playbook -i ./ansible_inventory
|
||||||
|
---
|
||||||
|
- name: Test flatpak update
|
||||||
|
hosts: vm
|
||||||
|
gather_facts: no
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
# Verifies that the GPG key is functional
|
||||||
|
- name: Test updating flatpak packages
|
||||||
|
become: true
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: /usr/bin/flatpak update -y --noninteractive
|
||||||
25
test/vm/install_image_source.yml
Normal file
25
test/vm/install_image_source.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/usr/bin/env -S ansible-playbook -i ./ansible_inventory
|
||||||
|
---
|
||||||
|
- name: Test Container Image source updates
|
||||||
|
hosts: vm
|
||||||
|
gather_facts: no
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
# Get list of origins
|
||||||
|
- name: Get origin
|
||||||
|
become: true
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: /bin/bash -c "cat /ostree/deploy/default/deploy/*.origin"
|
||||||
|
register: origin
|
||||||
|
|
||||||
|
- name: Get vars
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
image_repo: "{{ lookup('ansible.builtin.env', 'IMAGE_REPO') }}"
|
||||||
|
image_name: "{{ lookup('ansible.builtin.env', 'IMAGE_NAME') }}"
|
||||||
|
image_tag: "{{ lookup('ansible.builtin.env', 'IMAGE_TAG') }}"
|
||||||
|
|
||||||
|
- name: Tests
|
||||||
|
ansible.builtin.assert:
|
||||||
|
that:
|
||||||
|
- (image_repo + '/' + image_name + ':' + image_tag) in origin.stdout
|
||||||
|
fail_msg: 'Origin not configured'
|
||||||
14
xorriso/Makefile
Normal file
14
xorriso/Makefile
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
input.txt: gen_input.sh
|
||||||
|
find
|
||||||
|
$(if $(wildcard ../results/boot/grub2/grub.cfg),sed -i 's/quiet/quiet $(EXTRA_BOOT_PARAMS)/g' ../results/boot/grub2/grub.cfg)
|
||||||
|
sed -i 's/quiet/quiet $(EXTRA_BOOT_PARAMS)/g' ../results/EFI/BOOT/grub.cfg
|
||||||
|
$(eval _VARS = ARCH FLATPAK_DIR IMAGE_NAME IMAGE_TAG ISO_NAME VERSION)
|
||||||
|
$(foreach var,$(_VARS),$(var)=$($(var))) bash gen_input.sh | tee input.txt
|
||||||
|
|
||||||
|
install-deps:
|
||||||
|
|
||||||
|
FILES=$(wildcard input.txt)
|
||||||
|
clean:
|
||||||
|
ifneq ($(FILES),)
|
||||||
|
rm -Rf $(FILES)
|
||||||
|
endif
|
||||||
53
xorriso/gen_input.sh
Normal file
53
xorriso/gen_input.sh
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "-report_about WARNING"
|
||||||
|
echo "-indev ${PWD}/../results/images/boot.iso"
|
||||||
|
echo "-outdev ${ISO_NAME}"
|
||||||
|
echo "-boot_image any replay"
|
||||||
|
echo "-joliet on"
|
||||||
|
echo "-compliance joliet_long_names"
|
||||||
|
pushd "${PWD}/../results" > /dev/null
|
||||||
|
#for file in $(find .)
|
||||||
|
for file in ./boot/grub2/grub.cfg ./EFI/BOOT/grub.cfg
|
||||||
|
do
|
||||||
|
if [[ "$file" == "./images/boot.iso" ]]
|
||||||
|
then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
if [[ -f ${PWD}/${file} ]]
|
||||||
|
then
|
||||||
|
echo "-map ${PWD}/${file} ${file:2}"
|
||||||
|
echo "-chmod 0444 ${file:2}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
popd > /dev/null
|
||||||
|
|
||||||
|
if [[ -n "${FLATPAK_DIR}" ]]
|
||||||
|
then
|
||||||
|
pushd "${FLATPAK_DIR}" > /dev/null
|
||||||
|
for file in $(find repo)
|
||||||
|
do
|
||||||
|
if [[ "${file}" == "repo/.lock" ]]
|
||||||
|
then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
echo "-map ${PWD}/${file} flatpak/${file}"
|
||||||
|
echo "-chmod 0444 flatpak/${file}"
|
||||||
|
done
|
||||||
|
popd > /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "${PWD}/../sb_pubkey.der" ]
|
||||||
|
then
|
||||||
|
echo "-map ${PWD}/../sb_pubkey.der sb_pubkey.der"
|
||||||
|
echo "-chmod 0444 /sb_pubkey.der"
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd "${PWD}/../container" > /dev/null
|
||||||
|
for file in $(find "${IMAGE_NAME}-${IMAGE_TAG}" -type f)
|
||||||
|
do
|
||||||
|
echo "-map ${PWD}/${file} ${file}"
|
||||||
|
echo "-chmod 0444 ${file}"
|
||||||
|
done
|
||||||
|
popd > /dev/null
|
||||||
|
echo "-end"
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
echo "-indev $(pwd)/boot.iso"
|
|
||||||
echo "-outdev $(pwd)/build/deploy.iso"
|
|
||||||
echo "-boot_image any replay"
|
|
||||||
echo "-joliet on"
|
|
||||||
echo "-compliance joliet_long_names"
|
|
||||||
pushd container > /dev/null
|
|
||||||
for file in $(find ${IMAGE_NAME}-${IMAGE_TAG})
|
|
||||||
do
|
|
||||||
echo "-map $(pwd)/${file} ${file}"
|
|
||||||
echo "-chmod 0444 ${file}"
|
|
||||||
done
|
|
||||||
popd > /dev/null
|
|
||||||
echo "-end"
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue