forked from jenkinsci/jenkins
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·26 lines (21 loc) · 737 Bytes
/
Copy pathbuild.sh
File metadata and controls
executable file
·26 lines (21 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash -e
if [ -z "$1" ]; then
echo "Usage: build.sh path/to/jenkins.war"
exit 1
fi
sudo apt-get install -y rpm expect || true
# figure out the version to package
cp "$1" $(dirname $0)/SOURCES/jenkins.war
pushd $(dirname $0)
if [ -z "$2" ]; then
version=$(unzip -p SOURCES/jenkins.war META-INF/MANIFEST.MF | grep Implementation-Version | cut -d ' ' -f2 | tr - .)
else
version="$2"
fi
echo Version is $version
# prepare fresh directories
rm -rf BUILD RPMS SRPMS tmp || true
mkdir -p BUILD RPMS SRPMS
cat SOURCES/jenkins.repo.in | sed -e "s#@URL@#${RPM_URL}/#g" > SOURCES/jenkins.repo
# real action happens here
rpmbuild -ba --define="_topdir $PWD" --define="_tmppath $PWD/tmp" --define="ver $version" SPECS/jenkins.spec