added scripts for building and publishing packages to download.mirantis.com

This commit is contained in:
Roman Alekseenkov 2012-10-10 14:36:06 -07:00
parent dfb062ca42
commit d056f93073
2 changed files with 74 additions and 0 deletions

52
build-package.sh Executable file
View File

@ -0,0 +1,52 @@
#!/bin/bash
set -e
if [ ! $# == 1 ]; then
echo "Usage: $0 <release-tag>"
echo "Available release tags from git:"
for line in `git tag -l`; do echo " * $line (run \"$0 $line\")"; done
echo "In order to create a new release tag, use:"
echo " * git tag -a <release-tag> -m \"message\""
echo " * git push --tags"
exit
fi
# determine release tag
tag="$1"
build_dir="fuel-$tag"
# create directory
rm -rf $build_dir
mkdir $build_dir
# checkout fuel into it
git clone gitolite@gitolite.mirantis.com:fuel/fuel.git $build_dir
cd $build_dir
git checkout $tag
git submodule update --init
# remove git tracking
rm -rf `find . -name ".git*"`
# generate release version
echo $tag > release.version
# build documentation
cd docs
make html
cd ..
# copy it to the new directory
rm -rf documentation
mkdir documentation
cp -R docs/_build/html/* documentation/
# create archive
cd ..
tar -czf $build_dir.tar.gz "$build_dir/deployment/" "$build_dir/documentation/" "$build_dir/release.version"
# remove build directory
rm -rf $build_dir

22
publish-package.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
set -e
if [ ! $# == 1 ]; then
echo "Usage: $0 <fuel-package-name.tar.gz>"
echo "Available archives for publishing:"
for line in `ls fuel-*.tar.gz`; do echo " * $line (run \"$0 $line\")"; done
exit
fi
package_file="$1"
if [ ! -f $package_file ];
then
echo "File $package_file not found!"
exit
fi
rsync -v $package_file rsync://repo.srt.mirantis.net:/repo/fuel-releases/$package_file