modifs.mineures sans commentaires
This commit is contained in:
parent
7c5fb1829a
commit
1b6afc3584
338
wip/_rel
338
wip/_rel
@ -13,20 +13,38 @@ DEVELOP=develop
|
|||||||
FEATURE=wip/
|
FEATURE=wip/
|
||||||
RELEASE=release-
|
RELEASE=release-
|
||||||
MAIN=master
|
MAIN=master
|
||||||
|
TAG_PREFIX=
|
||||||
TAG_SUFFIX=
|
TAG_SUFFIX=
|
||||||
HOTFIX=hotfix-
|
HOTFIX=hotfix-
|
||||||
DIST=
|
DIST=
|
||||||
NOAUTO=
|
NOAUTO=
|
||||||
|
|
||||||
|
function load_branches() {
|
||||||
|
setx CurrentBranch=git_get_branch
|
||||||
|
setx -a LocalBranches=git_list_branches
|
||||||
|
setx -a RemoteBranches=git_list_rbranches "$Origin"
|
||||||
|
setx -a AllBranches=git_list_pbranches "$Origin"
|
||||||
|
}
|
||||||
|
|
||||||
function load_config() {
|
function load_config() {
|
||||||
[ -z "$Config" -a -f .pman.conf ] && Config=.pman.conf
|
if [ -n "$ConfigFile" ]; then
|
||||||
if [ -n "$Config" ]; then
|
source "$ConfigFile" || die
|
||||||
source "$Config"
|
elif [ -n "$ConfigBranch" ]; then
|
||||||
|
if ! array_contains LocalBranches "$ConfigBranch"; then
|
||||||
|
die "$ConfigBranch: branche de configuration introuvable"
|
||||||
|
else
|
||||||
|
local config="$(git show "$ConfigBranch:.pman.conf" 2>/dev/null)"
|
||||||
|
[ -n "$config" ] || die "$ConfigBranch: aucune configuration trouvée sur cette branche"
|
||||||
|
eval "$config"
|
||||||
|
fi
|
||||||
|
elif [ -f .pman.conf ]; then
|
||||||
|
ConfigFile=.pman.conf
|
||||||
|
source "$ConfigFile"
|
||||||
else
|
else
|
||||||
source "$MYDIR/pman${MYNAME#_rel}.conf"
|
ConfigFile="$MYDIR/pman${MYNAME#_rel}.conf"
|
||||||
|
source "$ConfigFile"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setx CurrentBranch=git_get_branch
|
|
||||||
SrcBranch="$1"
|
SrcBranch="$1"
|
||||||
[ -n "$SrcBranch" ] || SrcBranch="$CurrentBranch"
|
[ -n "$SrcBranch" ] || SrcBranch="$CurrentBranch"
|
||||||
case "$SrcBranch" in
|
case "$SrcBranch" in
|
||||||
@ -45,23 +63,33 @@ function ensure_branches() {
|
|||||||
[ -n "$SrcBranch" -a -n "$DestBranch" ] ||
|
[ -n "$SrcBranch" -a -n "$DestBranch" ] ||
|
||||||
die "$SrcBranch: Aucune configuration de fusion trouvée pour cette branche"
|
die "$SrcBranch: Aucune configuration de fusion trouvée pour cette branche"
|
||||||
|
|
||||||
setx -a Branches=git_list_pbranches "$Origin"
|
array_contains AllBranches "$SrcBranch" || die "$SrcBranch: branche source introuvable"
|
||||||
array_contains Branches "$SrcBranch" || die "$SrcBranch: branche source introuvable"
|
array_contains AllBranches "$DestBranch" || die "$DestBranch: branche destination introuvable"
|
||||||
array_contains Branches "$DestBranch" || die "$DestBranch: branche destination introuvable"
|
|
||||||
|
|
||||||
local branch
|
local branch
|
||||||
ReleaseBranch=
|
ReleaseBranch=
|
||||||
for branch in "${Branches[@]}"; do
|
HotfixBranch=
|
||||||
|
for branch in "${AllBranches[@]}"; do
|
||||||
if [[ "$branch" == "$RELEASE"* ]]; then
|
if [[ "$branch" == "$RELEASE"* ]]; then
|
||||||
ReleaseBranch="$branch"
|
ReleaseBranch="$branch"
|
||||||
|
elif [[ "$branch" == "$HOTFIX"* ]]; then
|
||||||
|
HotfixBranch="$branch"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Initialisation
|
||||||
|
################################################################################
|
||||||
|
|
||||||
function init_action() {
|
function init_action() {
|
||||||
:
|
:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Informations
|
||||||
|
################################################################################
|
||||||
|
|
||||||
function _filter_rel() {
|
function _filter_rel() {
|
||||||
# enlever les commits "techniques" générés par ce script
|
# enlever les commits "techniques" générés par ce script
|
||||||
grep -v "Intégration de la branche $RELEASE" |
|
grep -v "Intégration de la branche $RELEASE" |
|
||||||
@ -102,6 +130,27 @@ function _list_commits() {
|
|||||||
_filter_rel
|
_filter_rel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DUMP_VARS=(
|
||||||
|
ConfigBranch
|
||||||
|
ConfigFile
|
||||||
|
--Configuration
|
||||||
|
UPSTREAM DEVELOP FEATURE RELEASE MAIN TAG_PREFIX TAG_SUFFIX HOTFIX DIST NOAUTO
|
||||||
|
--Paramètres
|
||||||
|
CurrentBranch
|
||||||
|
SrcType SrcBranch
|
||||||
|
DestBranch
|
||||||
|
)
|
||||||
|
|
||||||
|
function dump_action() {
|
||||||
|
for var in "${DUMP_VARS[@]}"; do
|
||||||
|
if [ "${var#--}" != "$var" ]; then
|
||||||
|
estep "${var#--}"
|
||||||
|
else
|
||||||
|
echo_setv "$var=${!var}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
function show_action() {
|
function show_action() {
|
||||||
local commits
|
local commits
|
||||||
setx commits=_list_commits
|
setx commits=_list_commits
|
||||||
@ -111,24 +160,124 @@ function show_action() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function merge_action() {
|
################################################################################
|
||||||
die "action non implémentée"
|
# Fusion de branche
|
||||||
}
|
################################################################################
|
||||||
|
|
||||||
function _script_echo() {
|
function _mscript_echo() {
|
||||||
echo >>"$script"
|
echo >>"$script"
|
||||||
echo "$comment$(qvals echo "$@")" >>"$script"
|
echo "$comment$(qvals echo "$@")" >>"$script"
|
||||||
}
|
}
|
||||||
|
|
||||||
function _script_add() {
|
function _mscript_add() {
|
||||||
[ $# -gt 0 ] && _script_echo "$*"
|
[ $# -gt 0 ] && _mscript_echo "$*"
|
||||||
cat >>"$script"
|
cat >>"$script"
|
||||||
}
|
}
|
||||||
|
|
||||||
function _script_start() {
|
function _mscript_start() {
|
||||||
>"$script"
|
>"$script"
|
||||||
_script_add <<EOF
|
_mscript_add <<EOF
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
merge=
|
||||||
|
push=
|
||||||
|
for arg in "\$@"; do
|
||||||
|
case "\$arg" in
|
||||||
|
merge) merge=1;;
|
||||||
|
push) push=1;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
EOF
|
||||||
|
chmod +x "$script"
|
||||||
|
}
|
||||||
|
|
||||||
|
function merge_action() {
|
||||||
|
local script=".git/rel-merge.sh"
|
||||||
|
local -a push_branches
|
||||||
|
|
||||||
|
[ -n "$Merge" ] || exit_with edebug "La fusion est désactivée. Ce script va s'arrêter"
|
||||||
|
|
||||||
|
enote "\
|
||||||
|
Ce script va
|
||||||
|
- fusionner la branche ${COULEUR_BLEUE}$SrcBranch${COULEUR_NORMALE} dans ${COULEUR_ROUGE}$DestBranch${COULEUR_NORMALE}${Push:+
|
||||||
|
- pousser les branches modifiées}"
|
||||||
|
ask_yesno "Voulez-vous continuer?" O || die
|
||||||
|
|
||||||
|
local comment=
|
||||||
|
local or_die=" || exit 1"
|
||||||
|
_rscript_start
|
||||||
|
_rscript_add <<EOF
|
||||||
|
################################################################################
|
||||||
|
# merge
|
||||||
|
if [ -n "\$merge" ]; then
|
||||||
|
EOF
|
||||||
|
_merge_any_branch "$DestBranch"
|
||||||
|
_rscript_add <<EOF
|
||||||
|
fi
|
||||||
|
EOF
|
||||||
|
|
||||||
|
_rscript_add <<EOF
|
||||||
|
################################################################################
|
||||||
|
# push
|
||||||
|
if [ -n "\$push" ]; then
|
||||||
|
EOF
|
||||||
|
_push_branches
|
||||||
|
_rscript_add <<EOF
|
||||||
|
fi
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if ! "$script" ${Merge:+merge} ${Push:+push}; then
|
||||||
|
eimportant "Veuillez consulter le script $script pour le détail des opérations qui n'ont pas pu êtres effectuées"
|
||||||
|
elif [ -z "$_KeepScript" ]; then
|
||||||
|
rm "$script"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function release_upstream_action() {
|
||||||
|
merge_action "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
function release_feature_action() {
|
||||||
|
merge_action "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
function release_main_action() {
|
||||||
|
merge_action "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
function release_dist_action() {
|
||||||
|
merge_action "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Création et gestion des releases
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
function _rscript_echo() {
|
||||||
|
echo >>"$script"
|
||||||
|
echo "$comment$(qvals echo "$@")" >>"$script"
|
||||||
|
}
|
||||||
|
|
||||||
|
function _rscript_add() {
|
||||||
|
[ $# -gt 0 ] && _rscript_echo "$*"
|
||||||
|
cat >>"$script"
|
||||||
|
}
|
||||||
|
|
||||||
|
function _rscript_start() {
|
||||||
|
>"$script"
|
||||||
|
_rscript_add <<EOF
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
create=
|
||||||
|
merge=
|
||||||
|
push=
|
||||||
|
for arg in "\$@"; do
|
||||||
|
case "\$arg" in
|
||||||
|
create) create=1;;
|
||||||
|
merge) merge=1;;
|
||||||
|
push) push=1;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
EOF
|
EOF
|
||||||
chmod +x "$script"
|
chmod +x "$script"
|
||||||
}
|
}
|
||||||
@ -144,39 +293,6 @@ Ces lignes ne seront pas incluses dans le fichier destination
|
|||||||
"
|
"
|
||||||
}
|
}
|
||||||
|
|
||||||
function release_action() {
|
|
||||||
local script=".git/rel-release.sh"
|
|
||||||
local release="${RELEASE}$Version"
|
|
||||||
local date changelog
|
|
||||||
local -a push_branches push_tags
|
|
||||||
|
|
||||||
case "$SrcType" in
|
|
||||||
hotfix)
|
|
||||||
enote "\
|
|
||||||
Vous allez intégrer la branche de hotfix ${COULEUR_BLEUE}$SrcBranch${COULEUR_NORMALE}
|
|
||||||
dans la branche destination ${COULEUR_VERTE}$DestBranch${COULEUR_NORMALE}"
|
|
||||||
ask_yesno "Voulez-vous continuer?" O || die
|
|
||||||
|
|
||||||
_init_changelog
|
|
||||||
echo "## Hotfix $Version du $date" >>"$changelog"
|
|
||||||
;;
|
|
||||||
release)
|
|
||||||
enote "\
|
|
||||||
Vous allez intégrer la branche de release ${COULEUR_BLEUE}$SrcBranch${COULEUR_NORMALE}
|
|
||||||
dans la branche destination ${COULEUR_VERTE}$DestBranch${COULEUR_NORMALE}"
|
|
||||||
ask_yesno "Voulez-vous continuer?" O || die
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
function release_upstream_action() {
|
|
||||||
merge_action "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
function release_feature_action() {
|
|
||||||
merge_action "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
function _create_release_branch() {
|
function _create_release_branch() {
|
||||||
local date changelog
|
local date changelog
|
||||||
|
|
||||||
@ -188,15 +304,13 @@ function _create_release_branch() {
|
|||||||
"${EDITOR:-nano}" +7 "$changelog"
|
"${EDITOR:-nano}" +7 "$changelog"
|
||||||
[ -s "$changelog" ] || exit_with ewarn "Création de la release annulée"
|
[ -s "$changelog" ] || exit_with ewarn "Création de la release annulée"
|
||||||
|
|
||||||
_script_start
|
|
||||||
|
|
||||||
# créer la branche de release et basculer dessus
|
# créer la branche de release et basculer dessus
|
||||||
_script_add "* create branch $ReleaseBranch" <<EOF
|
_rscript_add "* create branch $ReleaseBranch" <<EOF
|
||||||
$(qvals git checkout -b "$ReleaseBranch" "$SrcBranch")$or_die
|
$(qvals git checkout -b "$ReleaseBranch" "$SrcBranch")$or_die
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# créer le changelog
|
# créer le changelog
|
||||||
_script_add "* update CHANGES.md" <<EOF
|
_rscript_add "* update CHANGES.md" <<EOF
|
||||||
[ -s CHANGES.md ] && echo >>CHANGES.md
|
[ -s CHANGES.md ] && echo >>CHANGES.md
|
||||||
$(qvals echo "$(awk <"$changelog" '
|
$(qvals echo "$(awk <"$changelog" '
|
||||||
BEGIN { p = 0 }
|
BEGIN { p = 0 }
|
||||||
@ -207,42 +321,34 @@ git add CHANGES.md
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# mettre à jour la version
|
# mettre à jour la version
|
||||||
_script_add "* update VERSION.txt" <<EOF
|
_rscript_add "* update VERSION.txt" <<EOF
|
||||||
$(qvals echo "$Version") >VERSION.txt
|
$(qvals echo "$Version") >VERSION.txt
|
||||||
git add VERSION.txt
|
git add VERSION.txt
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Enregistrer les changements
|
# Enregistrer les changements
|
||||||
_script_add "* commit" <<EOF
|
_rscript_add "* commit" <<EOF
|
||||||
$(qvals git commit -m "Init changelog & version $Version")
|
$(qvals git commit -m "Init changelog & version $Version")
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
function _set_active() {
|
|
||||||
if [ -n "$1" ]; then
|
|
||||||
comment=; or_die=" || exit 1"
|
|
||||||
else
|
|
||||||
comment="#"; or_die=
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function _merge_release_branch() {
|
function _merge_release_branch() {
|
||||||
local dest="$1" tag="$2"
|
local dest="$1" tag="$2"
|
||||||
|
|
||||||
# basculer sur la branche
|
# basculer sur la branche
|
||||||
_script_add "* switch to branch $dest" <<EOF
|
_rscript_add "* switch to branch $dest" <<EOF
|
||||||
$comment$(qvals git checkout "$dest")$or_die
|
$comment$(qvals git checkout "$dest")$or_die
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# fusionner la branche de release
|
# fusionner la branche de release
|
||||||
_script_add "* merge branch $ReleaseBranch" <<EOF
|
_rscript_add "* merge branch $ReleaseBranch" <<EOF
|
||||||
$comment$(qvals git merge "$ReleaseBranch" -m "Intégration de la branche $ReleaseBranch" --no-ff)$or_die
|
$comment$(qvals git merge "$ReleaseBranch" -m "Intégration de la branche $ReleaseBranch" --no-ff)$or_die
|
||||||
EOF
|
EOF
|
||||||
array_addu push_branches "$dest"
|
array_addu push_branches "$dest"
|
||||||
|
|
||||||
# tagger la release
|
# tagger la release
|
||||||
if [ -n "$tag" ]; then
|
if [ -n "$tag" ]; then
|
||||||
_script_add "* create tag $tag" <<EOF
|
_rscript_add "* create tag $tag" <<EOF
|
||||||
$comment$(qvals git tag --force "$tag")$or_die
|
$comment$(qvals git tag --force "$tag")$or_die
|
||||||
EOF
|
EOF
|
||||||
array_addu push_tags "$tag"
|
array_addu push_tags "$tag"
|
||||||
@ -250,14 +356,14 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _delete_release_branch() {
|
function _delete_release_branch() {
|
||||||
_script_add "* delete branch $ReleaseBranch" <<EOF
|
_rscript_add "* delete branch $ReleaseBranch" <<EOF
|
||||||
$comment$(qvals git branch -D "$ReleaseBranch")$or_die
|
$comment$(qvals git branch -D "$ReleaseBranch")$or_die
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
function _push_branches() {
|
function _push_branches() {
|
||||||
local origin branch
|
local origin branch
|
||||||
_script_echo "* push branches"
|
_rscript_echo "* push branches"
|
||||||
for branch in "${push_branches[@]}"; do
|
for branch in "${push_branches[@]}"; do
|
||||||
origin="$Origin"
|
origin="$Origin"
|
||||||
[ -n "$origin" ] || setx origin=git_get_branch_remote "$branch"
|
[ -n "$origin" ] || setx origin=git_get_branch_remote "$branch"
|
||||||
@ -265,11 +371,11 @@ function _push_branches() {
|
|||||||
setx rbranch=git_get_branch_rbranch "$branch" "$origin"
|
setx rbranch=git_get_branch_rbranch "$branch" "$origin"
|
||||||
if [ -n "$rbranch" ]; then
|
if [ -n "$rbranch" ]; then
|
||||||
rbranch="${rbranch#refs/remotes/$origin/}"
|
rbranch="${rbranch#refs/remotes/$origin/}"
|
||||||
_script_add <<EOF
|
_rscript_add <<EOF
|
||||||
$comment$(qvals git push "$origin" "$branch:$rbranch")$or_die
|
$comment$(qvals git push "$origin" "$branch:$rbranch")$or_die
|
||||||
EOF
|
EOF
|
||||||
else
|
else
|
||||||
_script_add <<EOF
|
_rscript_add <<EOF
|
||||||
$comment$(qvals git push --set-upstream "$origin" "$branch")$or_die
|
$comment$(qvals git push --set-upstream "$origin" "$branch")$or_die
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
@ -278,12 +384,12 @@ EOF
|
|||||||
|
|
||||||
function _push_tags() {
|
function _push_tags() {
|
||||||
local origin tag
|
local origin tag
|
||||||
_script_echo "* push tags"
|
_rscript_echo "* push tags"
|
||||||
for tag in "${push_tags[@]}"; do
|
for tag in "${push_tags[@]}"; do
|
||||||
origin="$Origin"
|
origin="$Origin"
|
||||||
[ -n "$origin" ] || origin=origin
|
[ -n "$origin" ] || origin=origin
|
||||||
_script_add <<EOF
|
_rscript_add <<EOF
|
||||||
$comment$(qvals git push "$origin" tag "$tag")$or_die
|
$comment$(qvals git push --force "$origin" tag "$tag")$or_die
|
||||||
EOF
|
EOF
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -293,9 +399,14 @@ function release_develop_action() {
|
|||||||
local -a push_branches push_tags
|
local -a push_branches push_tags
|
||||||
|
|
||||||
if [ -n "$ReleaseBranch" ]; then
|
if [ -n "$ReleaseBranch" ]; then
|
||||||
|
Version="${ReleaseBranch#$RELEASE}"
|
||||||
release_release_action "$@"; return $?
|
release_release_action "$@"; return $?
|
||||||
|
elif [ -n "$HotfixBranch" ]; then
|
||||||
|
Version="${HotfixBranch#$HOTFIX}"
|
||||||
|
release_hotfix_action "$@"; return $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ -n "$Version" ] || die "Vous devez spécifier la version de la release"
|
||||||
ReleaseBranch="${RELEASE}$Version"
|
ReleaseBranch="${RELEASE}$Version"
|
||||||
if [ -n "$Merge" ]; then
|
if [ -n "$Merge" ]; then
|
||||||
enote "\
|
enote "\
|
||||||
@ -314,20 +425,45 @@ Vous devrez:
|
|||||||
fi
|
fi
|
||||||
ask_yesno "Voulez-vous continuer?" O || die
|
ask_yesno "Voulez-vous continuer?" O || die
|
||||||
|
|
||||||
local comment or_die
|
local comment=
|
||||||
_set_active 1
|
local or_die=" || exit 1"
|
||||||
|
_rscript_start
|
||||||
|
_rscript_add <<EOF
|
||||||
|
################################################################################
|
||||||
|
# create
|
||||||
|
if [ -n "\$create" ]; then
|
||||||
|
EOF
|
||||||
_create_release_branch
|
_create_release_branch
|
||||||
_set_active "$Merge"
|
_rscript_add <<EOF
|
||||||
_merge_release_branch "$DestBranch" "$Version"
|
fi
|
||||||
|
EOF
|
||||||
|
|
||||||
|
_rscript_add <<EOF
|
||||||
|
################################################################################
|
||||||
|
# merge
|
||||||
|
if [ -n "\$merge" ]; then
|
||||||
|
EOF
|
||||||
|
_merge_release_branch "$DestBranch" "$TAG_PREFIX$Version$TAG_SUFFIX"
|
||||||
_merge_release_branch "$SrcBranch"
|
_merge_release_branch "$SrcBranch"
|
||||||
_delete_release_branch
|
_delete_release_branch
|
||||||
_set_active "$Push"
|
_rscript_add <<EOF
|
||||||
|
fi
|
||||||
|
EOF
|
||||||
|
|
||||||
|
_rscript_add <<EOF
|
||||||
|
################################################################################
|
||||||
|
# push
|
||||||
|
if [ -n "\$push" ]; then
|
||||||
|
EOF
|
||||||
_push_branches
|
_push_branches
|
||||||
_push_tags
|
_push_tags
|
||||||
|
_rscript_add <<EOF
|
||||||
|
fi
|
||||||
|
EOF
|
||||||
|
|
||||||
if ! "$script"; then
|
if ! "$script" create ${Merge:+merge} ${Push:+push}; then
|
||||||
eimportant "Veuillez consulter le script $script pour le détail des opérations qui n'ont pas pu êtres effectuées"
|
eimportant "Veuillez consulter le script $script pour le détail des opérations qui n'ont pas pu êtres effectuées"
|
||||||
else
|
elif [ -z "$_KeepScript" ]; then
|
||||||
rm "$script"
|
rm "$script"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -341,36 +477,42 @@ Vous allez:
|
|||||||
}
|
}
|
||||||
|
|
||||||
function release_hotfix_action() {
|
function release_hotfix_action() {
|
||||||
release_action "$@"
|
enote "\
|
||||||
|
Vous allez intégrer la branche de hotfix ${COULEUR_JAUNE}$HotfixBranch${COULEUR_NORMALE}
|
||||||
|
dans la branche destination ${COULEUR_ROUGE}$DestBranch${COULEUR_NORMALE}"
|
||||||
|
ask_yesno "Voulez-vous continuer?" O || die
|
||||||
}
|
}
|
||||||
|
|
||||||
function release_main_action() {
|
################################################################################
|
||||||
merge_action "$@"
|
# Programme principal
|
||||||
}
|
################################################################################
|
||||||
|
|
||||||
function release_dist_action() {
|
|
||||||
merge_action "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
chdir=
|
chdir=
|
||||||
Config=
|
|
||||||
Origin=
|
Origin=
|
||||||
|
ConfigBranch=
|
||||||
|
ConfigFile=
|
||||||
Action=release
|
Action=release
|
||||||
Merge=1
|
Merge=1
|
||||||
Push=1
|
Push=1
|
||||||
Version=
|
Version=
|
||||||
|
_KeepScript=
|
||||||
args=(
|
args=(
|
||||||
"faire une nouvelle release à partir de la branche source"
|
"faire une nouvelle release à partir de la branche source"
|
||||||
" -gv VERSION [source]"
|
" -gv VERSION [source]"
|
||||||
-d:,--chdir:BASEDIR chdir= "répertoire dans lequel se placer avant de lancer les opérations"
|
-d:,--chdir:BASEDIR chdir= "répertoire dans lequel se placer avant de lancer les opérations"
|
||||||
-c:,--config:CONFIG Config= "++\
|
|
||||||
fichier de configuration des branches.
|
|
||||||
par défaut, utiliser le fichier .pman.conf dans le répertoire du dépôt s'il existe"
|
|
||||||
-o:,--origin Origin= "++\
|
-o:,--origin Origin= "++\
|
||||||
origine à partir de laquelle les branches distantes sont considérées"
|
origine à partir de laquelle les branches distantes sont considérées"
|
||||||
|
-b:,--config-branch ConfigBranch= "++\
|
||||||
|
branche à partir de laquelle charger la configuration"
|
||||||
|
-c:,--config-file:CONFIG ConfigFile= "++\
|
||||||
|
fichier de configuration des branches. cette option est prioritaire sur --config-branch
|
||||||
|
par défaut, utiliser le fichier .pman.conf dans le répertoire du dépôt s'il existe"
|
||||||
|
--keep-script _KeepScript=1 "++option non documentée"
|
||||||
--init Action=init "++\
|
--init Action=init "++\
|
||||||
initialiser les branches $DEVELOP et $MAIN
|
initialiser les branches $DEVELOP et $MAIN
|
||||||
le nom des branches peut différer si un fichier de configuration est fourni"
|
le nom des branches peut différer si un fichier de configuration est fourni"
|
||||||
|
--dump-config Action=dump "++\
|
||||||
|
afficher la configuration chargée"
|
||||||
-s,--show Action=show "\
|
-s,--show Action=show "\
|
||||||
lister les modifications qui seraient intégrées dans la release"
|
lister les modifications qui seraient intégrées dans la release"
|
||||||
--release Action=release "créer la release. c'est l'action par défaut"
|
--release Action=release "créer la release. c'est l'action par défaut"
|
||||||
@ -400,6 +542,7 @@ setx gitdir=git_get_toplevel
|
|||||||
cd "$gitdir" || die
|
cd "$gitdir" || die
|
||||||
|
|
||||||
# charger la configuration
|
# charger la configuration
|
||||||
|
load_branches
|
||||||
load_config "$1"
|
load_config "$1"
|
||||||
if [ -n "$Merge" -a -n "$NOAUTO" ]; then
|
if [ -n "$Merge" -a -n "$NOAUTO" ]; then
|
||||||
ewarn "L'option --no-merge a été forcée puisque ce dépôt ne supporte pas les releases automatiques"
|
ewarn "L'option --no-merge a été forcée puisque ce dépôt ne supporte pas les releases automatiques"
|
||||||
@ -409,9 +552,8 @@ fi
|
|||||||
|
|
||||||
# puis faire l'action que l'on nous demande
|
# puis faire l'action que l'on nous demande
|
||||||
case "$Action" in
|
case "$Action" in
|
||||||
init)
|
init) init_action "$@";;
|
||||||
init_action "$@"
|
dump) dump_action "$@";;
|
||||||
;;
|
|
||||||
show)
|
show)
|
||||||
git_check_cleancheckout || ewarn "$git_cleancheckout_DIRTY"
|
git_check_cleancheckout || ewarn "$git_cleancheckout_DIRTY"
|
||||||
ensure_branches
|
ensure_branches
|
||||||
@ -420,10 +562,6 @@ show)
|
|||||||
release)
|
release)
|
||||||
git_ensure_cleancheckout
|
git_ensure_cleancheckout
|
||||||
ensure_branches
|
ensure_branches
|
||||||
[ -n "$Version" ] || die "Vous devez spécifier la version de la release"
|
|
||||||
|
|
||||||
# Ici, les variables suivantes sont disponibles: CurrentBranch, Branches,
|
|
||||||
# SrcBranch, SrcType, DestBranch, ReleaseBranch
|
|
||||||
"release_${SrcType}_action" "$@"
|
"release_${SrcType}_action" "$@"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user