-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bash
executable file
·79 lines (61 loc) · 2.73 KB
/
build.bash
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
69
70
71
72
73
74
75
76
77
78
#!/bin/bash -l
cd
VERSION=$(cat ~/build/VERSION)-$(date +"%Y%m%d%H%M%S")
echo "Version is " $VERSION
echo $VERSION > ~/build/VERSION.tmp
echo "Setting up Conda.."
rm -rf /opt/gina/sandy-utils-$VERSION
conda config --add channels conda-forge
conda create -y -p /opt/gina/sandy-utils-$VERSION gdal ruby=2.6.5 libffi pkg-config gxx_linux-64 conda-pack git lftp
conda activate /opt/gina/sandy-utils-$VERSION
#echo "Conda setup."
echo "Installing ruby gems.."
export GEM_HOME="/opt/gina/sandy-utils-$VERSION/vendor/bundle"
export GEM_PATH="/opt/gina/sandy-utils-$VERSION:/opt/gina/sandy-utils-$VERSION/vendor/bundle"
echo "setting ld library path.."
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/gina/sandy-utils-$VERSION/lib
echo "Copying sandy-utils to build area.."
cd ~/build
cp -rv lib/processing_framework* /opt/gina/sandy-utils-$VERSION/lib/
cp -rv config /opt/gina/sandy-utils-$VERSION/config
cp -v Gemfile Gemfile.lock config README.md VERSION CHANGELOG.md notes.md LICENSE Rakefile /opt/gina/sandy-utils-$VERSION
mkdir -p /opt/gina/sandy-utils-$VERSION/tools
./build_bin_stubs.rb bin/*
chmod a+rx /opt/gina/sandy-utils-$VERSION/tools/*
echo "Installing gems required for Sandy-utils.."
cd /opt/gina/sandy-utils-$VERSION
bundle install --deployment
echo "Done with ruby gems.."
echo "Installing Processing Utils"
cd /opt/gina/sandy-utils-$VERSION
git clone [email protected]:gina-alaska/processing-utils.git
cd processing-utils
bundle install --binstubs
bin/rake
echo "Building Dan's Scripts"
cd ~/build
git clone [email protected]:gina-alaska/dans-gdal-scripts.git
cd dans-gdal-scripts
./autogen.sh
./configure --prefix=/opt/gina/sandy-utils-$VERSION
make
make install
echo "Ddditional Environment Setting.."
echo export VERSION=$VERSION > /opt/gina/sandy-utils-$VERSION/env.sh
echo source /opt/gina/sandy-utils-$VERSION/bin/activate >> /opt/gina/sandy-utils-$VERSION/env.sh
echo export GEM_HOME="/opt/gina/sandy-utils-$VERSION/vendor/bundle" >> /opt/gina/sandy-utils-$VERSION/env.sh
echo export GEM_PATH="/opt/gina/sandy-utils-$VERSION:/opt/gina/sandy-utils-$VERSION/vendor/bundle" >> /opt/gina/sandy-utils-$VERSION/env.sh
echo export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/opt/gina/sandy-utils-$VERSION/lib >> /opt/gina/sandy-utils-$VERSION/env.sh
echo export PATH=\$PATH:/opt/gina/sandy-utils-$VERSION/processing-utils/bin >> /opt/gina/sandy-utils-$VERSION/env.sh
echo "Making package..."
cd ~/build
SB_TARBALL="sandy-utils-$VERSION.pre.tar.gz"
rm $SB_TARBALL
conda pack -q --n-threads -1 --compress-level 0 -o $SB_TARBALL
rm -rf ~/build/sandy-utils-$VERSION
mkdir ~/build/sandy-utils-$VERSION
cd ~/build/sandy-utils-$VERSION
tar -xf ~/build/$SB_TARBALL
cd ~/build
cp build_log.txt sandy-utils-$VERSION/
tar --bzip2 -cf sandy-utils-$VERSION.tar.bz2 sandy-utils-$VERSION