forked from ublue-os/bazzite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dev): add easy local iso and vscode integration (ublue-os#1127)
* feat(dev): add easy local iso and vscode integration * fix: remove unused variables.
- Loading branch information
Showing
15 changed files
with
717 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Connect to VM", | ||
"dependsOn": [ | ||
"Run-ISO", | ||
"Open Browser" | ||
], | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Open Browser", | ||
"command": "${input:openSimpleBrowser}", | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Build Container", | ||
"command": "just", | ||
"args": [ | ||
"build", | ||
"${input:outputChoice}" | ||
], | ||
"problemMatcher": [], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
}, | ||
{ | ||
"label": "Build ISO", | ||
"command": "just", | ||
"args": [ | ||
"${input:installerChoice}", | ||
"${input:outputChoice}" | ||
], | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Run-ISO", | ||
"command": "just", | ||
"args": [ | ||
"run-iso", | ||
"${input:outputChoice}" | ||
], | ||
"problemMatcher": [], | ||
"isBackground": true | ||
}, | ||
{ | ||
"label": "List Images", | ||
"command": "just", | ||
"args": [ | ||
"list-images" | ||
], | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Check justfiles", | ||
"command": "just", | ||
"args": [ | ||
"just-check" | ||
], | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Run Container", | ||
"command": "just", | ||
"args": [ | ||
"run-container", | ||
"${input:outputChoice}" | ||
], | ||
"problemMatcher": [] | ||
} | ||
], | ||
"inputs": [ | ||
{ | ||
"id": "openSimpleBrowser", | ||
"type": "command", | ||
"command": "simpleBrowser.show", | ||
"args": [ | ||
"http://localhost:8006" | ||
] | ||
}, | ||
{ | ||
"id": "installerChoice", | ||
"type": "pickString", | ||
"description": "Choose which Installer Builder to use", | ||
"default": "build-iso", | ||
"options": [ | ||
"build-iso", | ||
"build-iso-git" | ||
] | ||
}, | ||
{ | ||
"id": "outputChoice", | ||
"type": "pickString", | ||
"description": "Choose which container to build", | ||
"default": "bazzite", | ||
"options": [ | ||
"bazzite", | ||
"bazzite-deck", | ||
"bazzite-nvidia", | ||
"bazzite gnome", | ||
"bazzite-deck gnome", | ||
"bazzite-nvidia gnome" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
export project_root := `git rev-parse --show-toplevel` | ||
export git_branch := ` git branch --show-current` | ||
export latest := "40" | ||
export default_image := "kinoite" | ||
export default_target := "bazzite" | ||
|
||
alias build-iso := build-iso-release | ||
alias run := run-container | ||
|
||
_default: | ||
@just --list | ||
|
||
_container_mgr: | ||
@{{ project_root }}/just_scripts/container_mgr.sh | ||
|
||
_tag image: | ||
@echo {{image}}-build | ||
|
||
# Check Just Syntax | ||
just-check: | ||
#!/usr/bin/bash | ||
find "${project_root}" -type f -name "*.just" | while read -r file; do | ||
echo "Checking syntax: $file" | ||
just --unstable --fmt --check -f $file | ||
done | ||
just --unstable --fmt --check -f ${project_root}/Justfile | ||
|
||
# Fix Just Syntax | ||
[private] | ||
just-fix: | ||
#!/usr/bin/bash | ||
find "${project_root}" -type f -name "*.just" | while read -r file; do | ||
echo "Checking syntax: $file" | ||
just --unstable --fmt -f $file | ||
done | ||
just --unstable --fmt -f ${project_root}/Justfile | ||
|
||
# Build image | ||
build target="" image="": | ||
@{{ project_root }}/just_scripts/build-image.sh {{target}} {{image}} | ||
|
||
# Build ISO | ||
build-iso-release target="" image="": | ||
@{{ project_root }}/just_scripts/build-iso.sh {{target}} {{image}} | ||
|
||
# Build ISO using ISO Builder Git Head | ||
build-iso-git target="" image="": | ||
@{{ project_root }}/just_scripts/build-iso-installer-main.sh {{target}} {{image}} | ||
|
||
# Run ISO | ||
run-iso target="" image="": | ||
@{{ project_root }}/just_scripts/run-iso.sh {{target}} {{image}} | ||
|
||
# Run Container | ||
run-container target="" image="": | ||
@{{ project_root }}/just_scripts/run-image.sh {{target}} {{image}} | ||
|
||
# List Images | ||
list-images: | ||
@{{ project_root }}/just_scripts/list-images.sh | ||
|
||
# Clean Images | ||
clean-images: | ||
@{{ project_root }}/just_scripts/cleanup-images.sh | ||
|
||
# Clean ISOs | ||
clean-isos: | ||
@{{ project_root }}/just_scripts/cleanup-dir.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/bash | ||
set -eo pipefail | ||
if [[ -z ${project_root} ]]; then | ||
project_root=$(git rev-parse --show-toplevel) | ||
fi | ||
if [[ -z ${git_branch} ]]; then | ||
git_branch=$(git branch --show-current) | ||
fi | ||
|
||
# Get Inputs | ||
target=$1 | ||
image=$2 | ||
|
||
# Set image/target/version based on inputs | ||
# shellcheck disable=SC2154,SC1091 | ||
. "${project_root}/just_scripts/get-defaults.sh" | ||
|
||
# Get info | ||
container_mgr=$(just _container_mgr) | ||
tag=$(just _tag "${image}") | ||
|
||
if [[ ${image} =~ "gnome" ]]; then | ||
base_image="silverblue" | ||
else | ||
base_image="kinoite" | ||
fi | ||
|
||
if [[ ${target} =~ "nvidia" ]]; then | ||
flavor="nvidia" | ||
else | ||
flavor="main" | ||
fi | ||
|
||
# Build Image | ||
$container_mgr build -f Containerfile \ | ||
--build-arg="IMAGE_NAME=${tag}" \ | ||
--build-arg="BASE_IMAGE_NAME=${base_image}" \ | ||
--build-arg="BASE_IMAGE_FLAVOR=${flavor}" \ | ||
--build-arg="IMAGE_FLAVOR=${flavor}" \ | ||
--build-arg="KERNEL_FLAVOR=fsync" \ | ||
--build-arg="SOURCE_IMAGE=${base_image}-${flavor}" \ | ||
--build-arg="FEDORA_MAJOR_VERSION=${latest}" \ | ||
--target="${target}" \ | ||
--tag localhost/"${tag}:${latest}-${git_branch}" \ | ||
"${project_root}" |
Oops, something went wrong.