Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add deno runtime
  • Loading branch information
ggodlewski committed Sep 5, 2025
commit d671a81d368ce405c4051b317f40cd5d287b45e0
12 changes: 12 additions & 0 deletions ci-cd-automation/update-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ startComponentPVE1() {
pct exec $CONTAINER_ID -- bash -c "cd /root/$REPO_BASE_NAME/$PROJECT_ROOT/ && git fetch origin && git reset --hard origin/$PROJECT_BRANCH && git pull" > /dev/null 2>&1
pct exec $CONTAINER_ID -- bash -c "cd /root/$REPO_BASE_NAME/$PROJECT_ROOT/$COMP_DIR && $INSTALL_CMD && $BUILD_CMD" > /dev/null 2>&1
pct set $CONTAINER_ID --memory 2048 --swap 0 --cores 2
elif [ "${RUNTIME^^}" == "DENO" ]; then
pct set $CONTAINER_ID --memory 4096 --swap 0 --cores 4
pct exec $CONTAINER_ID -- bash -c "cd /root/$REPO_BASE_NAME/$PROJECT_ROOT/ && git fetch origin && git reset --hard origin/$PROJECT_BRANCH && git pull" > /dev/null 2>&1
pct exec $CONTAINER_ID -- bash -c "cd /root/$REPO_BASE_NAME/$PROJECT_ROOT/$COMP_DIR && $INSTALL_CMD && $BUILD_CMD" > /dev/null 2>&1
pct set $CONTAINER_ID --memory 2048 --swap 0 --cores 2
elif [ "${RUNTIME^^}" == "PYTHON" ]; then
pct set $CONTAINER_ID --memory 4096 --swap 0 --cores 4
pct exec $CONTAINER_ID -- bash -c "cd /root/$REPO_BASE_NAME/$PROJECT_ROOT/ && git fetch origin && git reset --hard origin/$PROJECT_BRANCH && git pull" > /dev/null 2>&1
Expand All @@ -232,6 +237,13 @@ startComponentPVE2() {
pct exec $CONTAINER_ID -- bash -c 'cd /root/$REPO_BASE_NAME/$PROJECT_ROOT/$COMP_DIR && $INSTALL_CMD' && '$BUILD_CMD' > /dev/null 2>&1
pct set $CONTAINER_ID --memory 2048 --swap 0 --cores 2
"
elif [ "${RUNTIME^^}" == "DENO" ]; then
ssh [email protected] "
pct set $CONTAINER_ID --memory 4096 --swap 0 --cores 4 &&
pct exec $CONTAINER_ID -- bash -c 'cd /root/$REPO_BASE_NAME/$PROJECT_ROOT/ && git fetch origin && git reset --hard origin/$PROJECT_BRANCH && git pull' > /dev/null 2>&1
pct exec $CONTAINER_ID -- bash -c 'cd /root/$REPO_BASE_NAME/$PROJECT_ROOT/$COMP_DIR && $INSTALL_CMD' && '$BUILD_CMD' > /dev/null 2>&1
pct set $CONTAINER_ID --memory 2048 --swap 0 --cores 2
"
elif [ "${RUNTIME^^}" == "PYTHON" ]; then
ssh [email protected] "
pct set $CONTAINER_ID --memory 4096 --swap 0 --cores 4 &&
Expand Down
8 changes: 8 additions & 0 deletions container-creation/deno_runtime_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# Script to install a specific deno.js runtime version
# https://docs.deno.com/runtime/getting_started/installation/
# ----------------------------------------------------------

pct enter "$CONTAINER_ID" -- <<EOF
curl -fsSL https://deno.land/install.sh | sudo -E bash -s -- "$@"
EOF
9 changes: 9 additions & 0 deletions container-creation/deployOnStart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ install_runtime() {
else
echo "Node.js version $version ($major) is not available. Please check the version number. Using latest version instead."
fi
elif [ "${runtime_language,,}" == "deno" ]; then
local major=$(echo "$version" | cut -d. -f1)
local url="https://dl.deno.land/release/v${version}/deno-aarch64.zip"
if curl --output /dev/null --silent --head --fail "$url"
then
source /var/lib/vz/snippets/helper-scripts/deno_runtime_install.sh "$major"
else
echo "Deno version $version ($major) is not available. Please check the version number. Using latest version instead."
fi
elif [ "${runtime_language,,}" == "python" ]; then
IFS='.' read -r -a parts <<< "$version"

Expand Down
6 changes: 3 additions & 3 deletions container-creation/deployment-scripts/gatherRuntimeLangs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ gatherRunTime() {
read -p "🖥️ Enter the underlying runtime environment for \"$COMPONENT_PATH\" (e.g., 'nodejs', 'python') → " RUNTIME_LANGUAGE
fi

while [ "${RUNTIME_LANGUAGE^^}" != "NODEJS" ] && [ "${RUNTIME_LANGUAGE^^}" != "PYTHON" ]; do
while [ "${RUNTIME_LANGUAGE^^}" != "NODEJS" ] && "${RUNTIME_LANGUAGE^^}" != "DENO" ] && [ "${RUNTIME_LANGUAGE^^}" != "PYTHON" ]; do
echo "⚠️ Sorry, that runtime environment is not yet supported. Only \"nodejs\" and \"python\" are currently supported."
writeLog "Unsupported runtime environment entered: $RUNTIME_LANGUAGE for component: $COMPONENT_PATH"
if [ "${GH_ACTION^^}" == "Y" ]; then
outputError "⚠️ Sorry, that runtime environment is not yet supported. Only \"nodejs\" and \"python\" are currently supported."
outputError "⚠️ Sorry, that runtime environment is not yet supported. Only \"nodejs\", \"deno\" and \"python\" are currently supported."
writeLog "Unsupported runtime environment entered: $RUNTIME_LANGUAGE (GH_ACTION mode)"
exit 17
fi
read -p "🖥️ Enter the underlying runtime environment for \"$COMPONENT_PATH\" (e.g., 'nodejs', 'python') → " RUNTIME_LANGUAGE
read -p "🖥️ Enter the underlying runtime environment for \"$COMPONENT_PATH\" (e.g., 'nodejs', 'deno', 'python') → " RUNTIME_LANGUAGE
done
}

Expand Down
2 changes: 2 additions & 0 deletions container-creation/start_services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ if (( $CONTAINER_ID % 2 == 0 )); then

if [ "${RUNTIME^^}" == "NODEJS" ]; then
ssh [email protected] "pct exec $CONTAINER_ID -- bash -c \"mkdir -p /tmp && chmod 1777 /tmp && mkdir -p /tmp/tmux-0 && chmod 700 /tmp/tmux-0 && TMUX_TMPDIR=/tmp tmux new-session -d 'export HOME=/root export PATH=\\\$PATH:/usr/local/bin && cd $WORK_DIR && $BUILD_CMD && $START_CMD'\"" > /dev/null 2>&1
elif [ "${RUNTIME^^}" == "DENO" ]; then
ssh [email protected] "pct exec $CONTAINER_ID -- bash -c \"mkdir -p /tmp && chmod 1777 /tmp && mkdir -p /tmp/tmux-0 && chmod 700 /tmp/tmux-0 && TMUX_TMPDIR=/tmp tmux new-session -d 'export HOME=/root export PATH=\\\$PATH:/usr/local/bin && cd $WORK_DIR && $BUILD_CMD && $START_CMD'\"" > /dev/null 2>&1
elif [ "${RUNTIME^^}" == "PYTHON" ]; then
ssh [email protected] "pct exec $CONTAINER_ID -- bash -c \"mkdir -p /tmp && chmod 1777 /tmp && mkdir -p /tmp/tmux-0 && chmod 700 /tmp/tmux-0 && TMUX_TMPDIR=/tmp tmux new-session -d 'export HOME=/root export PATH=\\\$PATH:/usr/local/bin && cd $WORK_DIR && source venv/bin/activate $BUILD_CMD && $START_CMD'\"" > /dev/null 2>&1
fi
Expand Down