Intégration de la branche release-9.14.0

This commit is contained in:
Jephté Clain 2023-03-15 17:48:48 +04:00
commit c0d4e950e9
143 changed files with 3936 additions and 267 deletions

View File

@ -1,3 +1,49 @@
## Version 9.14.0 du 15/03/2023-17:48
* `3ecb127` support docker compose v2
* `432ab6f` dkbuild: composer et mvn ne sont lancés qu'en mode build
* `01c14bb` regcp: ajout de l'option -n
* `0913c2e` upassword: rendre configurable le nombre de blocs
* `61433fb` dkbuild: revert image par défaut pour javabuilder
* `e4e0a55` pff: support mode vcs offline
* `e08c66b` pff: support des archives sh de l'amue
* `0d11932` dkbuild: corriger l'image javabuilder par défaut
* `3ead1f3` dkbuild: utiliser automatiquement l'image si nécessaire pour composer ou maven
* `93de256` ajout de regcp et regmv
* `5e33a36` rendre cohérent les en-têtes des scripts
* `9e13515` ajout exemple .dkbuild.env
* `c9e8110` dkbuild: corriger calcul des tags
* `c671cb3` dkbuild: fin support tag & last version
* `1a764f1` dkbuild: début support tag & last version
* `027f9b8` dkbuild: ajout de from_glob()
* `2293239` maj doc
* `9fc07bb` dkbuild: ajout build add-tags=
* `7b15f94` dkbuild: support préfixe et suffixe pour version
* `f2cfaee` dkbuild: calculer extract automatiquement
* `c36b8fb` dkbuild: corriger le support des paramètres sans argument
* `68a42d0` dkbuild: maj templates
* `306e77f` dkbuild: calcul de la version à partir d'un fichier ou d'un chemin
* `b006bb4` Maj des fichiers
* `6963d41` uproject: push -f force le push
* `9665d5a` cx-conndev: maj doc
* `137dfa9` repoctl, uproject: ne plus enlever le suffixe .git
* `440d2aa` upassword: maj nombre de blocs par défaut
* `f4047a3` ipaddr: forcer la sortie couleur
* `af1bdd3` Maj des fichiers
* `85e77e4` dkbuild: corriger le calcul de la dernière version d'une distribution
* `a56ec0e` dkbuild: améliorer clean
* `d6e78b9` dkbuild: maj messages debug
* `1699cc5` dkbuild: les fichiers d'environnement par défaut ont l'extension .env
* `2ae8406` maj doc dkbuild
* `1db7d08` maj doc cx-shelldev
* `aba08c2` maj update-nutools
* `e83b6d1` possibilité de choisir l'adresse IP
* `af9096d` ajouter le template fichier vide
* `89f0c09` typo
* `fb434c2` bug parse_date
* `f7ab14f` dkbuild: implémentation initiale
* `f46812f` cx-conndev: maj doc
## Version 9.13.0 du 07/02/2022-22:20
* `06686d9` pff: support nettoyage wsdl/

View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS service
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire service
function display_help() {
uecho "$scriptname: s'assurer que les services sont lancés pour un type de virtualisation

4
SKvm
View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS virsh
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire virsh
function display_help() {
uecho "$scriptname: lancer une machine virtuelle kvm

View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: lancer une machine virtuelle VirtualBox

View File

@ -1,3 +1,8 @@
# TODO
dkbuild
* setversion peut prendre la version depuis la branche git d'un dépôt
* un argument permettrait de spécifier comment la version est calculée à
partir du dépôt
-*- coding: utf-8 mode: markdown -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8:noeol:binary

View File

@ -1 +1 @@
9.13.0
9.14.0

2
_root
View File

@ -1,6 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
source "$(dirname -- "$0")/lib/ulib/ulib" || exit 1
urequire base
function display_help() {

View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS template apache.tools
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire template apache.tools
apacheconfig_initvars
function display_help() {

View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: Se connecter sur un site FTP authentifié

3
caturl
View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: Afficher une url

View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: créer un utilisateur sudoer et lui installer une clé publique ssh

3
cssh
View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: Faire une connexion ssh en lançant automatiquement un screen sur l'hôte distant

View File

@ -1,18 +1,26 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
[ -n "$COMPOSE_V1" ] && DOCKER_COMPOSE=(docker-compose) || DOCKER_COMPOSE=(docker compose)
function display_help() {
uecho "$scriptname: se connecter à la base MySQL
USAGE
$scriptname [DATABASE]
$scriptname -c|-d [-uUSER [-pPASSWORD]] ...
$scriptname -d [-uUSER [-pPASSWORD]] DATABASES... >backup.sql
$scriptname -c [-uUSER [-pPASSWORD]] <backup.sql
OPTIONS
--compose-v1
Forcer l'utilisation de docker-compose v1
-h, -s, --service SERVICE
Spécifier le nom du service. La valeur par défaut est db
-i, --ipnum IPNUM
Si le service est dans plusieurs réseaux, sélectionner le numéro du
réseau à attaquer en commençant à 1 (la liste sera affichée si cette
option n'est pas spécifiée)
-c, --mysql-cmd
Lancer 'mysql -hSERVICE_IP' avec les arguments supplémentaires fournis
sur la ligne de commande
@ -28,6 +36,7 @@ OPTIONS
}
service=db
ipnum=
mysql_cmd=
mysqldump_cmd=
klean=
@ -35,7 +44,9 @@ user=
password=
args=(
--help '$exit_with display_help'
--compose-v1 '$DOCKER_COMPOSE=(docker-compose)'
-h:,-s:,--service: service=
-i:,--ipnum: ipnum=
-c,--mysql-cmd mysql_cmd=1
-d,--mysqldump-cmd mysqldump_cmd=1
-k,--klean klean=1
@ -66,12 +77,26 @@ fi
###
function die_not_found() { die "$service: service introuvable. vérifiez que le projet est actuellement up"; }
setx cid=docker-compose ps -q "$service" 2>/dev/null || die_not_found
setx cid="${DOCKER_COMPOSE[@]}" ps -q "$service" 2>/dev/null || die_not_found
[ -n "$cid" ] || die_not_found
edebug "$service id: $cid"
function die_not_found() { die "$service: $cid: ip introuvable"; }
setx ip=docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$cid" || die_not_found
setx ip=docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}},{{end}}' "$cid" || die_not_found
[ -n "$ip" ] || die_not_found
ipdesc="${ip%,}"
if [ -z "$ipnum" ] && [[ "$ipdesc" == *,* ]]; then
enote "Le service est accessible sur plusieurs adresses ip: $ipdesc"
enote "Pensez à spécifier l'option -i pour désigner l'adresse à utiliser (-i1 pour la première, -i2 pour la seconde, etc.)"
fi
if [ -n "$ipnum" ]; then
let ipnum=ipnum-1
while [ $ipnum -gt 0 ]; do
ip="${ip#*,}"
let ipnum=ipnum-1
done
fi
ip="${ip%%,*}"
[ -n "$ip" ] || die_not_found
edebug "$service ip: $ip"
@ -87,7 +112,7 @@ elif [ -n "$klean" ]; then
estep "wait 10sec..."
sleep 10
estep "start"
docker-compose start "$service"
"${DOCKER_COMPOSE[@]}" start "$service"
else
[ -f bin/conndev.php ] || die "Impossible de trouver le script compagnon conndev.php"

View File

@ -1,29 +1,33 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
[ -n "$COMPOSE_V1" ] && DOCKER_COMPOSE=(docker-compose) || DOCKER_COMPOSE=(docker compose)
function display_help() {
uecho "$scriptname: ouvrir un shell dans le container
USAGE
$scriptname [SHELL]
$scriptname [CMD...]
OPTIONS
--compose-v1
Forcer l'utilisation de docker-compose v1
-h, -s, --service SERVICE
Spécifier le nom du service sur lequel ouvrir le shell
-d
-d, --db
équivalent à -s db
-w
-w, --web
équivalent à -s web (c'est la valeur par défaut)"
}
service=web
args=(
--help '$exit_with display_help'
--compose-v1 '$DOCKER_COMPOSE=(docker-compose)'
-h:,-s:,--service: service=
-d service=db
-w service=web
-d,--db service=db
-w,--web service=web
)
parse_args "$@"; set -- "${args[@]}"
@ -48,9 +52,9 @@ fi
###
setx cid=docker-compose ps -q "$service" 2>/dev/null || die "$service: service introuvable"
setx cid="${DOCKER_COMPOSE[@]}" ps -q "$service" 2>/dev/null || die "$service: service introuvable"
cmd=("$@")
[ ${#cmd[*]} -gt 0 ] || cmd=(bash)
docker-compose exec "$service" "${cmd[@]}"
"${DOCKER_COMPOSE[@]}" exec "$service" "${cmd[@]}"

View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: mettre à jour un module ur/* ou lib/* sans utiliser composer

46
dk
View File

@ -1,6 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/auto" || exit 1
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire pff json
function display_help() {
@ -1237,7 +1237,7 @@ function default_update_build_env() {
function update_build_env() { default_update_build_env "$@"; }
function default_compose_build() {
${FAKE:+qvals} docker-compose \
${FAKE:+qvals} "${DOCKER_COMPOSE[@]}" \
"${replace_env_args[@]}" "${env_args[@]}" \
build \
${NO_CACHE:+--no-cache} \
@ -1307,7 +1307,7 @@ function auto_build() {
}
function default_compose_push() {
${FAKE:+qvals} docker-compose \
${FAKE:+qvals} "${DOCKER_COMPOSE[@]}" \
"${replace_env_args[@]}" "${env_args[@]}" \
push \
"$@"
@ -1345,7 +1345,7 @@ function auto_push() {
}
function default_compose_up() {
${FAKE:+qvals} docker-compose \
${FAKE:+qvals} "${DOCKER_COMPOSE[@]}" \
"${replace_env_args[@]}" "${env_args[@]}" \
up "${replace_run_args[@]}" "${run_args[@]}" \
"${replace_user_args[@]}" "${user_args[@]}" "$@"
@ -1379,7 +1379,7 @@ function auto_up() {
}
function default_compose_stop() {
${FAKE:+qvals} docker-compose \
${FAKE:+qvals} "${DOCKER_COMPOSE[@]}" \
"${replace_env_args[@]}" "${env_args[@]}" \
stop "${replace_stop_args[@]}" "${stop_args[@]}" \
"$@"
@ -1408,7 +1408,7 @@ function auto_stop() {
}
function default_compose_logs() {
${FAKE:+qvals} docker-compose \
${FAKE:+qvals} "${DOCKER_COMPOSE[@]}" \
"${replace_env_args[@]}" "${env_args[@]}" \
logs "${replace_logs_args[@]}" "${logs_args[@]}" \
"$@"
@ -1439,7 +1439,7 @@ function auto_logs() {
}
function default_compose_down() {
${FAKE:+qvals} docker-compose \
${FAKE:+qvals} "${DOCKER_COMPOSE[@]}" \
"${replace_env_args[@]}" "${env_args[@]}" \
down "${replace_down_args[@]}" "${down_args[@]}" \
"$@"
@ -1474,7 +1474,7 @@ function auto_down() {
}
function default_compose_run() {
${FAKE:+qvals} docker-compose \
${FAKE:+qvals} "${DOCKER_COMPOSE[@]}" \
"${replace_env_args[@]}" "${env_args[@]}" \
run "${replace_run_args[@]}" "${run_args[@]}" \
"${replace_user_args[@]}" "${user_args[@]}" "$@"
@ -1545,7 +1545,7 @@ function auto_run() {
}
function default_compose_exec() {
${FAKE:+qvals} docker-compose \
${FAKE:+qvals} "${DOCKER_COMPOSE[@]}" \
"${replace_env_args[@]}" "${env_args[@]}" \
exec "${replace_exec_args[@]}" "${exec_args[@]}" \
"$@"
@ -1759,7 +1759,7 @@ function auto_status() {
function default_compose_show_ip() {
local -a cmd cids; local cid
cmd=(
docker-compose
"${DOCKER_COMPOSE[@]}"
"${replace_env_args[@]}" "${env_args[@]}"
ps -q "${replace_show_ip_args[@]}" "${show_ip_args[@]}"
"$@"
@ -1795,7 +1795,23 @@ function auto_show_ip() {
}
function default_compose_systemd_unit() {
local docker_compose="$(which docker-compose 2>/dev/null)"
local -a docker_compose
if [ "${DOCKER_COMPOSE[0]}" == docker ]; then
# compose v2
local docker="$(which docker 2>/dev/null)"
if [ -z "$docker" ]; then
if [ -x /usr/bin/docker ]; then
docker=/usr/bin/docker
elif [ -x /usr/local/bin/docker ]; then
docker=/usr/local/bin/docker
else
die "Impossible de trouver docker"
fi
fi
docker_compose=("$docker" compose)
else
# compose v1
docker_compose="$(which docker-compose 2>/dev/null)"
if [ -z "$docker_compose" ]; then
if [ -x /usr/bin/docker-compose ]; then
docker_compose=/usr/bin/docker-compose
@ -1805,11 +1821,12 @@ function default_compose_systemd_unit() {
die "Impossible de trouver docker-compose"
fi
fi
setx startcmd=qvals "$docker_compose" \
fi
setx startcmd=qvals "${docker_compose[@]}" \
"${replace_env_args[@]}" "${env_args[@]}" \
up "${replace_run_args[@]}" "${run_args[@]}" \
"${replace_user_args[@]}" "${user_args[@]}" "$@"
setx stopcmd=qvals "$docker_compose" down
setx stopcmd=qvals "${docker_compose[@]}" down
}
function default_docker_systemd_unit() {
local docker="$(which "$DOCKER" 2>/dev/null)"
@ -2390,6 +2407,8 @@ elif progexists podman; then DOCKER=podman
else DOCKER=docker
fi
[ -n "$COMPOSE_V1" ] && DOCKER_COMPOSE=(docker-compose) || DOCKER_COMPOSE=(docker compose)
DEFAULT_PROFILE=devel
PROFILE=
DM_ALIASES=()
@ -2431,6 +2450,7 @@ update_apps_origin=
update_apps_branch=
args=(
--help '$exit_with display_help'
--compose-v1 '$DOCKER_COMPOSE=(docker-compose)'
-d:,--chdir: chdir=
-c:,--config: CONFIG=
-p:,--profile: PROFILE=

3060
dkbuild Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source /etc/ulibauto || exit 1
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire install
function display_help() {

2
dmctl
View File

@ -1,6 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source /etc/ulibauto || exit 1
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: import/exporter une docker-machine

View File

@ -11,7 +11,7 @@ if [ "$#" -eq 1 -a "$1" == --nutools-makelinks ]; then
exit 0
fi
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
source "$(dirname -- "$0")/lib/ulib/ulib" || exit 1
urequire base
function display_help() {

View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: afficher les connexions TCP entrantes sur un port

View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS ipcalc
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire ipcalc
function display_help() {
uecho "$scriptname: s'assurer que l'hôte courant a l'adresse IP spécifiée

3
fconv
View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: convertir un fichier ou les fichiers d'un répertoire

3
fnconv
View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: renommer un fichier ou les fichiers d'un répertoire

3
fndate
View File

@ -11,8 +11,7 @@ if [ "$#" -eq 1 -a "$1" == --nutools-makelinks ]; then
exit 0
fi
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: manipuler des noms de fichier pour les dater

View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: lancer une commande pour un ensemble d'arguments

3
geturl
View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: Télécharger un fichier avec wget ou curl

4
ipaddr
View File

@ -7,7 +7,9 @@ elif [ -x /bin/ip ]; then IP=/bin/ip
else IP=ip
fi
tty -s <&1 && isatty=1 || isatty=
if [ -n "IPADDR_COLOR" ]; then isatty=1
else tty -s <&1 && isatty=1 || isatty=
fi
"$IP" addr "$@" | awk -v isatty="$isatty" '
isatty && $0 ~ /^[0-9]/ {

View File

@ -0,0 +1,6 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
if profile prod test; then
setenv REGISTRY=docker.univ-reunion.fr
else
setenv REGISTRY=docker.self
fi

View File

@ -0,0 +1 @@
php

View File

@ -0,0 +1,3 @@
*.zip filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.tar.gz filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,2 @@
.~lock*#
.*.swp

View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
FROM $REGISTRY/debian/min:$DIST
#RUN /debian/pkg i

View File

@ -0,0 +1,2 @@
/b/t/
**/.git/

View File

@ -0,0 +1,3 @@
/b/
/Dockerfile
# autogénéré

View File

@ -0,0 +1,11 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
setdists d11
# fichiers communs
copy ../common/ ./ gitignore=.
dockerfile "" Dockerfile.in sed="
s/\\\$REGISTRY/$REGISTRY/
s/\\\$DIST/$DIST/
"
build

View File

@ -0,0 +1 @@
../dkbuild.env

View File

@ -0,0 +1,9 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
dists=(
d11
)
setdists "${dists[@]}"
if dist d11; then
include d11
fi

View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
setenv REGISTRY=docker.univ-reunion.fr
setenv IMAGE=$REGISTRY/GROUP/NAME

3
lib/dkbuild/templates/php/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/Dockerfile
.~lock*#
.*.swp

View File

@ -0,0 +1,25 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
if profile prod; then
default checkout branch=master
elif profile test devel; then
default checkout branch=develop
fi
default composer image=$REGISTRY/image/phpbuilder:$DIST
## web ########################################################################
checkout https://git.univ-reunion.fr/sda-php/NAME-app b/web
composer b/web
dockerfile
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
FROM $REGISTRY/image/apache-php-myiccas:$DIST
#RUN /debian/pkg i
#ENV MSMTP_ENABLE=1
#COPY b/web/config/msmtp /msmtp-config
COPY b/web/config/ssl /ssl-config
COPY b/web/config/apache /apache-config
COPY b/web/config/php /php-config
#COPY b/web/config/before-start-apache /
COPY b/web /var/www/app
build

View File

@ -0,0 +1,4 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
setenv REGISTRY=docker.univ-reunion.fr
setenv IMAGE=$REGISTRY/GROUP/NAME
setenv DIST=d11

View File

@ -0,0 +1,6 @@
/docker-compose.yml
/docker-compose.*.yml
/web/Dockerfile
/db/Dockerfile
.~lock*#
.*.swp

View File

@ -0,0 +1,37 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
setprofiles prod test devel
if profile prod; then
default checkout branch=master
elif profile test devel; then
default checkout branch=develop
fi
default composer image=$REGISTRY/image/phpbuilder:$DIST
## web ########################################################################
checkout https://git.univ-reunion.fr/sda-php/NAME-app web/b/web
composer web/b/web
dockerfile context=web
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
FROM $REGISTRY/image/apache-php-myiccas:$DIST
#RUN /debian/pkg i
#ENV MSMTP_ENABLE=1
#COPY b/web/config/msmtp /msmtp-config
COPY b/web/config/ssl /ssl-config
COPY b/web/config/apache /apache-config
COPY b/web/config/php /php-config
#COPY b/web/config/before-start-apache /
COPY b/web /var/www/app
## db #########################################################################
copy web/b/web/config/sqlmig db/config/mariadb/sqlmig
dockerfile context=db
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
FROM $REGISTRY/image/mariadb:$DIST
COPY config/mariadb /mariadb-config

View File

@ -0,0 +1,4 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
setenv REGISTRY=docker.univ-reunion.fr
setenv IMAGE=$REGISTRY/GROUP/NAME
setenv DIST=d11

View File

@ -0,0 +1,12 @@
# -*- coding: utf-8 mode: yaml -*- vim:sw=2:sts=2:et:ai:si:sta:fenc=utf-8
version: "3.7"
services:
db:
image: $REGISTRY/devel/GROUP/NAME-db
web:
image: $REGISTRY/devel/GROUP/NAME-web
environment:
- APP_PROFILE=devel
- BASE_URL=http://NAME.self

View File

@ -0,0 +1,14 @@
# -*- coding: utf-8 mode: yaml -*- vim:sw=2:sts=2:et:ai:si:sta:fenc=utf-8
version: "3.7"
services:
db:
image: $REGISTRY/GROUP/NAME-db
web:
image: $REGISTRY/GROUP/NAME-web
environment:
- APP_PROFILE=prod
- BASE_URL=https://NAME.univ-reunion.fr
extra_hosts:
- "casn.univ-reunion.fr:10.85.1.15"

View File

@ -0,0 +1,14 @@
# -*- coding: utf-8 mode: yaml -*- vim:sw=2:sts=2:et:ai:si:sta:fenc=utf-8
version: "3.7"
services:
db:
image: $REGISTRY/test/GROUP/NAME-db
web:
image: $REGISTRY/test/GROUP/NAME-web
environment:
- APP_PROFILE=test
- BASE_URL=https://NAME-test.univ-reunion.fr
extra_hosts:
- "casn.univ-reunion.fr:10.85.1.15"

View File

@ -0,0 +1,34 @@
# -*- coding: utf-8 mode: yaml -*- vim:sw=2:sts=2:et:ai:si:sta:fenc=utf-8
version: "3.7"
services:
db:
build: db
volumes:
- db-data:/var/lib/mysql
networks:
default:
aliases:
- NAMEdb
deploy:
update_config:
order: stop-first
web:
build: web
volumes:
- log-data:/var/log/apache2
- session-data:/var/lib/php/sessions
extra_hosts:
- "smtp.univ.run:10.82.70.46"
- "vs-apoprod-bdd.univ.run:10.82.91.11"
- "vs-apotest-bdd.univ.run:10.82.91.13"
- "vs-apodevp-bdd.univ.run:10.82.91.15"
deploy:
update_config:
order: start-first
volumes:
db-data:
log-data:
session-data:

View File

@ -0,0 +1,8 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
# Description des templates de ce répertoire
TEMPLATES=(
[image]="Image générique basée sur debian"
[php]="Application web PHP"
[php_db]="Application web PHP avec base de données"
)

5
lib/dkbuild/tests/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
/Dockerfile
/src
/dest
/srcdir/
/destdir/

View File

@ -0,0 +1,2 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
setenv REGISTRY=jclain.fr

View File

@ -0,0 +1,16 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
section "variables de build"
setarg A="arg A"
resetarg B="arg B"
info "A=${ARGS[A]}, B=${ARGS[B]}"
if [ "${ARGS[A]}" != x ]; then
note "\
Essayer de relancer avec
$(qvals dkbuild -j "$(relpath "$DKBUILD")" --arg A=x --arg B=y)
on ne devrait pas pouvoir modifier la valeur de B"
fi
# pas de build automatique
AUTOBUILD=

View File

@ -0,0 +1,13 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
setenv REGISTRY=docker.univ-reunion.fr
setenv IMAGE=$REGISTRY/group/name
info "IMAGE=$IMAGE"
if [ "$REGISTRY" == docker.univ-reunion.fr ]; then
note "\
Essayer de relancer avec
$(qvals dkbuild -j "$(relpath "$DKBUILD")" -c registry.env)
La valeur de IMAGE devrait changer"
fi
AUTOBUILD=

View File

@ -0,0 +1,15 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
run rm -rf src dest srcdir destdir
run mkdir srcdir
genfile srcdir/src <<<"file"
run ln -s src srcdir/link
copy srcdir destdir
if run; then
[ -f destdir/src ] || die "destdir/src n'a pas été créé"
diff -qr srcdir destdir || die "srcdir et destdir ne sont pas identiques"
fi
AUTOBUILD=

View File

@ -0,0 +1,13 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
run rm -rf src dest srcdir destdir
run mkdir srcdir
genfile srcdir/src <<<"file"
run ln -s src srcdir/link
genfile dest <<<"dest"
copy srcdir dest
info "on ne devrait pas arriver ici"
AUTOBUILD=

View File

@ -0,0 +1,13 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
setdists d11 d10
setprofiles prod test
if dist LATEST; then
info "$DIST est la distribution la plus récente"
fi
if profile DEFAULT; then
info "$PROFILE est le profil par défaut"
fi
# pas de build automatique
AUTOBUILD=

View File

@ -0,0 +1,20 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
setdists v1-d11 v2-d11 v1-d10
setenv IMAGE=dkbuild-tests/distversions
dockerfile
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
FROM scratch
ENV var=$DIST-$VERSION
build
info "vérifier les images construites avec
dk ls dkbuild-tests/distversions
on devrait avoir les images suivantes:
dkbuild-tests/distversions:v1-d10
dkbuild-tests/distversions:d10 -> v1-d10
dkbuild-tests/distversions:v1-d11
dkbuild-tests/distversions:v2-d11
dkbuild-tests/distversions:d11 -> v2-d11
dkbuild-tests/distversions:latest -> v2-d11
"

View File

@ -0,0 +1,14 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
run rm -rf src dest srcdir destdir
genfile src <<<"file"
run mkdir destdir
copy src destdir
if run; then
[ -f destdir/src ] || die "destdir/src n'a pas été créé"
diff -q src destdir/src || die "src et destdir/src ne sont pas identiques"
fi
AUTOBUILD=

View File

@ -0,0 +1,13 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
run rm -rf src dest srcdir destdir
genfile src <<<"file"
copy src dest
if run; then
[ -f dest ] || die "dest n'a pas été créé"
diff -q src dest || die "src et dest ne sont pas identiques"
fi
AUTOBUILD=

View File

@ -0,0 +1,27 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
run rm -rf src dest srcdir destdir
run mkdir srcdir
genfile srcdir/src <<<"file"
run ln -s src srcdir/link
run mkdir destdir
genfile destdir/.gitignore <<<"/a/"
copy srcdir destdir/a gitignore=destdir
copy srcdir destdir/b gitignore=destdir
if run; then
[ -f destdir/a/src ] || die "destdir/a/src n'a pas été créé"
[ -f destdir/b/src ] || die "destdir/b/src n'a pas été créé"
[ -L destdir/a/link ] || die "destdir/a/link n'a pas été créé"
[ -L destdir/b/link ] || die "destdir/b/link n'a pas été créé"
ignored="$(<destdir/.gitignore)"
expected="\
/a/
/b/link
/b/src"
[ "$ignored" == "$expected" ] || die "les fichiers n'ont pas été ignorés"
fi
AUTOBUILD=

View File

@ -0,0 +1,16 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
if machine fast5; then
setprofiles prod
elif machine fast4; then
setprofiles test
else
setprofiles devel test prod
fi
if run; then
echo "PROFILE=$PROFILE"
fi
# pas de build automatique
AUTOBUILD=

View File

@ -0,0 +1,16 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
section "première section"
note "une note"
info "une première info"
info "une deuxième info"
debug "message de debug"
section "deuxième section"
note "une note"
info "une première info"
info "une deuxième info"
debug "message de debug"
# pas de build automatique
AUTOBUILD=

View File

@ -0,0 +1,8 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
setenv IMAGE=dkbuild-tests/tags0
dockerfile
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
FROM scratch
ENV var=empty
build

View File

@ -0,0 +1,9 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
setprofiles v1-prod v2-prod
setenv IMAGE=dkbuild-tests/tags1
dockerfile
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
FROM scratch
ENV var=empty
build

View File

@ -0,0 +1,16 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
section "variables d'environnement"
setenv A="env A"
resetenv B="env B"
info "A=$A, B=$B"
if [ "$A" != x ]; then
note "\
Essayer de relancer avec
$(qvals dkbuild -j "$(relpath "$DKBUILD")" -e A=x -e B=y)
on ne devrait pas pouvoir modifier la valeur de B"
fi
# pas de build automatique
AUTOBUILD=

View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname:

View File

@ -7,6 +7,7 @@ NAMES=(
package.html:javadoc-package
)
EXTS=(
lst:empty
txt:text
conf:conf
sql:sql
@ -50,7 +51,7 @@ TEMPLATES=(
# Scripts à utiliser pour générer les templates
TEMPLS=(
text:text conf:text sql:text sieve:text yaml:text
empty:text text:text conf:text sql:text sieve:text yaml:text
markdown:wiki tiddlywiki:wiki
puml:plantuml iuml:plantuml
shell:shell

View File

@ -23,9 +23,9 @@ OPTIONS
}
NAME=text
TEMPLATES=(text conf sql sieve yaml)
TEMPLATES=(empty text conf sql sieve yaml)
NAMES=()
EXTS=(txt conf sql sieve yml yaml)
EXTS=(lst txt conf sql sieve yml yaml)
if [ $# -eq 2 ]; then
if [ "$1" == "--matches-template" ]; then
@ -58,6 +58,16 @@ function check_overwrite() {
return 0
}
function generate_empty() {
local file="$1"
check_overwrite "$1" || return
estep "$(ppath "$file")"
touch "$file"
[ -n "$2" ] && array_add "$2" "$file"
return 0
}
function generate_text() {
local file="$1"
local mode=text
@ -150,6 +160,7 @@ for file in "$@"; do
fi
case "$t" in
empty) generate_empty "$file" files2edit || r=$?;;
text|txt|t) generate_text "$file" files2edit || r=$?;;
conf|c) generate_conf "$file" files2edit || r=$?;;
sql) generate_sql "$file" files2edit || r=$?;;

View File

@ -42,6 +42,7 @@ done
./ulink --nutools-makelinks
./doinplace --nutools-makelinks
./fndate --nutools-makelinks
./regcp --nutools-makelinks
# complétion programmable
rm -f ~/etc/bashrc.d/bash_completion.nutools # renommé

View File

@ -391,7 +391,7 @@ function get_time_fr() {
}
function parse_date() {
local value="$1" type="${2:-date}"
local now="$(awk 'BEGIN { print mktime(strftime("%Y %m %d 00 00 00 +0400")) }')"
local now="$(awk 'BEGIN { print mktime(strftime("%Y %m %d 00 00 00")) }')"
case "$value" in
=*) value="${value#=}";;
+*) value="$(($now + ${value#+} * 86400))";;
@ -402,7 +402,7 @@ function parse_date() {
m = $2 + 0; if (m < 1) m = nm;
if ($3 == "") y = ny;
else { y = $3 + 0; if (y < 100) y = y + 2000; }
print mktime(sprintf("%04i %02i %02i 00 00 00 +0400", y, m, d));
print mktime(sprintf("%04i %02i %02i 00 00 00", y, m, d));
}')";;
esac
case "$type" in
@ -1424,6 +1424,7 @@ function is_archive() {
name="${name%.jar}"
name="${name%.war}"
name="${name%.ear}"
[ "$NUTOOLS_SH_ARCHIVE_SUPPORT" ] && name="${name%.sh}"
[ "$name" != "$1" ]
}
function extract_archive() {
@ -1445,6 +1446,12 @@ function extract_archive() {
cd "$destdir"
jar xf "$arch" "$@"
) || return
elif [ "$NUTOOLS_SH_ARCHIVE_SUPPORT" ] && endswith "$arch" .sh; then
(
arch="$(abspath "$arch")"
cd "$destdir"
"${BASH:-/bin/sh}" "$arch" --tar xf "$@"
) || return
else
return 1
fi
@ -1462,6 +1469,7 @@ function get_archive_basename() {
basename="${basename%.jar}"
basename="${basename%.war}"
basename="${basename%.ear}"
[ "$NUTOOLS_SH_ARCHIVE_SUPPORT" ] && basename="${basename%.sh}"
# résultat
echo "$basename"
}
@ -1481,6 +1489,7 @@ function get_archive_appname() {
appname="${appname%.jar}"
appname="${appname%.war}"
appname="${appname%.ear}"
[ "$NUTOOLS_SH_ARCHIVE_SUPPORT" ] && appname="${appname%.sh}"
# supprimer la version et afficher
echo "$appname" | awk '{
if (match($0, /[-_.]([0-9]+([-_.][0-9]+)*([a-zA-Z][0-9]*|[-_.][0-9]+[a-zA-Z][0-9]*)?)$/)) {

View File

@ -617,23 +617,23 @@ function git_push() {
if [ -n "$all" ]; then
# On a demandé à pusher toutes les branches et tous les tags
local r
git push --all "$@"; r=$?
git push --all ${force:+--force} "$@"; r=$?
if [ $r -eq 0 ]; then
git push --tags "$@"; r=$?
git push --tags ${force:+--force} "$@"; r=$?
fi
return $r
elif [ -n "$all_branches" ]; then
# On a demandé à pusher toutes les branches
git push --all "$@"
git push --all ${force:+--force} "$@"
return $?
elif [ -n "$all_tags" ]; then
# On a demandé à pusher tous les tags
git push --tags "$@"
git push --tags ${force:+--force} "$@"
return $?
elif [ $# -gt 0 ]; then
# Sinon, si des arguments sont spécifiés, les passer à git sans
# modification
git push "$@"
git push ${force:+--force} "$@"
return $?
elif git_have_annex; then
# Si une annexe existe dans le dépôt, demander à git-annex de faire la

View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS apache.tools
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire apache.tools
function display_help() {
uecho "$scriptname: Créer un fichier de redirections pour Apache à partir d'un certain

3
mkiso
View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: créer une image iso d'un répertoire

3
mkurl
View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: Enregistrer une url dans un fichier raccourci

3
mkusfx
View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: Créer une archive auto-extractible qui installe son contenu avec uinst

3
mocifs
View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: Monter un partage Windows/Samba/CIFS

3
modav
View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: Monter un répertoire sur un hôte distant avec davfs

3
moiso
View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: Monter une image ISO

3
mossh
View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: Monter un répertoire sur un hôte distant avec sshfs

4
mssh
View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib"
urequire DEFAULTS ipcalc
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire ipcalc
if [ $# -eq 1 -a "$1" == "--help" ]; then
exit_with uecho "$scriptname: Faire une connexion ssh en utilisant l'exécutable approprié au réseau source et destination

View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: Faire une requête MySQL et formater la sortie pour traitement avec awkcsv

View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS awk
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire awk
function display_help() {
uecho "$scriptname: Charger une table MySQL avec un fichier csv

View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS debian
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire debian
function display_help() {
uecho "$scriptname: gérer la configuration du réseau

View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
function display_help() {
uecho "$scriptname: configurer ou afficher des informations sur nutools

View File

@ -1,7 +1,6 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
# faut-il supprimer la sortie erreur? les warnings de GTK sont horripilants.
: "${OPENURL_STDERR:=}"

4
pdev
View File

@ -13,8 +13,8 @@ complete -F __pdev_completion pdev
exit 0
fi
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS ptools
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire ptools
function display_help() {
uecho "$scriptname: basculer sur une branche de développement

46
pff
View File

@ -16,6 +16,7 @@ ORIGEXT=pff
DEFAULT_ORIGEXTS=(".$ORIGEXT" .origine .default)
PFFCONF=.pff.conf # ne pas modifier
DEFAULT_PROTECTS=(/.git/ .svn/ /pff/ "/$PFFCONF")
NUTOOLS_SH_ARCHIVE_SUPPORT=1
PFFCONFVARS=(
"VERSION//Version actuellement installée"
@ -118,8 +119,8 @@ complete -F __pff_completion -o bashdefault -o default pff
exit 0
fi
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS multiconf vcs javaproperties
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire multiconf vcs javaproperties
function display_help() {
uecho "$scriptname: gestion de modifications locales
@ -269,6 +270,10 @@ supportées sont:
s'il veut faire commit & push dans git (--ask-commit, la valeur par
défaut), le faire sans confirmation (--commit), ou ne jamais le faire
(--no-commit)
--no-push
Ne pas faire de push après un commit. On peut aussi lancer la commande
suivante avant pff:
export UTOOLS_VCS_OFFLINE=1
-b, --add-global FILES...
Ajouter/Identifier un fichier comme un fichier local pour tous les
@ -619,7 +624,7 @@ function autoinit() {
# Lancer les commandes AUTO_CMDS
local cwd cmd
if [ ${#AUTO_CMDS[*]} -gt 0 ]; then
eetitle "AutoCmds"
etitle "AutoCmds"
cwd="$(pwd)"
cd "$pffdir"
for cmd in "${AUTO_CMDS[@]}"; do
@ -807,15 +812,22 @@ function new__prepare_archive() {
enote "Auto-sélection du type distribution de patch sur la base de l'extension .zip"
DISTTYPE=patch
;;
*.sh)
die "Ce type d'archive ne contient pas l'information du type de distribution. Vous devez spécifier l'une des options -F ou -H"
;;
*)
die "L'extension de l'archive n'est pas reconnue. Vous devez spécifier l'une des options -F ou -H"
;;
esac
fi
local -a tmpargs
case "$archive" in
*.sh) tmpargs=(--exclude cleanup.sh --exclude install.sh);;
esac
ac_set_tmpdir tmpd
estep "Extraction de $(ppath "$archive" "$cwd")"
extract_archive "$archive" "$tmpd" || die
extract_archive "$archive" "$tmpd" "${tmpargs[@]}" || die
srcdir="$tmpd"
if [ -n "$unwrap" ]; then
@ -859,22 +871,21 @@ function new__prepare_archive() {
local "$destver"; upvar "$destver" "$version"
}
function new_cmd_amue_clean_libs() {
# en mode distribution "patch", supprimer le contenu du répertoire
# WEB-INF/lib si ces fichiers sont relivrés
function new_cmd_amue_clean() {
# en mode distribution "patch", supprimer le contenu des répertoires
# spécifiés s'ils sont relivrés
[ "$DISTTYPE" == patch ] || return
if [ -n "$(/bin/ls -d "$srcdir/WEB-INF/lib"/* 2>/dev/null)" ]; then
rm -f WEB-INF/lib/*
fi
}
function new_cmd_amue_clean_wsdl() {
# en mode distribution "patch", supprimer le contenu du répertoire
# WEB-INF/wsdl si ces fichiers sont relivrés
[ "$DISTTYPE" == patch ] || return
if [ -n "$(/bin/ls -d "$srcdir/WEB-INF/wsdl"/* 2>/dev/null)" ]; then
rm -f WEB-INF/wsdl/*
[ $# -gt 0 ] || set -- WEB-INF/{lib,classes/{gouv,com,org}} wsdl
local dir
for dir in "$@"; do
if [ -n "$(/bin/ls -d "$srcdir/$dir"/* 2>/dev/null)" ]; then
eval "rm -rf $dir/*"
fi
done
}
# compat
function new_cmd_amue_clean_libs() { new_cmd_amue_clean WEB-INF/lib; }
function new_cmd_amue_clean_wsdl() { new_cmd_amue_clean wsdl; }
function new_cmd() {
local autopatch="$1" version="$2" disttype="$3" unwrap="$4" merge_strategy="$5" commit_policy="$6"; shift; shift; shift; shift; shift; shift
@ -1805,6 +1816,7 @@ args=($parse_mode
--ask-commit commit_policy=ask
-c,--comit commit_policy=1
--no-commit commit_policy=
--no-push UTOOLS_VCS_OFFLINE=1
-b,--add-global action=add-global
--locals action=list-locals
--profiles action=list-profiles

4
prel
View File

@ -13,8 +13,8 @@ complete -F __prel_completion prel
exit 0
fi
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS ptools
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire ptools
# XXX Ajouter une option pour fusionner les modifications d'une branche de
# pré-release dans develop

4
pver
View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS ptools xmlsupport
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire ptools xmlsupport
function pver_display_help() {
uecho "$scriptname: gérer des numéros de version selon les règles du versionage sémantique v2.0.0 (http://semver.org/)

4
pz
View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS vcs ptools
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire vcs ptools
function display_help() {
uecho "$scriptname: faire une archive du projet

59
regcp Executable file
View File

@ -0,0 +1,59 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
ALIASES=(regmv)
if [ "$#" -eq 1 -a "$1" == --nutools-makelinks ]; then
# créer les liens
scriptname="$(basename "$0")"
for alias in "${ALIASES[@]}"; do
ln -s "$scriptname" "$alias"
done
exit 0
fi
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
case "$scriptname" in
regcp)
VERB="copier"
CMD=cp
;;
regmv)
VERB="déplacer"
CMD=mv
;;
esac
function display_help() {
uecho "$scriptname: $VERB un fichier vers une destination construite avec une expressions régulière
USAGE
$scriptname REGEXP FILEs....
NB: l'expression régulière est traitée avec sed, e.g s/FROM/TO/
OPTIONS
-n, --fake
Ne pas $VERB, afficher simplement ce qui serait fait"
}
fake=
args=(
--help '$exit_with display_help'
-n,--fake fake=1
)
parse_args "$@"; set -- "${args[@]}"
regexp="$1"; shift
[ -n "$regexp" ] || die "l'expression régulière est requise"
for src in "$@"; do
dest="$(sed "$regexp" <<<"$src")"
if [ "$src" == "$dest" ]; then
eerror "$src: refus de $VERB le fichier sur lui-même"
else
estep "$src --> $dest"
if [ -z "$fake" ]; then
"$CMD" "$src" "$dest" || die
fi
fi
done

View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS json
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire json
function display_help() {
uecho "$scriptname: piloter un serveur git (gitolite, gogs, gitea, etc.)
@ -47,7 +47,7 @@ ACTIONS
}
function repoctl_init() {
repourl="${1%.git}"
repourl="$1"
[ -n "$repourl" ] || return
rname=
rtype=gitolite

4
rruns
View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS runs runsmod
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire runs runsmod
function display_help() {
uecho "$scriptname: Déploiement distant avec runs

View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS pyulib/pyulib
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire pyulib/pyulib
function display_help() {
uecho "$scriptname: Déploiement distant avec toinst

4
ruinst
View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS pyulib/pyulib
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire pyulib/pyulib
function display_help() {
uecho "$scriptname: Déploiement distant avec uinst

4
runs
View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS runs runsmod
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire runs runsmod
function display_help() {
uecho "$scriptname: Lancer un script avec le protocole runs

View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS template runs
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire template runs
function display_help() {
uecho "$scriptname: Gérer un répertoire d'hôte de runs

View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS runsmod
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire runsmod
function display_help() {
uecho "$scriptname: récupérer des dépôts git à usage de runs

View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname -- "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS woinst
source "$(dirname -- "$0")/lib/ulib/auto" || exit 1
urequire woinst
function display_help() {
uecho "$scriptname: Déploiement distant avec woinst

Some files were not shown because too many files have changed in this diff Show More