Automate rpm build.

Change-Id: Id3c4fe7590fa8c8dff827fa783880acb4beeba70
This commit is contained in:
Douglas Mendizabal 2013-07-16 00:23:52 -05:00
parent 041180dde5
commit af9f827437
3 changed files with 22 additions and 1 deletions

View File

@ -1,4 +1,4 @@
%define version 0.1.20130713041652
%define version BUILD_VERSION
%define release 1
Summary: Common files for Barbican Key Manager

13
rpmbuild/build_rpm.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
pushd $PWD
mkdir -p rpmbuild/{BUILD,RPMS,S{OURCE,PEC,RPM}S}
BUILD_VERSION=$(ls dist | sed 's/^barbican-\([0-9]\+\.[0-9]\+\.[0-9]\+\)\.tar\.gz/\1/g')
export BUILD_VERSION
echo "Building RPM version $BUILD_VERSION"
cp "dist/barbican-$BUILD_VERSION.tar.gz" rpmbuild/SOURCES
sed -e s/BUILD_VERSION/$BUILD_VERSION/g -i rpmbuild/SPECS/barbican.spec
rpmbuild -ba rpmbuild/SPECS/barbican.spec
popd

8
rpmbuild/upload_rpm.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
echo "Uploading RPMs to yum-repo.cloudkeep.io"
pushd $PWD
scp rpmbuild/RPMS/noarch/*.rpm rpmbuild@yum-repo.cloudkeep.io:/var/www/html/centos/6/barbican/x86_64/
ssh rpmbuild@yum-repo.cloudkeep.io 'createrepo /var/www/html/centos/6/barbican/x86_64/'
popd