~abentley/juju-ci-tools/client-from-config-4

« back to all changes in this revision

Viewing changes to publish-revision

  • Committer: Aaron Bentley
  • Date: 2014-11-03 20:35:09 UTC
  • mto: This revision was merged to the branch mainline in revision 717.
  • Revision ID: aaron.bentley@canonical.com-20141103203509-pz9kq41cyml3qeha
Extract describe_substrate from inject-metadata.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
set -eux
 
3
 
 
4
: ${LOCAL_JENKINS_URL=$JENKINS_URL}
 
5
BUILD_PACKAGES=${BUILD_PACKAGES:-true}
 
6
TARFILE=$($SCRIPTS/get-tarfile-name)
 
7
VERSION=$(basename $TARFILE .tar.gz | cut -d '_' -f2)
 
8
 
 
9
OFFICIAL_VERSIONS="$STREAMS/juju-dist/proposed/tools/releases"
 
10
if [[ -f $OFFICIAL_VERSIONS/juju-$VERSION-trusty-amd64.tgz ]]; then
 
11
    echo "$VERSION was published. This version is invalid to test."
 
12
    echo "Maybe juju's version needs updating?"
 
13
    exit 1
 
14
fi
 
15
 
 
16
if [[ $BUILD_PACKAGES == 'true' ]]; then
 
17
wget -q $LOCAL_JENKINS_URL/job/build-revision/lastSuccessfulBuild/artifact/$TARFILE
 
18
 
 
19
# Make source packages for all supported series.
 
20
if [[ $VERSION =~ ^1.(18|20|22).*$ ]]; then
 
21
    PURPOSE="stable"
 
22
else
 
23
    PURPOSE="devel"
 
24
fi
 
25
$RELEASE_TOOLS/make-source-packages.bash -t $PURPOSE $TARFILE \
 
26
    'Curtis Hovey <curtis.hovey@canonical.com>'
 
27
 
 
28
# Load the credentials to create instances in ec2.
 
29
set +x
 
30
source $JUJU_HOME/ec2rc
 
31
set -x
 
32
 
 
33
# Build binary packages for select series.
 
34
for dsc in $(find . -maxdepth 2 -name '*.dsc')
 
35
do
 
36
    series=$(echo "$dsc" | cut -d '~' -f 2 | cut -d '.' -f 1,2)
 
37
    if [[ $series == '12.04' ]]; then
 
38
        echo "Building precise amd64"
 
39
        $RELEASE_TOOLS/build-package-with-dsc.bash m1.large ami-36aa4d5e $dsc
 
40
    elif [[ $series == '13.10' ]]; then
 
41
        echo "Skipping Saucy"
 
42
    elif [[ $series == '14.04' ]]; then
 
43
        if [[ -n ${PPC_SSH_OPTIONS:-} ]]; then
 
44
            echo "Building trusty ppc64"
 
45
            set +e
 
46
            $RELEASE_TOOLS/build-package-with-dsc.bash ubuntu@stilson-07 \
 
47
                "$PPC_SSH_OPTIONS" $dsc
 
48
            set -e
 
49
        else
 
50
            echo "Skipping trusty ppc64"
 
51
        fi
 
52
        echo "Building trusty amd64"
 
53
        $RELEASE_TOOLS/build-package-with-dsc.bash m1.large ami-b027efd8 $dsc
 
54
        echo "Building trusty i386"
 
55
        if [[ -n ${I386_SSH_OPTIONS:-} ]]; then
 
56
            $RELEASE_TOOLS/build-package-with-dsc.bash ubuntu@i386-slave \
 
57
                    "$I386_SSH_OPTIONS" $dsc
 
58
        else
 
59
            $RELEASE_TOOLS/build-package-with-dsc.bash \
 
60
                m1.medium ami-81dee0e8 $dsc
 
61
        fi
 
62
        if [[ -n ${ARM_SSH_OPTIONS:-} ]]; then
 
63
            echo "Building trusty arm64"
 
64
            set +e
 
65
            $RELEASE_TOOLS/build-package-with-dsc.bash ubuntu@arm64-slave \
 
66
                "$ARM_SSH_OPTIONS" $dsc
 
67
            set -e
 
68
        else
 
69
            echo "Skipping trusty arm64"
 
70
        fi
 
71
    elif [[ $series == '14.10' ]]; then
 
72
        echo "Building utopic amd64"
 
73
        $RELEASE_TOOLS/build-package-with-dsc.bash ubuntu@utopic-slave \
 
74
                "$UTOPIC_SSH_OPTIONS" $dsc
 
75
    fi
 
76
done
 
77
fi
 
78
 
 
79
$RELEASE_TOOLS/assemble-streams.bash -t $WORKSPACE/ testing $VERSION $STREAMS
 
80
PUBLISH_ARGS="testing $STREAMS/juju-dist cpc"
 
81
$RELEASE_TOOLS/publish-public-tools.bash $PUBLISH_ARGS || \
 
82
    $RELEASE_TOOLS/publish-public-tools.bash $PUBLISH_ARGS || \
 
83
        $RELEASE_TOOLS/publish-public-tools.bash $PUBLISH_ARGS