mirror of
https://github.com/rancher/os.git
synced 2025-07-06 03:26:12 +00:00
make the host.sh script a little easier to use
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
parent
4a518ebfc9
commit
738cfefdbd
@ -14,6 +14,10 @@
|
|||||||
DIST="../../../dist/artifacts"
|
DIST="../../../dist/artifacts"
|
||||||
command -v caddy >/dev/null 2>&1 || { echo >&2 "I require caddy but it's not installed, see https://github.com/mholt/caddy#quick-start . Aborting."; exit 1; }
|
command -v caddy >/dev/null 2>&1 || { echo >&2 "I require caddy but it's not installed, see https://github.com/mholt/caddy#quick-start . Aborting."; exit 1; }
|
||||||
|
|
||||||
|
if [[ -e "dist/artifacts" ]]; then
|
||||||
|
cd scripts/hosting/digitalocean
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ! -e "$DIST" ]]; then
|
if [[ ! -e "$DIST" ]]; then
|
||||||
echo "Need to 'make release' so that there are files to serve. Aborting."
|
echo "Need to 'make release' so that there are files to serve. Aborting."
|
||||||
exit 1
|
exit 1
|
||||||
@ -26,15 +30,23 @@ INITRD="initrd-${VERSION}"
|
|||||||
IP=$(curl ipinfo.io/ip)
|
IP=$(curl ipinfo.io/ip)
|
||||||
PORT=2115
|
PORT=2115
|
||||||
|
|
||||||
|
#SOURCECONFIG="cloud-config.yml"
|
||||||
|
SOURCECONFIG="fedora-symbiote.yml"
|
||||||
CLOUDCONFIG="digitalocean.sh"
|
CLOUDCONFIG="digitalocean.sh"
|
||||||
|
|
||||||
cat cloud-config.yml \
|
cat ${SOURCECONFIG} \
|
||||||
| sed "s|^URL_BASE.*$|URL_BASE=http://${IP}:${PORT}|g" \
|
| sed "s|^URL_BASE.*$|URL_BASE=http://${IP}:${PORT}|g" \
|
||||||
| sed "s|^VMLINUX.*$|VMLINUX=${VMLINUX}|g" \
|
| sed "s|^VMLINUX.*$|VMLINUX=${VMLINUX}|g" \
|
||||||
| sed "s|^INITRD.*$|INITRD=${INITRD}|g" \
|
| sed "s|^INITRD.*$|INITRD=${INITRD}|g" \
|
||||||
> ${DIST}/${CLOUDCONFIG}
|
> ${DIST}/${CLOUDCONFIG}
|
||||||
|
|
||||||
echo "Hosting a cloud-config script at http://${IP}:${PORT}/${CLOUDCONFIG}"
|
echo "Hosting a cloud-config script at http://${IP}:${PORT}/${CLOUDCONFIG}"
|
||||||
|
echo "Usage:"
|
||||||
|
echo
|
||||||
|
echo "#include"
|
||||||
|
echo "http://${IP}:${PORT}/${CLOUDCONFIG}"
|
||||||
|
echo
|
||||||
|
echo
|
||||||
|
|
||||||
cd ${DIST}
|
cd ${DIST}
|
||||||
caddy -port ${PORT}
|
caddy -port ${PORT}
|
||||||
|
Loading…
Reference in New Issue
Block a user