source: orange/install-scripts/mac/bundle-daily-build-hg.sh @ 10289:4d3e15b67a7f

Revision 10289:4d3e15b67a7f, 1.8 KB checked in by Ales Erjavec <ales.erjavec@…>, 2 years ago (diff)

Don't build if there is already a bundle with the same revision. Publish the bundle on the web.

  • Property exe set to *
Line 
1#!/bin/bash -e
2#
3# ./bundle-daily-build-hg.sh
4#
5
6
7trap "echo \"Script failed\"" ERR
8
9# If possible get the orange tip revision number and check if the bundle already exists
10if [ -e /private/tmp/repos/orange ]; then
11    # Try to pull and update (pull returns 1 if no changesets)
12    hg pull --update -R /private/tmp/repos/orange || true
13    DAILY_REVISION=`hg log -r tip -R /private/tmp/repos/orange | grep 'changeset:' | cut -d ' ' -f 4 | cut -d ':' -f 1`
14else
15    DAILY_REVISION="tip"
16fi
17
18BUNDLE="/private/tmp/orange-bundle-hg-$DAILY_REVISION.dmg"
19       
20# Create the bundle if it does not yet exist
21if [[ ! -e /Volumes/download/orange-bundle-hg-0.0.$DAILY_REVISION.dmg || $DAILY_REVISION -eq "tip" ]]; then
22    echo "Building orange revision $DAILY_REVISION"
23    ./bundle-build-hg.sh /private/tmp tip $BUNDLE
24   
25    # Get the revision again in case it was "tip"
26    DAILY_REVISION=`hg log -r tip -R /private/tmp/repos/orange | grep 'changeset:' | cut -d ' ' -f 4 | cut -d ':' -f 1`
27
28
29    # TODO: Should be called only on a daily build server and not if building locally
30    /Users/ailabc/mount-dirs.sh
31
32    echo "Removing old versions of bundles."
33    # (Keeps last 5 versions.)
34    perl -e 'unlink ((reverse sort </Volumes/download/orange-bundle-hg-0*.dmg>)[5..10000])'
35
36    echo "Moving bundle to the download directory."
37    mv $BUNDLE /Volumes/download/orange-bundle-hg-0.0.$DAILY_REVISION.dmg
38   
39    echo "Setting permissions."
40    chmod +r /Volumes/download/orange-bundle-hg-0.0.$DAILY_REVISION.dmg
41   
42    echo "Registering new bundles."
43    egrep -v '^(MAC_DAILY)=' /Volumes/download/filenames_mac.set > /Volumes/download/filenames_mac.set.new
44    echo "MAC_DAILY=orange-bundle-hg-0.0.$DAILY_REVISION.dmg" >> /Volumes/download/filenames_mac.set.new
45    mv /Volumes/download/filenames_mac.set.new /Volumes/download/filenames_mac.set
46
47else
48    echo "The bundle with revision $DAILY_REVISION already exists."
49fi
Note: See TracBrowser for help on using the repository browser.