Merge lp:~hduran-8/juju-core/add_create_stream_script into lp:~go-bot/juju-core/trunk
Proposed by
Horacio Durán
Status: | Work in progress |
---|---|
Proposed branch: | lp:~hduran-8/juju-core/add_create_stream_script |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
68 lines (+64/-0) 1 file modified
scripts/create_stream.bash (+64/-0) |
To merge this branch: | bzr merge lp:~hduran-8/juju-core/add_create_stream_script |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+213749@code.launchpad.net |
Description of the change
Added script to create and upload a stream
The script create_stream.bash is an utility that
creates and uploads a stream to a given server, using
the current jujud build.
This is useful when trying to reproduce production
envs with a dev version, without using --upload-tools,
which produces an env closer to reality
To post a comment you must log in.
Unmerged revisions
- 2532. By Horacio Durán
-
Re-worded output messages to be more useful
- 2531. By Horacio Durán
-
Applied corrections suggested by dfc
* Set exit on error
* Created temp folder with mktemp
* Corrected suffix generation logic
* Yield useful message on missing jujud
* Improved Packed version message - 2530. By Horacio Durán
-
Added Script that produces a stream done with the current build of jujud
Reviewers: mp+213749_ code.launchpad. net,
Message:
Please take a look.
Description:
Added script to create and upload a stream
The scipt create_stream.bash is an utility that
creates and uploads a stream to a given server, using
the current jujud build.
This is useful when trying to reproduce production
envs with a dev ersion and without using --upload-tools
which gives a testing env closer to reality
https:/ /code.launchpad .net/~hduran- 8/juju- core/add_ create_ stream_ script/ +merge/ 213749
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/83370043/
Affected files (+74, -0 lines): create_ stream. bash
A [revision details]
A scripts/
Index: [revision details] 20140401161742- 2uwpewh7i9cnwx7 n
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: scripts/ create_ stream. bash create_ stream. bash' create_ stream. bash 1970-01-01 00:00:00 +0000 create_ stream. bash 2014-04-02 00:20:52 +0000 FOLDER= /tmp/build_ juju STRUCT_ RELEASES= ${BUILD_ FOLDER} /juju-dist/ tools/releases/ STRUCT_ STREAMS= ${BUILD_ FOLDER} /juju-dist/ FOLDER: ="public_ html"} host_folder] [arch] " 0-9]\+\ ).\([0- 9]\+\). \([0-9] \+\)[-+ ][0-9]. */\1.\2. \3/p') dir_structure( ) { STRUCT_ RELEASES; STRUCT_ STREAMS; STRUCT_ RELEASES; version= $(sed -n 's/^const version = "\(.*\)"/\1/p' /src/launchpad. net/juju- core/version/ version. go) version} -0ubuntu4 ${version} -${series} -${ARCH} .tgz" bin:$PATH \ STRUCT_ STREAMS}
=== added file 'scripts/
--- scripts/
+++ scripts/
@@ -0,0 +1,72 @@
+#!/bin/bash
+BUILD_
+INNER_
+INNER_
+# Input arguments
+TARGET_HOST=$1
+TARGET_FOLDER=$2
+ARCH=$3
+# I asume you are uploading this to your home on a server
+: ${TARGET_
+# A decent default for the purpose of creation of this script
+: ${ARCH:="amd64"}
+
+usage() {
+ echo "usage: $0 <target_host> [target_
+ echo " target host will be used for scp, add user@ if required"
+ exit 1
+}
+
+
+get_version() {
+ # Defines $version. $version can be different than $RELEASE used to
+ # match the packages in the archives.
+ control_version=$1
+ version=$(echo "$control_version" |
+ sed
-n 's/^\([
+ if [ "${version}" == "" ] ; then
+ echo "Invalid version: $control_version"
+ exit 3
+ fi
+}
+
+
+create_
+ if [ -d $BUILD_FOLDER ]; then
+ rm -fr $BUILD_FOLDER;
+ fi
+ mkdir -p $INNER_
+ mkdir -p $INNER_
+
+ cd $INNER_
+
+ control_
${GOPATH}
+ get_version ${control_
+ series="precise"
+ tool="juju-
+
+ if ! [ -f ${GOPATH}/bin/jujud ]; then
+ echo "Please run install on jujud, it must be in GOPATH/bin"
+ exit 1
+ fi
+ echo "Building package, contents:"
+ tar cvfz $tool -C ${GOPATH}/bin jujud
+ echo "Packed Version: "
+ ${GOPATH}/bin/jujud --version
+
+ cd $BUILD_FOLDER
+ JUJU_HOME=~/.juju PATH=$GOPATH/
+ juju metadata generate-tools -d ${INNER_
+ tar cf - juju-dist | ssh ${TARGET_HOST} tar -xf - -C ${TARGET_FOLDER}
+ ssh ${TARGET_HOST} chmod -R a+r ${TARGET_FOLDER}
+ echo "make sure...