2
# ./streams-from-local.bash ./streams /usr/bin/jujud
5
# GO (and Juju) compile by OS and arch. All Linux releases are the same!
6
RELEASES="precise trusty xenial centos7"
7
WIN_RELEASES="win2012hvr2 win2012r2"
14
if [[ ! -d $STREAM_DIR ]]; then
15
echo "Provide a path to a dir to hold the streams."
19
if [[ ! -f $JUJUD ]]; then
20
echo "Provide a path to a dir to hold the streams."
24
full_version=$($JUJUD version)
25
version=$(echo $full_version | cut -d '-' -f 1)
26
arch=$(echo $full_version | cut -d '-' -f 3)
28
# Juju wont permit devel versions to be in released streams.
29
if [[ $version =~ (alpha|beta) ]]; then
35
mkdir -p $STREAM_DIR/tools/$agent_dir
36
mkdir -p $STREAM_DIR/tools/streams/v1
38
change_dir=$(dirname $JUJUD)
39
base_agent="agent.tgz"
40
tar cvfz $base_agent -C $change_dir jujud
41
for series in $RELEASES; do
42
agent="juju-$version-$series-$arch.tgz"
43
cp $base_agent $STREAM_DIR/tools/$agent_dir/$agent
47
if [[ -n $WIN_JUJUD ]]; then
48
change_dir=$(dirname $WIN_JUJUD)
49
base_agent="agent.tgz"
50
tar cvfz $base_agent -C $change_dir jujud.exe
51
for series in $WIN_RELEASES; do
52
agent="juju-$version-$series-$arch.tgz"
53
cp $base_agent $STREAM_DIR/tools/$agent_dir/$agent
58
juju metadata generate-tools -d $STREAM_DIR --stream $agent_dir
60
echo "You can boostrap using these local streams like so:"
61
echo "juju bootstrap --metadata-source $STREAM_DIR"
65
echo "Publish the $STREAM_DIR tree to a website or maybe your localhost."
67
echo "python -m SimpleHTTPServer"
68
echo "set agent-metadata-url: <HOST/path/tools>"