-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild-sif.sh
More file actions
executable file
·34 lines (28 loc) · 920 Bytes
/
build-sif.sh
File metadata and controls
executable file
·34 lines (28 loc) · 920 Bytes
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
#!/bin/bash
VERSION=${VERSION:-18}
[[ -z $1 ]] && TAG=$(date +%F) || TAG=$1
MYHUBID=dataeditors
MYIMG=stata${VERSION}
SYLABSID=vilhuberlars
echo "======== Build SIF file for Stata $VERSION ========"
sudo singularity build stata${VERSION}.sif \
docker-daemon://${MYHUBID}/${MYIMG}:${TAG}
[[ $? == 0 ]] || exit 2
[[ -f stata${VERSION}.sif ]] && sudo chown $(id -u) stata${VERSION}.sif
echo "======== Sign SIF file for Stata $VERSION ========"
singularity sign stata${VERSION}.sif
echo "======== Push to Sylabs.io repository (under $MYHUBID ) ======="
echo "Ready to push?"
echo " singularity push stata${VERSION}.sif library://$SYLABSID/$MYHUBID/${MYIMG}:${TAG} "
read answer
case $answer in
y|Y)
singularity remote login SylabsCloud
singularity remote use SylabsCloud
singularity push stata${VERSION}.sif \
library://$SYLABSID/$MYHUBID/${MYIMG}:${TAG}
;;
*)
exit 0
;;
esac