annotate docker_legacy/do_all.sh @ 176:e7df6534e387 default tip

association: ajout du compte rendu de l'AG extraordinaire du 17 décembre 2022
author Goffi <goffi@goffi.org>
date Tue, 17 Jan 2023 14:13:58 +0100
parents 29873a41aae1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
164
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
1 #!/bin/sh
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
2
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
3 # This script build all container in the right order
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # Copyright (C) 2014 Jérôme Poisson (goffi@goffi.org)
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
5
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
6 # This program is free software: you can redistribute it and/or modify
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # it under the terms of the GNU Affero General Public License as published by
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
8 # the Free Software Foundation, either version 3 of the License, or
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # (at your option) any later version.
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
10
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
11 # This program is distributed in the hope that it will be useful,
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # GNU Affero General Public License for more details.
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
15
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
16 # You should have received a copy of the GNU Affero General Public License
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
18
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
19 DIRS="base media sat_nomedia sat jp primitivus sat_pubsub prosody salut libervia data"
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
20 ACCOUNT="salutatoi"
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
21
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
22 ori_dir=$(pwd)
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
23
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
24 if [ $# -eq 0 ]; then
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
25 cmd="build"
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
26 else
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
27 case $1 in
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
28 build)
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
29 cmd="build"
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
30 BEFORE="-t"
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
31 AFTER="."
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
32 ;;
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
33 push)
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
34 cmd="push"
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
35 TAG=":latest"
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
36 ;;
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
37 pull)
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
38 cmd="pull"
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
39 TAG=":latest"
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
40 ;;
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
41 *)
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
42 printf "Invalid command ($1)\n"
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
43 exit 1
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
44 ;;
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
45 esac
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
46
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
47 shift
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
48 fi
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
49
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
50 for cont_dir in $DIRS; do
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
51 cont_name=$(grep -o "Salut à Toi/[^ ]\+" $cont_dir/Dockerfile | sed "s&Salut à Toi/&&" | tr '[:upper:]' '[:lower:]')
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
52 cd "$cont_dir"
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
53 printf "\n==> Doing a $cmd for $ACCOUNT/$cont_name in $cont_dir with extra [$@] <===\n\n"
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
54 docker $cmd $BEFORE "$ACCOUNT/${cont_name}${TAG}" "$@" $AFTER
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
55 err=$?
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
56 cd "$ori_dir"
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
57 if [ $err -ne 0 ]; then
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
58 printf "$cmd of $cont_name failed (exit code $err), exiting\n"
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
59 exit 1
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
60 fi
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
61 done