Skip to content

Instantly share code, notes, and snippets.

@hoenirvili

hoenirvili/build.sh

Last active Jun 20, 2019
Embed
What would you like to do?
#!/bin/bash
# DEFAULTS
BRANCH=master
BUILDWIN=true
BUILDUNIX=true
while [[ $# > 0 ]]
do
key="$1"
case $key in
-b)
BRANCH="$2"
shift
;;
--win-only)
BUILDUNIX=false
;;
--unix-only)
BUILDWIN=false
;;
esac
shift
done
rm -rf /home/$USER/.local/share/juju/tools
mkdir /home/$USER/.local/share/juju/tools
mkdir /home/$USER/.local/share/juju/tools/devel
mkdir /home/$USER/.local/share/juju/tools/streams
if [ "$BUILDWIN" = true ] ; then
buildwin.sh $BRANCH
fi
if [ "$BUILDUNIX" = true ] ; then
buildunix.sh $BRANCH
fi
#!/bin/bash
TOOLSDIR=$HOME/.local/share/juju/tools
#TOOLSDIR=$HOME/.juju/tools
mkdir -p $TOOLSDIR/devel
GOBIN=$GOPATH/bin
OldWD=$PWD
cd $GOPATH/src/github.com/juju/juju
git checkout $1
godeps -f -u dependencies.tsv
go install github.com/juju/juju/...
VERSION=$(grep "const version" version/version.go | cut -d '"' -f 2)
TRUSTY=juju-$VERSION-trusty-amd64.tgz
CENTOS=juju-$VERSION-centos7-amd64.tgz
XENIAL=juju-$VERSION-xenial-amd64.tgz
YAKKETY=juju-$VERSION-yakkety-amd64.tgz
cd $OldWD
cp $GOBIN/jujud .
tar -czf $TRUSTY jujud
tar -czf $CENTOS jujud
tar -czf $XENIAL jujud
tar -czf $YAKKETY jujud
cp $TRUSTY $TOOLSDIR/devel
cp $CENTOS $TOOLSDIR/devel
cp $XENIAL $TOOLSDIR/devel
cp $YAKKETY $TOOLSDIR/devel
rm jujud
rm $TRUSTY
rm $CENTOS
rm $XENIAL
rm $YAKKETY
#!/bin/bash
TOOLSDIR=$HOME/.local/share/juju/tools
mkdir -p $TOOLSDIR/devel
GOBIN=$GOPATH/bin
OldWD=$PWD
cd $GOPATH/src/github.com/juju/juju
git checkout $1
godeps -f -u dependencies.tsv
GOOS=windows GOARCH=amd64 go install github.com/juju/juju/...
VERSION=$(grep "const version" version/version.go | cut -d '"' -f 2)
WIN=juju-$VERSION-win2012hvr2-amd64.tgz
WIN2=juju-$VERSION-win2012r2-amd64.tgz
WIN3=juju-$VERSION-win2012-amd64.tgz
WIN4=juju-$VERSION-win2016-amd64.tgz
WIN5=juju-$VERSION-win81-amd64.tgz
WIN6=juju-$VERSION-win10-amd64.tgz
WIN7=juju-$VERSION-win2008r2-amd64.tgz
WIN8=juju-$VERSION-win2016nano-amd64.tgz
cd $OldWD
cp $GOBIN/windows_amd64/jujud.exe .
tar -czf $WIN jujud.exe
tar -czf $WIN2 jujud.exe
tar -czf $WIN3 jujud.exe
tar -czf $WIN4 jujud.exe
tar -czf $WIN5 jujud.exe
tar -czf $WIN6 jujud.exe
tar -czf $WIN7 jujud.exe
tar -czf $WIN8 jujud.exe
cp $WIN $TOOLSDIR/devel
cp $WIN2 $TOOLSDIR/devel
cp $WIN3 $TOOLSDIR/devel
cp $WIN4 $TOOLSDIR/devel
cp $WIN5 $TOOLSDIR/devel
cp $WIN6 $TOOLSDIR/devel
cp $WIN7 $TOOLSDIR/devel
cp $WIN8 $TOOLSDIR/devel
rm jujud.exe
rm $WIN
rm $WIN2
rm $WIN3
rm $WIN4
rm $WIN5
rm $WIN6
rm $WIN7
rm $WIN8
#!/bin/bash
build.sh -b $1
uploadtools.sh
#!/bin/bash
TOOLSDIR=$HOME/.local/share/juju/tools
WWWHOME=/var/www/html
rm -rf $TOOLSDIR/streams
juju-metadata generate-tools --debug --stream devel
find $TOOLSDIR -type d -print0 | xargs -0 chmod 755
find $TOOLSDIR -type f -print0 | xargs -0 chmod 644
rm -rf $WWWHOME/toolsdir/tools
cp -r $TOOLSDIR $WWWHOME/toolsdir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment