mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-28 12:55:10 +02:00
StoryBook (#14081)
Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d05305d4c4
commit
1f6303c918
6
ct/headers/storybook
Normal file
6
ct/headers/storybook
Normal file
@@ -0,0 +1,6 @@
|
||||
_____ __ __ __
|
||||
/ ___// /_____ _______ __/ /_ ____ ____ / /__
|
||||
\__ \/ __/ __ \/ ___/ / / / __ \/ __ \/ __ \/ //_/
|
||||
___/ / /_/ /_/ / / / /_/ / /_/ / /_/ / /_/ / ,<
|
||||
/____/\__/\____/_/ \__, /_.___/\____/\____/_/|_|
|
||||
/____/
|
||||
54
ct/storybook.sh
Normal file
54
ct/storybook.sh
Normal file
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/storybookjs/storybook
|
||||
|
||||
APP="Storybook"
|
||||
var_tags="${var_tags:-dev-tools;frontend;ui}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-8}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -f /opt/storybook/.projectpath ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
PROJECT_PATH=$(cat /opt/storybook/.projectpath)
|
||||
|
||||
if [[ ! -d "$PROJECT_PATH" ]]; then
|
||||
msg_error "Project directory not found: $PROJECT_PATH"
|
||||
exit
|
||||
fi
|
||||
|
||||
msg_info "Updating Storybook"
|
||||
cd "$PROJECT_PATH"
|
||||
$STD npx storybook@latest upgrade --yes
|
||||
msg_ok "Updated Storybook"
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:6006${CL}"
|
||||
55
install/storybook-install.sh
Normal file
55
install/storybook-install.sh
Normal file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/storybookjs/storybook
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
NODE_VERSION="24" NODE_MODULE="pnpm" setup_nodejs
|
||||
|
||||
msg_info "Preparing Storybook"
|
||||
mkdir -p /opt/storybook
|
||||
cd /opt/storybook
|
||||
msg_ok "Important: Interactive configuration will start now."
|
||||
|
||||
npx -y storybook@latest init --yes --no-dev
|
||||
PROJECT_PATH=$(find /opt/storybook -maxdepth 2 -name ".storybook" -type d 2>/dev/null | head -n1 | xargs dirname)
|
||||
|
||||
if [[ -z "$PROJECT_PATH" ]]; then
|
||||
PROJECT_PATH="/opt/storybook"
|
||||
fi
|
||||
|
||||
cd "$PROJECT_PATH"
|
||||
echo "$PROJECT_PATH" >/opt/storybook/.projectpath
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/storybook.service
|
||||
[Unit]
|
||||
Description=Storybook Dev Server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=${PROJECT_PATH}
|
||||
ExecStart=/usr/bin/npx storybook dev --host 0.0.0.0 --port 6006 --no-open
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now storybook
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Reference in New Issue
Block a user