~nskaggs/juju-release-tools/generate-release-notes

335.1.3 by Nicholas Skaggs
Add breakouts and common script points; add echos to original script
1
echo "Getting and updating juju-core dependencies to the required versions."
2
GOPATH=$WORK go get -v github.com/rogpeppe/godeps
3
GODEPS=$WORK/bin/godeps
4
if [[ ! -f $GODEPS ]]; then
5
    echo "! Could not install godeps."
6
    exit 1
7
fi
8
GOPATH=$WORK $GODEPS -u "$WORKPACKAGE/dependencies.tsv"
9
10
# Remove godeps, and non-free data
11
echo "Removing godeps and non-free data."
12
rm -rf $WORK/src/github.com/rogpeppe/godeps
13
rm -rf $WORK/src/github.com/kisielk
14
rm -rf $WORK/src/code.google.com/p/go.net/html/charset/testdata/
15
rm -f $WORK/src/code.google.com/p/go.net/html/charset/*test.go
16
rm -rf $WORK/src/golang.org/x/net/html/charset/testdata/
17
rm -f $WORK/src/golang.org/x/net/html/charset/*test.go
18
rm -rf $WORK/src/github.com/prometheus/procfs/fixtures
19
# Remove backup files that confuse lintian.
20
echo "Removing backup files"
21
find $WORK/src/ -type f -name *.go.orig -delete
22
23
# Validate the go src tree against dependencies.tsv
24
echo "Validating dependencies.tsv"
25
$SCRIPT_DIR/check_dependencies.py --delete-unknown --ignore $PACKAGE \
26
    "$WORKPACKAGE/dependencies.tsv" "$WORK/src"
27
28
# Apply patches against the whole source tree from the juju project
29
echo "Applying Patches"
30
if [[ -d "$WORKPACKAGE/patches" ]]; then
31
    $SCRIPT_DIR/apply_patches.py "$WORKPACKAGE/patches" "$WORK/src"
32
fi
33
34
# Run juju's fmt and vet script on the source after finding the right version
362 by Curtis Hovey
Run go fmt and vet every time the tree is assembled.
35
echo "Running format and vetting the build"
36
CHECKSCRIPT=./scripts/verify.bash
37
if [[ ! -f $WORKPACKAGE/scripts/verify.bash ]]; then
38
    CHECKSCRIPT=./scripts/pre-push.bash
335.1.3 by Nicholas Skaggs
Add breakouts and common script points; add echos to original script
39
fi
362 by Curtis Hovey
Run go fmt and vet every time the tree is assembled.
40
(cd $WORKPACKAGE && GOPATH=$WORK $CHECKSCRIPT)
335.1.3 by Nicholas Skaggs
Add breakouts and common script points; add echos to original script
41
42
# Remove binaries and build artefacts
43
echo "Removing binaries and build artifacts"
44
rm -r $WORK/bin
45
if [[ -d $WORK/pkg ]]; then
46
    rm -r $WORK/pkg
47
fi
48
49
echo "Rename to proper release version"
50
VERSION=$(sed -n 's/^const version = "\(.*\)"/\1/p' \
51
    $WORKPACKAGE/version/version.go)
52
53
# Change the generic release to the proper juju-core version.
54
mv $WORK $TMP_DIR/juju-core_${VERSION}/