Blame view

docker/PYROS_DOCKER_BUILD 673 Bytes
2be8242a   Etienne Pallier   Ajout du shebang ...
1
#!/usr/bin/env bash
3552b2ad   Alexis Koralewski   Add new shell scr...
2

80d242ea   Etienne Pallier   ajout condition g...
3
# Git clone guitastro
8ca1d24c   Etienne Pallier   quelques commenta...
4
#
80d242ea   Etienne Pallier   ajout condition g...
5
6
7
# This could be done directly in the Dockerfile
# but it is better to do it here because if it failed during the build 
# we would have to do all the build again...
3552b2ad   Alexis Koralewski   Add new shell scr...
8
[ ! -d "../vendor/guitastro/" ] && git clone https://gitlab.irap.omp.eu/guitastrolib/guitastro.git ../vendor/guitastro/
80d242ea   Etienne Pallier   ajout condition g...
9
[ ! -d "../vendor/guitastro/" ] && echo "Error : git clone of GuitAstro failed => cannot go on with the build" && exit 1
3552b2ad   Alexis Koralewski   Add new shell scr...
10

a1cd846d   Alexis Koralewski   add export on pyr...
11
12
export CURRENT_UID=$(id -u)
export COMPUTER_HOSTNAME=$HOSTNAME
3552b2ad   Alexis Koralewski   Add new shell scr...
13

aa66d59c   Etienne Pallier   comments in docke...
14
15
16
17
# exit if root
if [ $CURRENT_UID -eq 0 ] ; then
    echo "You can't run this script as root, use a normal user"
    exit 1
3552b2ad   Alexis Koralewski   Add new shell scr...
18
19
fi

aa66d59c   Etienne Pallier   comments in docke...
20
21
# BUILD
docker compose build