Merge lp:~sinzui/juju-release-tools/assemble-publish-purpose into lp:juju-release-tools

Proposed by Curtis Hovey
Status: Merged
Merged at revision: 60
Proposed branch: lp:~sinzui/juju-release-tools/assemble-publish-purpose
Merge into: lp:juju-release-tools
Diff against target: 513 lines (+174/-121)
2 files modified
assemble-streams.bash (+158/-101)
publish-public-tools.bash (+16/-20)
To merge this branch: bzr merge lp:~sinzui/juju-release-tools/assemble-publish-purpose
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Approve
Review via email: mp+234753@code.launchpad.net

Description of the change

This branch adds support for proposed and devel purposes

./juju-release-tools/assemble-streams.bash testing 1.21-alpha2 ./new-tools
./juju-release-tools/assemble-streams.bash devel 1.21-alpha2 ./new-tools
./juju-release-tools/assemble-streams.bash proposed 1.21.0 ./new-tools
./juju-release-tools/assemble-streams.bash release 1.21.0 ./new-tools

I retracted an errant copy of 1.20.6 to my own tools like this.
./juju-release-tools/assemble-streams.bash -n -r 'juju-1.20.6*' devel IGNORE new-tools/
^ where -n means no-sync, -r means retract and IGNORE implies don't visit the archives.

Created new assemble-streams.bash based on assemble-public-tools:
1. Removed the juju stable and devel archive search because they have not been
   the source for tools for 9 months.
   Fixed https://bugs.launchpad.net/juju-release-tools/+bug/1341747
2. Documented the use of IGNORE as the release version to regenerate streams...
   ...do not try to retrieve tools and extract them when using IGNORE
   Removed the PRIVATE arg that wasn't used and overlaps with IGNORE
3. Create the whole path to tools and metadata. DEST_DIST can be
   juju-dist/ or juju-dist/purpose
4. Replaced all the early returns in functions with guards in the "main"
   calls so that is clear which functions are being used with IGNORE is
   set or GET_RELEASED_TOOL is false.
5. Removed the excludes list from s3cmd. It never worked. Fast syncing
   was achieved using a local cache. The source for the sync is determined
   by the purpose. Note the subtle rule for testing. Syncing happens
   directly in the tree that will be synced. This removed the need for
   the old new-tools/tools/releases dir. The detection of duplicate tools
   is maintained because testing is syncing from purposes, which must have
   all the stable tools released.
6. Made retract_tools() a common step so that is is well tested. Always
   retract when the purpose is testing. Also retract is RETRACT_GLOB is
   set using the -r option.
7. init_tools_maybe() started as a way to ensure Jerff can get s sane
   seed of data for devel and proposed. I used this to make my own for
   the CPCs, but I didn't need it. This function evolved to be the
   means to reset testing by first retracting the testing tools and data
   then seeding it with proposed.
8. Extracted archive_extra_ppc64_tool to make archive_tools easier to read...
   It might be deletable with the release of 1.21.0
9. Inlined the creation and cleanup to $WORK
19. Exit early when debs were search, but no new tools were found. This case
    is an error for testing, but results in a no-op for streams.canonical.com
11. Inlined JUJU_PATH, ARCH and lsb-release vars because they are now localised.
12. Moved signing key into options, factored out PRIVATE
13. Introduced purpose. DEST_DIST us made with it. Users of the script will
    have a cache for each purpose.
14. Exit early if new-tools does not exist. It is not created because the
    dir is a cache that users should not accidentally create.
15. only enter functions when we know we will use them...not more immediate
    exists because a env var is set.

Updated publish-public-tools
1. Updated the script to understand more purposes, simplified the logic
   because only "release" has a different root dir rule.
2. Removed EVENT because it was not needed when better phrasing was used.

To post a comment you must log in.
71. By Curtis Hovey

Fixed syntax errors.

72. By Curtis Hovey

Renamed retrieve_released_tools to sync_released_tools because Jerff has
redefined this function.

73. By Curtis Hovey

Delete debs without failing over.

74. By Curtis Hovey

Delete json when retracting because generate-tools appends to json; it does
not check if the tools exist.
Initialise proposed and devel streams.

75. By Curtis Hovey

Added -r option to pass a glob of tools to retract.
Allways retract all tools when the purpose is testing.

76. By Curtis Hovey

RETRACT_GLOB cannot be undefined.

Revision history for this message
Aaron Bentley (abentley) wrote :

Looks landable, but some comments below.

review: Approve
Revision history for this message
Curtis Hovey (sinzui) wrote :

I reported bug 1370246 about the magic number/validation problem

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'assemble-streams.bash'
2--- assemble-streams.bash 2014-09-15 18:37:16 +0000
3+++ assemble-streams.bash 2014-09-16 19:44:53 +0000
4@@ -16,14 +16,15 @@
5
6 # These are the archives that are search for matching releases.
7 UBUNTU_ARCH="http://archive.ubuntu.com/ubuntu/pool/universe/j/juju-core/"
8-STABLE_ARCH="http://ppa.launchpad.net/juju/stable/ubuntu/pool/main/j/juju-core/"
9-DEVEL_ARCH="http://ppa.launchpad.net/juju/devel/ubuntu/pool/main/j/juju-core/"
10 ARM_ARCH="http://ports.ubuntu.com/pool/universe/j/juju-core/"
11-ALL_ARCHIVES="$UBUNTU_ARCH $STABLE_ARCH $DEVEL_ARCH $ARM_ARCH"
12+ALL_ARCHIVES="$UBUNTU_ARCH $ARM_ARCH"
13
14-if [ -f $JUJU_DIR/buildarchrc ]; then
15+if [[ -f $JUJU_DIR/buildarchrc ]]; then
16 source $JUJU_DIR/buildarchrc
17+ echo "Adding the build archives to list of archives to search."
18 ALL_ARCHIVES="$ALL_ARCHIVES $BUILD_STABLE_ARCH $BUILD_DEVEL_ARCH"
19+else
20+ echo "Only public archives will be searched."
21 fi
22
23
24@@ -32,6 +33,8 @@
25 echo "usage: $0 $options RELEASE DESTINATION_DIRECTORY [SIGNING_KEY]"
26 echo " TEST_DEBS_DIR: The optional directory with testing debs."
27 echo " RELEASE: The pattern (version) to match packages in the archives."
28+ echo " Use IGNORE when you want to regerenate metadata without"
29+ echo " downloading debs and extracting new tools."
30 echo " DESTINATION_DIRECTORY: The directory to assemble the tools in."
31 echo " SIGNING_KEY: When provided, the metadata will be signed."
32 exit 1
33@@ -59,46 +62,84 @@
34 if [[ ! -d $DEST_DEBS ]]; then
35 mkdir $DEST_DEBS
36 fi
37- if [[ ! -d $DEST_TOOLS ]]; then
38- mkdir -p $DEST_TOOLS
39+ if [[ ! -d ${DEST_DIST}/tools/releases ]]; then
40+ mkdir -p ${DEST_DIST}/tools/releases
41 fi
42- if [[ ! -d $DEST_DIST ]]; then
43- mkdir $DEST_DIST
44+ if [[ ! -d ${DEST_DIST}/tools/streams/v1 ]]; then
45+ mkdir -p ${DEST_DIST}/tools/streams/v1
46 fi
47 }
48
49
50-retrieve_released_tools() {
51+sync_released_tools() {
52 # Retrieve previously released tools to ensure the metadata continues
53 # to work for historic releases.
54- [[ $PRIVATE == "true" ]] && return 0
55- [[ $GET_RELEASED_TOOL="false" ]] && return 0
56 echo "Phase 2: Retrieving released tools."
57- # unsupported, stable, devel excludes to make sync fast.
58- if [[ $IS_TESTING == "true" ]]; then
59- excludes="--rexclude 'juju-1.1[5-7].*'"
60+ if [[ $PURPOSE == "release" ]]; then
61+ # The directory layout doesn't describe the release dir as "release".
62+ local source_dist="juju-dist"
63+ elif [[ $PURPOSE == "testing" ]]; then
64+ # The testing purpose copies from "proposed" because this stream.
65+ # represents every version that can could be a stable release. Testing
66+ # is volatile, it is always proposed + new tools that might be
67+ # stable in the future.
68+ local source_dist="juju-dist/proposed"
69 else
70- excludes=""
71- fi
72- s3cmd -c $JUJU_DIR/s3cfg sync $excludes \
73- s3://juju-dist/tools/releases/ $DEST_TOOLS/
74-}
75-
76-
77-retract_bad_tools() {
78- echo "Phase 2.1: Retracting bad released tools."
79- bad_tools=$(find $DEST_TOOLS -name "juju-1.21-alpha1.*")
80- for bad_tool in $bad_tools; do
81- rm $bad_tool
82- done
83+ # The devel and proposed purposes use their own dirs for continuity.
84+ local source_dist="juju-dist/$PURPOSE"
85+ fi
86+ s3cmd -c $JUJU_DIR/s3cfg sync \
87+ s3://$source_dist/tools/releases/ $DEST_DIST/tools/releases/
88+}
89+
90+
91+retract_tools() {
92+ echo "Phase 3: Reseting streams as needed."
93+ if [[ $PURPOSE == "testing" ]]; then
94+ echo "Removing all testing tools and metadata to reset for testing."
95+ local RETRACT_GLOB="juju-*.tgz"
96+ elif [[ -z "$RETRACT_GLOB" ]]; then
97+ echo "Noting to reset"
98+ return
99+ fi
100+ find ${DEST_DIST}/tools/releases -name "$RETRACT_GLOB" -delete
101+ # juju metadata generate-tools appends to existing metadata; delete
102+ # the current data to force a reset of all data, minus the deleted tools.
103+ find ${DEST_DIST}/tools/streams/v1/ -type f -delete
104+}
105+
106+
107+init_tools_maybe() {
108+ echo "Phase 4: Checking for $PURPOSE tools in the tree."
109+ count=$(find $DESTINATION/juju-dist/tools/releases -name '*.tgz' | wc -l)
110+ if [[ $((count)) < 400 ]]; then
111+ echo "The tools in $DESTINATION/tools/releases looks incomplete"
112+ echo "Data will be lost if metadata is regenerated."
113+ exit 7
114+ fi
115+ count=$(find $DEST_DIST/tools/releases -name '*.tgz' | wc -l)
116+ if [[ $PURPOSE == "proposed" && $((count)) == 0 ]]; then
117+ echo "Seeding proposed with all release tools"
118+ cp $DESTINATION/juju-dist/tools/releases/juju-*.tgz \
119+ $DEST_DIST/tools/releases
120+ elif [[ $PURPOSE == "devel" && $((count)) < 16 ]]; then
121+ echo "Seeding devel with some release tools"
122+ cp $DESTINATION/juju-dist/tools/releases/juju-1.20.5*.tgz \
123+ $DEST_DIST/tools/releases
124+ cp $DESTINATION/juju-dist/tools/releases/juju-1.20.7*.tgz \
125+ $DEST_DIST/tools/releases
126+ elif [[ $PURPOSE == "testing" && $((count)) < 16 ]]; then
127+ echo "Seeding testing with all proposed tools"
128+ cp $DESTINATION/juju-dist/tools/releases/juju-*.tgz \
129+ $DEST_DIST/tools/releases
130+ fi
131 }
132
133
134 retrieve_packages() {
135 # Retrieve the $RELEASE packages that contain jujud,
136 # or copy a locally built package.
137- [[ $PRIVATE == "true" ]] && return 0
138- echo "Phase 3: Retrieving juju-core packages from archives"
139+ echo "Phase 5: Retrieving juju-core packages from archives"
140 if [[ $IS_TESTING == "true" ]]; then
141 for linked_file in $TEST_DEBS_DIR/juju-core_*.deb; do
142 # We need the real file location which includes series and arch.
143@@ -168,11 +209,24 @@
144 }
145
146
147+archive_extra_ppc64_tool() {
148+ # Hack to create ppc64 because it is not clear if juju wants
149+ # this name instead of ppc64el.
150+ tool="${DEST_DIST}/tools/releases/juju-${version}-${series}-ppc64.tgz"
151+ if [[ ! -e $tool ]]; then
152+ echo "Creating ppc64 from ppc64el: $tool"
153+ tar cvfz $tool -C $change_dir jujud
154+ added_tools[${#added_tools[@]}]="$tool"
155+ echo "Created ${tool}."
156+ fi
157+}
158+
159+
160 archive_tools() {
161 # Builds the jujud tgz for each series and arch.
162- [[ $PRIVATE == "true" ]] && return 0
163- echo "Phase 4: Extracting jujud from packages and archiving tools."
164+ echo "Phase 6: Extracting jujud from packages and archiving tools."
165 cd $DESTINATION
166+ WORK=$(mktemp -d)
167 mkdir ${WORK}/juju
168 PACKAGES=$(find ${DEST_DEBS} -name "*.deb")
169 for package in $PACKAGES; do
170@@ -183,7 +237,7 @@
171 get_version $control_version
172 get_series $control_version
173 get_arch $control_file
174- tool="${DEST_TOOLS}/juju-${version}-${series}-${arch}.tgz"
175+ tool="${DEST_DIST}/tools/releases/juju-${version}-${series}-${arch}.tgz"
176 if [[ $arch == 'UNSUPPORTED' ]]; then
177 echo "Skipping unsupported architecture $package"
178 elif [[ -e $tool ]]; then
179@@ -209,28 +263,27 @@
180 tar cvfz $tool -C $change_dir jujud
181 added_tools[${#added_tools[@]}]="$tool"
182 echo "Created ${tool}."
183- # Hack to create ppc64 because it is not clear if juju wants
184- # this name instead of ppc64el.
185 if [[ $arch == 'ppc64el' ]]; then
186- tool="${DEST_TOOLS}/juju-${version}-${series}-ppc64.tgz"
187- if [[ ! -e $tool ]]; then
188- echo "Creating ppc64 from ppc64el: $tool"
189- tar cvfz $tool -C $change_dir jujud
190- added_tools[${#added_tools[@]}]="$tool"
191- echo "Created ${tool}."
192- fi
193+ archive_extra_ppc64_tool
194 fi
195 fi
196 rm -r ${WORK}/juju/*
197 done
198- if [[ $IS_TESTING == "true" ]]; then
199- set +u
200- if [[ -z "${added_tools[@]}" ]]; then
201- echo "No tools were added from the built debs."
202+ # The extracted files are no longer needed. Clean them up now.
203+ rm -r $WORK
204+ # Exit early when debs were search, but no new tools were found.
205+ if [[ -z "${added_tools[@]:-}" ]]; then
206+ echo "No tools were added from the built debs."
207+ cleanup
208+ if [[ $IS_TESTING == "true" ]]; then
209 echo "The branch version may be out of date; $RELEASE is published?"
210 exit 5
211+ else
212+ echo "No new tools were found for $RELEASE, exiting early."
213+ echo "Use 'IGNORE' as the release version if you want to generate."
214+ echo "streams from tools in $DEST_DIST/tools/releases"
215+ exit 0
216 fi
217- set -u
218 fi
219 }
220
221@@ -239,7 +292,9 @@
222 # Extract a juju-core that was found in the archives to run metadata.
223 # Match by release version and arch, prefer exact series, but fall back
224 # to generic ubuntu.
225- echo "Phase 5.1: Using juju from a downloaded deb."
226+ echo "Using juju from a downloaded deb."
227+ source /etc/lsb-release
228+ ARCH=$(dpkg --print-architecture)
229 juju_cores=$(find $DEST_DEBS -name "juju-core_${RELEASE}*${ARCH}.deb")
230 juju_core=$(echo "$juju_cores" | grep $DISTRIB_RELEASE | head -1)
231 if [[ $juju_core == "" ]]; then
232@@ -254,8 +309,9 @@
233
234 generate_streams() {
235 # Create the streams metadata and organised the tree for later publication.
236- echo "Phase 5: Generating streams data."
237- cd $DESTINATION
238+ echo "Phase 7: Generating streams data."
239+ cd $DEST_DIST
240+ JUJU_PATH=$(mktemp -d)
241 if [[ $RELEASE != "IGNORE" ]]; then
242 extract_new_juju
243 else
244@@ -264,16 +320,15 @@
245 fi
246 juju_version=$($JUJU_EXEC --version)
247 echo "Using juju: $juju_version"
248- mkdir -p ${DEST_DIST}/tools/streams/v1
249- mkdir -p ${DEST_DIST}/tools/releases
250- cp $DEST_TOOLS/*tgz ${DEST_DIST}/tools/releases
251 JUJU_HOME=$JUJU_DIR PATH=$JUJU_BIN_PATH:$PATH \
252 $JUJU_EXEC metadata generate-tools -d ${DEST_DIST}
253+ rm -r $JUJU_PATH
254 echo "The tools are in ${DEST_DIST}."
255 }
256
257
258 generate_mirrors() {
259+ echo "Phase 8: Creating mirror josn."
260 short_now=$(date +%Y%m%d)
261 sed -e "s/NOW/$short_now/" ${SCRIPT_DIR}/mirrors.json.template \
262 > ${DEST_DIST}/tools/streams/v1/mirrors.json
263@@ -284,7 +339,7 @@
264
265
266 sign_metadata() {
267- echo "Phase 6: Signing metadata with $SIGNING_KEY."
268+ echo "Phase 9: Signing metadata with $SIGNING_KEY."
269 key_option="--default-key $SIGNING_KEY"
270 gpg_options=""
271 if [[ -n $SIGNING_PASSPHRASE_FILE ]]; then
272@@ -310,31 +365,30 @@
273 cleanup() {
274 # Remove the debs and testing tools so that they are not reused in
275 # future runs of the script.
276- if [[ $PACKAGES != "" ]]; then
277- rm ${DEST_DEBS}/*.deb
278- fi
279- if [[ $IS_TESTING == "true" ]]; then
280- for tool in "${added_tools[@]}"; do
281- rm $tool
282- done
283- fi
284- rm -r $WORK
285- rm -r $JUJU_PATH
286+ find ${DEST_DEBS} -name "*.deb" -delete
287 }
288
289
290-declare -a added_tools
291-added_tools=()
292-
293+# Parse options and args.
294+RETRACT_GLOB=""
295+SIGNING_KEY=""
296 IS_TESTING="false"
297 GET_RELEASED_TOOL="true"
298-while getopts "t:n" o; do
299+while getopts "r:s:t:n" o; do
300 case "${o}" in
301+ r)
302+ RETRACT_GLOB=${OPTARG}
303+ echo "Tools matching $RETRACT_GLOB will be removed from the data."
304+ ;;
305+ s)
306+ SIGNING_KEY=${OPTARG}
307+ echo "The streams will be signed with $SIGNING_KEY"
308+ ;;
309 t)
310 TEST_DEBS_DIR=${OPTARG}
311 [[ -d $TEST_DEBS_DIR ]] || usage
312 IS_TESTING="true"
313- echo "# Assembling test tools from $TEST_DEBS_DIR"
314+ echo "Assembling testing tools from $TEST_DEBS_DIR"
315 ;;
316 n)
317 GET_RELEASED_TOOL="false"
318@@ -346,46 +400,49 @@
319 esac
320 done
321 shift $((OPTIND - 1))
322-test $# -eq 2 || test $# -eq 3 || usage
323-
324-
325-RELEASE=$1
326-DESTINATION=$(cd $2; pwd)
327+test $# -eq 3 || usage
328+
329+PURPOSE=$1
330+if [[ ! $PURPOSE =~ ^(release|proposed|devel|testing)$ ]]; then
331+ echo "Invalid PURPOSE."
332+ usage
333+fi
334+RELEASE=$2
335+DESTINATION=$3
336+if [[ ! -d "$3" ]]; then
337+ echo "$3 is not a directory. Create it if you really mean to use it."
338+ usage
339+else
340+ DESTINATION=$(cd $DESTINATION; pwd)
341+fi
342+
343+
344+# Configure paths, arch, and series
345 DEST_DEBS="${DESTINATION}/debs"
346-DEST_TOOLS="${DESTINATION}/tools/releases"
347-DEST_DIST="${DESTINATION}/juju-dist"
348-if [[ $IS_TESTING == "true" ]]; then
349- DEST_DIST="${DESTINATION}/juju-dist-testing"
350-fi
351-if [[ -d $DEST_DIST ]]; then
352- rm -r $DEST_DIST
353-fi
354-
355-SIGNING_KEY=""
356-PRIVATE="false"
357-EXTRA=${3:-""}
358-if [[ $EXTRA == "PRIVATE" ]]; then
359- PRIVATE="true"
360- echo "Skipping release tools and packages."
361+if [[ $PURPOSE == "release" ]]; then
362+ DEST_DIST="$DESTINATION/juju-dist"
363 else
364- SIGNING_KEY=$EXTRA
365+ DEST_DIST="$DESTINATION/juju-dist/$PURPOSE"
366 fi
367-
368-PACKAGES=""
369-WORK=$(mktemp -d)
370-JUJU_PATH=$(mktemp -d)
371-ARCH=$(dpkg --print-architecture)
372-source /etc/lsb-release
373-
374+declare -a added_tools
375+added_tools=()
376+
377+
378+# Main.
379 check_deps
380 build_tool_tree
381-retrieve_released_tools
382-retract_bad_tools
383-retrieve_packages
384-archive_tools
385+if [[ $GET_RELEASED_TOOL == "true" ]]; then
386+ sync_released_tools
387+fi
388+retract_tools
389+init_tools_maybe
390+if [[ $RELEASE != "IGNORE" ]]; then
391+ retrieve_packages
392+ archive_tools
393+fi
394 generate_streams
395-generate_mirrors
396 if [[ $SIGNING_KEY != "" ]]; then
397+ generate_mirrors
398 sign_metadata
399 fi
400 cleanup
401
402=== modified file 'publish-public-tools.bash'
403--- publish-public-tools.bash 2014-06-19 02:54:23 +0000
404+++ publish-public-tools.bash 2014-09-16 19:44:53 +0000
405@@ -12,8 +12,10 @@
406
407 usage() {
408 echo "usage: $0 PURPOSE DIST_DIRECTORY DESTINATIONS"
409- echo " PURPOSE: 'release' or 'testing'"
410+ echo " PURPOSE: 'release', 'proposed', 'devel', or 'testing'"
411 echo " release installs tools/ at the top of juju-dist/tools."
412+ echo " proposed installs tools/ at the top of juju-dist/proposed/tools."
413+ echo " devel installs tools/ at the top of juju-dist/devel/tools."
414 echo " testing installs tools/ at juju-dist/testing/tools."
415 echo " DIST_DIRECTORY: The directory to the assembled tools."
416 echo " This is the juju-dist dir created by assemble-public-tools.bash."
417@@ -47,9 +49,9 @@
418 if [[ $PURPOSE == "release" ]]; then
419 local destination="s3://juju-dist/"
420 else
421- local destination="s3://juju-dist/testing/"
422+ local destination="s3://juju-dist/$PURPOSE/"
423 fi
424- echo "Phase 1: $EVENT to AWS."
425+ echo "Phase 1: Publishing $PURPOSE to AWS."
426 s3cmd -c $JUJU_DIR/s3cfg sync --exclude '*mirror*' \
427 ${JUJU_DIST}/tools $destination
428 }
429@@ -61,9 +63,9 @@
430 if [[ $PURPOSE == "release" ]]; then
431 local destination="tools"
432 else
433- local destination="testing/tools"
434+ local destination="$PURPOSE/tools"
435 fi
436- echo "Phase 2: $EVENT to canonistack."
437+ echo "Phase 2: Publishing $PURPOSE to canonistack."
438 source $JUJU_DIR/canonistacktoolsrc
439 cd $JUJU_DIST/tools/releases/
440 ${SCRIPT_DIR}/swift_sync.py $destination/releases/ *.tgz
441@@ -77,9 +79,9 @@
442 if [[ $PURPOSE == "release" ]]; then
443 local destination="tools"
444 else
445- local destination="testing/tools"
446+ local destination="$PURPOSE/tools"
447 fi
448- echo "Phase 3: $EVENT to HP Cloud."
449+ echo "Phase 3: Publishing $PURPOSE to HP Cloud."
450 source $JUJU_DIR/hptoolsrc
451 cd $JUJU_DIST/tools/releases/
452 ${SCRIPT_DIR}/swift_sync.py $destination/releases/ *.tgz
453@@ -93,9 +95,9 @@
454 if [[ $PURPOSE == "release" ]]; then
455 local destination="release"
456 else
457- local destination="testing"
458+ local destination="$PURPOSE"
459 fi
460- echo "Phase 4: $EVENT to Azure."
461+ echo "Phase 4: Publishing $PURPOSE to Azure."
462 source $JUJU_DIR/azuretoolsrc
463 ${SCRIPT_DIR}/azure_publish_tools.py publish $destination ${JUJU_DIST}
464 }
465@@ -107,9 +109,9 @@
466 if [[ $PURPOSE == "release" ]]; then
467 local destination="tools"
468 else
469- local destination="testing/tools"
470+ local destination="$PURPOSE/tools"
471 fi
472- echo "Phase 5: $EVENT to Joyent."
473+ echo "Phase 5: Publishing $PURPOSE to Joyent."
474 source $JUJU_DIR/joyentrc
475 cd $JUJU_DIST/tools/releases/
476 ${SCRIPT_DIR}/manta_sync.py $destination/releases/ *.tgz
477@@ -125,7 +127,7 @@
478 else
479 local destination=$STREAMS_TESTING_DEST
480 fi
481- echo "Phase 6: $EVENT to streams.canonical.com."
482+ echo "Phase 6: Publishing $PURPOSE to streams.canonical.com."
483 source $JUJU_DIR/streamsrc
484 rsync -avzh $JUJU_DIST/ $destination
485 }
486@@ -137,7 +139,7 @@
487 test $# -eq 3 || usage
488
489 PURPOSE=$1
490-if [[ $PURPOSE != "release" && $PURPOSE != "testing" ]]; then
491+if [[ ! $PURPOSE =~ ^(release|proposed|devel|testing)$ ]]; then
492 echo "Invalid PURPOSE."
493 usage
494 fi
495@@ -154,12 +156,6 @@
496 usage
497 fi
498
499-if [[ $PURPOSE == "release" ]]; then
500- EVENT="Release"
501-else
502- EVENT="Testing"
503-fi
504-
505
506 check_deps
507 publish_to_aws
508@@ -168,4 +164,4 @@
509 publish_to_azure
510 publish_to_joyent
511 publish_to_streams
512-echo "$EVENT data published to all CPCs."
513+echo "Published $PURPOSE data to all CPCs."

Subscribers

People subscribed via source and target branches