Blame view

docker/PYROS_DOCKER_UPDATE_AND_RESTART 629 Bytes
c755b87f   Etienne Pallier   new script PYROS_...
1
2
#!/usr/bin/env bash

a1cd846d   Alexis Koralewski   add export on pyr...
3
4
5
export CURRENT_UID=$(id -u)
export COMPUTER_HOSTNAME=$HOSTNAME

c755b87f   Etienne Pallier   new script PYROS_...
6
7
8
9
10
11
12
13
14
15
16
17
abort() {
    echo
    echo "********* !!! ERROR !!! ********"
    # display error msg
    echo $1
    echo "********* !!! ERROR !!! ********"
    echo
    # exit with error
    exit 1
}

# 1) Stop
c755b87f   Etienne Pallier   new script PYROS_...
18
./KILL_PYROS_DOCKER_RUN || abort "Could not kill"
085e388b   Etienne Pallier   added option web ...
19
20
# kill twice to be sure it's really dead !
#./KILL_PYROS_DOCKER_RUN
c755b87f   Etienne Pallier   new script PYROS_...
21
22
23
24
25
26
27
28

# 2) Update
./PYROS_DOCKER_UPDATE || abort "Could not update"

# 3) Test
./PYROS_DOCKER_TEST || abort "TESTS KO"

# 4) Start again
085e388b   Etienne Pallier   added option web ...
29
./PYROS_DOCKER_RUN $1 || abort "Could not run"
c755b87f   Etienne Pallier   new script PYROS_...
30
31
32

# See what's running
./KILL_PYROS_DOCKER_RUN no