Commit 07b5b503 authored by Aral Balkan's avatar Aral Balkan

Update all scripts

Funding script is no longer necessary. Full site can be tested both from localhost (using ./develop) and hostname (using ./stage). The staging script now also automatically runs ngrok for you.
parent a75aa8ba
#!/bin/bash
# Make errors cause the script to exit.
set -e
# Small-Tech.org depoyment script. Builds the site using Hugo and
# syncs it to small-tech.org using Site.js.
echo ""
echo " 🌱 Small-Tech.org : deployment."
echo ""
echo " 🌱 Building the site using Hugo…"
# Build the site.
./build
echo " 🌱 Syncing the site using Site.js…"
# Deploy it.
site public --sync-to=aral@small-tech.org --exit-on-sync
#!/bin/bash
# Runs just Hugo server for local authoring
# Runs Hugo server to watch for changes and compile the public folder
# and Site.js to serve the generated public folder.
# Make errors cause the script to exit.
set -e
echo ""
echo " 🌱 Small-Tech.org : development."
echo ""
# Start Hugo server.
#
......@@ -9,11 +17,11 @@
# as localhost:<port> regardless of the setting of baseURL in the config.toml
# file. Since we do not have a separate build/deploy phase to the live server,
# we want the site as it would exist on the server to exist on the client.
hugo server --buildDrafts --renderToDisk --baseURL=https://small-tech.org --liveReloadPort=443 --appendPort=false &
HUGO_SERVER_PID=$!
# We also disable Hugo’s live reload as Site.js’s own live reload (based on
# Server-Sent Events) will kick in while serving the public directory.
hugo server --buildDrafts --renderToDisk --baseURL=https://localhost --disableLiveReload --appendPort=false &
# Use Site.js as a reverse proxy to serve the site at https://localhost
site :1313
echo " 🌱 ✔ Hugo server is running and watching for changes."
# Clean up: kill the Hugo server before exiting.
kill $HUGO_SERVER_PID
# Use Site.js to serve the generated public folder.
site public
#!/bin/bash
# This is a temporary script for developing/testing the fund us section (which currently will not work
# when using the stage script since Site.js cannot currently extend proxied sites with dynamic functionality.)
# Start Hugo server.
#
# The baseURL and appendPort flags are set to overwrite the default behaviour
# of Hugo when run with the server option which is to write absolute URLs
# as localhost:<port> regardless of the setting of baseURL in the config.toml
# file. Since we do not have a separate build/deploy phase to the live server,
# we want the site as it would exist on the server to exist on the client.
hugo server --buildDrafts --renderToDisk --baseURL=https://small-tech.org --liveReloadPort=443 --appendPort=false &
HUGO_SERVER_PID=$!
# Use Site.js as a reverse proxy to serve the site at https://hostname
# (Use ngrok to expose publicly.)
site public @hostname
# Clean up: kill the Hugo server before exiting.
kill $HUGO_SERVER_PID
#!/bin/bash
# Make errors cause the script to exit.
set -e
echo ""
echo " 🌱 Small-Tech.org : staging."
echo ""
# Runs Hugo server to watch for changes and compile the public folder
# and Site.js to serve the generated public folder at hostname and
# ngrok to provide global access to it. (You must already have set up your
# computer’s hostname and your ngrok configuration in the
# ~/.ngrok2/ngrok.yml file for this to work.)
# Start ngrok.
ngrok start --all > /dev/null &
HOSTNAME="$(hostname)"
echo " 🌱 ✔ ngrok active: your computer is accessible from ${HOSTNAME}"
# Start Hugo server.
#
# The baseURL and appendPort flags are set to overwrite the default behaviour
......@@ -7,12 +26,15 @@
# as localhost:<port> regardless of the setting of baseURL in the config.toml
# file. Since we do not have a separate build/deploy phase to the live server,
# we want the site as it would exist on the server to exist on the client.
hugo server --buildDrafts --renderToDisk --baseURL=https://small-tech.org --liveReloadPort=443 --appendPort=false &
HUGO_SERVER_PID=$!
# We also disable Hugo’s live reload as Site.js’s own live reload (based on
# Server-Sent Events) will kick in while serving the public directory.
#
# (We don’t store/kill the Hugo server PID as it is automatically killed when
# the batch script exists.)
hugo server --buildDrafts --renderToDisk --baseURL=https://small-tech.org --disableLiveReload --appendPort=false &
# Use Site.js as a reverse proxy to serve the site at https://hostname
# (Use ngrok to expose publicly.)
site :1313 @hostname
echo ""
echo " 🌱 ✔ Hugo server is running and watching for changes."
# Clean up: kill the Hugo server before exiting.
kill $HUGO_SERVER_PID
# Use Site.js to serve the generated public folder.
site public @hostname
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment