local-mirror/do_juju_sync.sh
2023-03-10 09:37:30 +00:00

24 lines
734 B
Bash

#!/bin/bash
sudo apt -y update
sudo apt -y install simplestreams
IMAGE_SRC=https://streams.canonical.com/juju/tools/
IMAGE_DIR=/var/www/html/juju/tools
sudo sstream-mirror -U $IMAGE_SRC $IMAGE_DIR \
'arch=amd64' 'release~(xenial|bionic|focal|jammy)' 'version~^(2.8.*|2.9.*|3.0.*)' --progress
files="index.json index2.json index.sjson index2.sjson com.ubuntu.juju-released-agents.sjson com.ubuntu.juju-released-agents.json"
for file in ${files}
do
wget -qO ${IMAGE_DIR}/streams/v1/${file} ${IMAGE_SRC}/streams/v1/${file}
done
#GUI_SRC=https://streams.canonical.com/juju/gui/
#GUI_DIR=/var/www/html/juju/gui
#
#sudo sstream-mirror -U $GUI_SRC $GUI_DIR \
# 'content_id~(released)' 'juju-version~(2|3)' --progress