-
Notifications
You must be signed in to change notification settings - Fork 2
/
dist.sh
45 lines (38 loc) · 1 KB
/
dist.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
38
39
40
41
42
43
44
45
# Build and ship hdpm distribution to JLab CUE
name=hdpm
ver=$(hdpm version | awk '{print $3}')
target=/group/halld/www/halldweb/html/dist/${name}
mkdir -p ${target}
target2=/group/halld/Software/${name}
mkdir -p ${target2}
# Build for 64-bit Linux
GOOS=linux GOARCH=amd64 go build -ldflags '-s'
# Pack and ship to halldweb
dir=${name}-${ver}
mkdir -p ${dir}/bin
mv hdpm ${dir}/bin
cp -p README.md setup.*sh ${dir}
tarfile=${dir}.linux.tar.gz
tar czf ${tarfile} ${dir}
mv ${tarfile} ${target}
chgrp -R halld ${target}
# If it's a release, move it to halld software folder
if [[ ! -d "${target2}/${ver}" && "${ver}" != "dev" ]]; then
mv ${dir} ${ver}
mv ${ver} ${target2}
chgrp -R halld ${target2}
else
rm -rf ${dir}
fi
# Build for 64-bit macOS
GOOS=darwin GOARCH=amd64 go build
# Pack and ship to halldweb
dir=${name}-${ver}
mkdir -p ${dir}/bin
mv hdpm ${dir}/bin
cp -p README.md setup.*sh ${dir}
tarfile=${dir}.macOS.tar.gz
tar czf ${tarfile} ${dir}
rm -rf ${dir}
mv ${tarfile} ${target}
chgrp -R halld ${target}