view bin/install-k0s-web.sh @ 920:531a7200649f

echo command to run new k0s web
author Jeff Hammel <k0scist@gmail.com>
date Sun, 02 Jun 2024 15:18:51 -0700
parents cc3b78bc4c21
children 02b31a76e2c4
line wrap: on
line source

#!/usr/bin/env bash

set -exuo pipefail

PYTHON_VERSION="3.7"

# TODO: take this from "$1"
DEST="${HOME}/web3"
rm -rf "${DEST}"

# Make a directory for k0s.org web
mkdir -p "${DEST}"
cd "${DEST}"

# Install the proper version of Python with pyenv
# See https://github.com/pyenv/pyenv/wiki#suggested-build-environment
pyenv install --skip-existing "${PYTHON_VERSION}"
pyenv local "${PYTHON_VERSION}"
python --version

# Create a virtual environment
python -m venv .

# Activate the virtual environment
. bin/activate

# Install the required packages
bin/pip install --upgrade pip
bin/pip install -r "${HOME}"/web/requirements.txt

# echo command to run the server
command="sudo ${DEST}/bin/paster serve /home/jhammel/web/paster-wsgintegrate.ini"
echo "Run with:"
echo "${command}"