Skip to content

Commit

Permalink
feat: add vscode integration
Browse files Browse the repository at this point in the history
  • Loading branch information
m2Giles committed May 14, 2024
1 parent 44ef66e commit adf44b3
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 13 deletions.
108 changes: 108 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"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": [
"build-iso",
"${input:outputChoice}"
],
"problemMatcher": []
},
{
"label": "Build ISO (testing)",
"command": "just",
"args": [
"build-iso-installer-main",
"${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": "outputChoice",
"type": "pickString",
"description": "Choose which container to build",
"default": "bluefin",
"options": [
"bluefin",
"bluefin-dx",
"bluefin latest",
"bluefin-dx latest",
"aurora",
"aurora-dx",
]

Check failure on line 105 in .vscode/tasks.json

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.vscode/tasks.json#L105

Unexpected character (']' (code 93)): expected a value
}
]
}
15 changes: 3 additions & 12 deletions scripts/common-build-iso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ if "${container_mgr}" info | grep Root | grep -q /home; then
echo "Cannot build ISO with rootless container..."
exit 1
fi
# function work-in-process(){
# echo "ISO Builder script is a Work In Process"
# secs=5
# while [ $secs -gt 0 ]
# do
# printf "\r\033[KWaiting %.d seconds." $((secs--))
# sleep 1
# done
# }
# work-in-process

# Get Inputs
image=$1
Expand All @@ -45,6 +35,7 @@ tag=$(just _tag "${image}" "${target}")

# Don't use -build suffix, flatpak dependency using ghcr
ghcr_tag=${tag::-6}

# Remove old ISO if present
sudoif rm -f "${project_root}/scripts/files/output/${tag}-${version}-${git_branch}.iso"
sudoif rm -f "${project_root}/scripts/files/output/${tag}-${version}-${git_branch}.iso-CHECKSUM"
Expand Down Expand Up @@ -88,7 +79,7 @@ ostree refs --repo=\${FLATPAK_SYSTEM_DIR}/repo | grep '^deploy/' | grep -v 'org\
EOF

workspace=${project_root}
if [[ -f /.dockerenv ]]; then
if [[ -f /.dockerenv || -f /run/.containerenv ]]; then
FLATPAK_REFS_DIR=${LOCAL_WORKSPACE_FOLDER}/${flatpak_dir_shortname}
TEMP_FLATPAK_INSTALL_DIR="${LOCAL_WORKSPACE_FOLDER}/$(echo "${TEMP_FLATPAK_INSTALL_DIR}" | rev | cut -d / -f 1 | rev)"
workspace=${LOCAL_WORKSPACE_FOLDER}
Expand All @@ -102,7 +93,7 @@ if [[ ! -f ${project_root}/${flatpak_dir_shortname}/flatpaks_with_deps ]]; then
-e FLATPAK_TRIGGERSDIR=/flatpak/triggers \
--volume "${FLATPAK_REFS_DIR}":/output \
--volume "${TEMP_FLATPAK_INSTALL_DIR}":/temp_flatpak_install_dir \
"ghcr.io/ublue-os/${base_name}-main:${version}" /temp_flatpak_install_dir/script.sh
"ghcr.io/ublue-os/${base_image}-main:${version}" /temp_flatpak_install_dir/script.sh
fi

# Remove Temp Directory
Expand Down
7 changes: 6 additions & 1 deletion scripts/get-defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ fi
# if no target, base
if [[ -z "${target}" ]]; then
target="base"

# if $2 is numeric, assume that is version and target is base
elif [[ ${target} =~ ^[0-9]+$ ]]; then
version=${target}
target="base"
elif [[ ${target} =~ latest ]]; then
version=${target}
target="base"
elif [[ ${target} =~ gts ]]; then
version=${target}
target="base"
fi

# if no version, bluefin is GTS, Aurora is Latest
Expand Down

0 comments on commit adf44b3

Please sign in to comment.