-
Notifications
You must be signed in to change notification settings - Fork 84
/
build_ign.sh
executable file
·37 lines (28 loc) · 1.22 KB
/
build_ign.sh
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
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Command line parameters:
# 1 - GitHub organization name. For example ignitionrobotics or osrf.
# 2 - the name of the ignition repository. For example ign-math.
# 3 - the name of the branch. For example ign-math6
# 4 - 'y' or 'n' without the quotes that indicate whether or not to upload docs
# 5 - Release date in the ISO 8601 format. See the command `date -Iseconds`.
# 6 - Password to https://api.ignitionrobotics.org/1.0/versions.
set -o errexit
set -o verbose
DEBIAN_FRONTEND=noninteractive
git clone https://github.com/$1/$2 -b $3
cd $2
sudo apt -y install \
$(sort -u $(find . -iname 'packages-'$SYSTEM_VERSION'.apt' -o -iname 'packages.apt') | tr '\n' ' ')
mkdir build
cd build
cmake ../ -DBUILD_TESTING=false
sudo make install
if [[ ! -z "$4" && "$4" != "n" ]]; then
# Upload documentation
sh upload_doc.sh $4
# Get the project version from cmake
version=`grep "project(.* VERSION" ../CMakeLists.txt | grep -oP "(?<=VERSION )[0-9].[0-9].[0-9]"`
# Get the libName from the second parameter
libName=`echo "$2" | grep -oP "(?<=ign-).*"`
curl -k -X POST -d '{"libName":"'"$libName"'", "version":"'"$version"'", "releaseDate":"'"$5"'","password":"'"$6"'"}' https://api.ignitionrobotics.org/1.0/versions
fi