mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-05 08:05:56 +00:00
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23786 71c3de6d-444a-0410-be80-ed276b4c234a
24 lines
666 B
Bash
Executable File
24 lines
666 B
Bash
Executable File
#!/bin/bash -e
|
|
if [ -z "$1" ]; then
|
|
echo "Usage: build.sh path/to/hudson.war"
|
|
exit 1
|
|
fi
|
|
|
|
# figure out the version to package
|
|
cp "$1" $(dirname $0)/SOURCES/hudson.war
|
|
pushd $(dirname $0)
|
|
version=$(unzip -p SOURCES/hudson.war META-INF/MANIFEST.MF | grep Implementation-Version | cut -d ' ' -f2 | tr - .)
|
|
echo Version is $version
|
|
|
|
# prepare fresh directories
|
|
rm -rf BUILD RPMS SRPMS tmp || true
|
|
mkdir -p BUILD RPMS SRPMS
|
|
|
|
# real action happens here
|
|
rpmbuild -ba --define="_topdir $PWD" --define="_tmppath $PWD/tmp" --define="ver $version" SPECS/hudson.spec
|
|
|
|
# sign the results
|
|
for rpm in $(find . -name '*.rpm'); do
|
|
./rpm-sign $(cat ~/.gpg.passphrase) $rpm
|
|
done
|