-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·49 lines (39 loc) · 1.42 KB
/
install.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
46
47
48
49
#!/bin/bash
# This script will help you to install dependencies, spython and container-diff
# After install, you can use the provided extract.py scripts. You should have
# pip installed before running it.
exists () {
type "$1" >/dev/null 2>/dev/null
}
################################################################################
# Step 1: spython
################################################################################
## To Parse Dockerfile (Singularity Python)
if [ ! -x "$(which spython)" ] ; then
echo "Singularity python not found on path, installing with pip.";
if [ ! -x "$(which pip)" ] ; then
echo "pip is required to install dependencies.";
exit 1;
fi
if [ ! -f "requirements.txt" ]; then
echo "requirements.txt not found, return to repository root.";
exit 1;
else
pip install -r requirements.txt;
fi
else
echo "Singularity Python is installed";
fi
## Container Diff
# If container-diff not on PATH, get it
if [ ! -x "$(which container-diff)" ] ; then
echo "Container diff not found on PATH! Downloading to /tmp"
curl -LO https://storage.googleapis.com/container-diff/latest/container-diff-linux-amd64
chmod +x container-diff-linux-amd64
mkdir -p /tmp/bin
mv container-diff-linux-amd64 /tmp/bin/container-diff
# export to bash environment
export PATH="/tmp/bin:${PATH}"
else
echo "ContainerDiff is installed.";
fi