-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew.sh
executable file
·52 lines (42 loc) · 987 Bytes
/
new.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
50
51
52
#!/bin/bash
function usage () {
echo "Usage: $BASH_SOURCE ToolName URL"
}
if [[ $# -ne 2 ]]; then
usage
exit 2
fi
git init ${1,,}-srf
cd ${1,,}-srf
hub create -d "Apptainer recipe files for $1 (${2})" powerPlant/${1,,}-srf
echo "Apptainer recipe files for " >> README.md
cat > Apptainer.version <<'EOF'
Bootstrap: docker
From: ubuntu:jammy
Stage: build
%post
## Download build prerequisites
apt-get update
apt-get -y install git make build-dependency1
## Build
cd /opt
git clone URL
make
Bootstrap: docker
From: ubuntu:jammy
Stage: final
%labels
Maintainer @plantandfood.co.nz
Version
%files from build
/opt/URL/bin/tool /usr/local/bin/
%runscript
exec tool "$@"
==OR==
if [ -x /usr/local/bin/$APPTAINER_NAME ]; then
exec $APPTAINER_NAME "$@"
else
/bin/echo -e "This Apptainer image cannot provide a single entrypoint. Please use \"apptainer exec $APPTAINER_NAME <cmd>\", where <cmd> is one of the following:\n"
exec ls /usr/local/bin
fi
EOF