-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild
More file actions
executable file
·68 lines (53 loc) · 1.35 KB
/
build
File metadata and controls
executable file
·68 lines (53 loc) · 1.35 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#! /bin/bash
#
# Usage:
# build [OS...]
#
# Parameters:
# OS an operating system to build the package for: centos6 or centos7
#
# Builds the iRODS msiSetAVU plugin packages. It writes each package into an OS
# specific subdirectory of libraries/.
#
readonly AllOSes=(centos6 centos7)
main()
{
local oses=("$@")
if [ ${#oses} -eq 0 ]
then
oses=(${AllOSes[*]})
else
for candidateOS in ${oses[*]}
do
local verified=false
for os in ${AllOSes[*]}
do
if [ "$candidateOS" = "$os" ]
then
verified=true
break
fi
done
if [ "$verified" = false ]
then
printf 'The OS %s is unsupported\n' "$candidateOS" >&2
return 1
fi
done
fi
local baseDir=$(dirname $(readlink --canonicalize "$0"))
for os in ${oses[*]}
do
docker build --file "$baseDir"/dockerfiles/Dockerfile."$os" --tag irods-dev-build:4.1.10-"$os" \
"$baseDir"
local library="$baseDir"/libraries/"$os"
local scratch="$baseDir"/scratch/"$os"
mkdir --parents "$library" "$scratch"
cp --update "$baseDir"/src/* "$scratch"
docker run --rm --tty --user=$(id -u):$(id -g) --volume="$scratch":/src --name=setavu-builder \
irods-dev-build:4.1.10-"$os" make all
cp --update "$scratch"/libmsiSetAVU.so "$library"
done
}
set -e
main "$@"