script post release/merge
This commit is contained in:
		
							parent
							
								
									d3c2299c13
								
							
						
					
					
						commit
						2163ea992e
					
				| @ -45,7 +45,7 @@ $0 !~ /<pman>/ { print } | |||||||
| function _filter_changes() { | function _filter_changes() { | ||||||
|     # enlever les commits "inutiles" pour générer le fichier CHANGES.md |     # enlever les commits "inutiles" pour générer le fichier CHANGES.md | ||||||
|     grep -vE '^([+|] )?[0-9a-f]+ modifs\.mineures sans commentaires$' | |     grep -vE '^([+|] )?[0-9a-f]+ modifs\.mineures sans commentaires$' | | ||||||
|     grep -vE '^([+|] )?[0-9a-f]+ (cosmetic|typo|bug|fix|maj projet|maj deps)\$' |     grep -vE '^([+|] )?[0-9a-f]+ (cosmetic|typo|bug|fix|maj projet|maj deps)$' | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function _format_md() { | function _format_md() { | ||||||
| @ -167,7 +167,17 @@ function load_branches() { | |||||||
|         "$HOTFIX"*) SrcType=hotfix; DestBranch="$MAIN";; |         "$HOTFIX"*) SrcType=hotfix; DestBranch="$MAIN";; | ||||||
|         "$MAIN") SrcType=main; DestBranch="$DIST";; |         "$MAIN") SrcType=main; DestBranch="$DIST";; | ||||||
|         "$DIST") SrcType=dist; DestBranch=;; |         "$DIST") SrcType=dist; DestBranch=;; | ||||||
|         *) DestBranch=;; |         *) SrcType=; DestBranch=;; | ||||||
|  |         esac | ||||||
|  |         case "$DestBranch" in | ||||||
|  |         "$UPSTREAM") DestType=upstream;; | ||||||
|  |         "$FEATURE"*) DestType=feature;; | ||||||
|  |         "$DEVELOP") DestType=develop;; | ||||||
|  |         "$RELEASE"*) DestType=release;; | ||||||
|  |         "$HOTFIX"*) DestType=hotfix;; | ||||||
|  |         "$MAIN") DestType=main;; | ||||||
|  |         "$DIST") DestType=dist;; | ||||||
|  |         *) DestType=;; | ||||||
|         esac |         esac | ||||||
| 
 | 
 | ||||||
|         local branch |         local branch | ||||||
| @ -275,6 +285,11 @@ function _mscript_start() { | |||||||
| #!/bin/bash | #!/bin/bash | ||||||
| $(qvals source "$NULIBDIR/load.sh") || exit 1 | $(qvals source "$NULIBDIR/load.sh") || exit 1 | ||||||
| 
 | 
 | ||||||
|  | $(echo_setv SrcBranch="$SrcBranch") | ||||||
|  | $(echo_setv SrcType="$SrcType") | ||||||
|  | $(echo_setv DestBranch="$DestBranch") | ||||||
|  | $(echo_setv DestType="$DestType") | ||||||
|  | 
 | ||||||
| merge= | merge= | ||||||
| delete= | delete= | ||||||
| push= | push= | ||||||
| @ -330,6 +345,14 @@ function _rscript_start() { | |||||||
| #!/bin/bash | #!/bin/bash | ||||||
| $(qvals source "$NULIBDIR/load.sh") || exit 1 | $(qvals source "$NULIBDIR/load.sh") || exit 1 | ||||||
| 
 | 
 | ||||||
|  | $(echo_setv SrcBranch="$SrcBranch") | ||||||
|  | $(echo_setv SrcType="$SrcType") | ||||||
|  | $(echo_setv Version="$Version") | ||||||
|  | $(echo_setv Tag="$Tag") | ||||||
|  | $(echo_setv ReleaseBranch="$ReleaseBranch") | ||||||
|  | $(echo_setv DestBranch="$DestBranch") | ||||||
|  | $(echo_setv DestType="$DestType") | ||||||
|  | 
 | ||||||
| create= | create= | ||||||
| merge= | merge= | ||||||
| push= | push= | ||||||
| @ -382,7 +405,7 @@ EOF | |||||||
| 
 | 
 | ||||||
|     # Enregistrer les changements |     # Enregistrer les changements | ||||||
|     _scripta "commit" <<EOF |     _scripta "commit" <<EOF | ||||||
| $(qvals git commit -m "<pman>Init changelog & version $Version") | $(qvals git commit -m "<pman>Init changelog & version $Tag") | ||||||
| EOF | EOF | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										18
									
								
								bin/pdev
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								bin/pdev
									
									
									
									
									
								
							| @ -31,8 +31,9 @@ Ce script va | |||||||
| - pousser les branches modifiées}" | - pousser les branches modifiées}" | ||||||
|     ask_yesno "Voulez-vous continuer?" O || die |     ask_yesno "Voulez-vous continuer?" O || die | ||||||
| 
 | 
 | ||||||
|     local script=".git/rel-merge.sh" |     local script=".git/pman-merge.sh" | ||||||
|     local -a push_branches delete_branches |     local -a push_branches delete_branches | ||||||
|  |     local after | ||||||
|     local comment= |     local comment= | ||||||
|     local or_die=" || exit 1" |     local or_die=" || exit 1" | ||||||
| 
 | 
 | ||||||
| @ -44,6 +45,11 @@ if [ -n "\$merge" ]; then | |||||||
| esection "Fusionner la branche" | esection "Fusionner la branche" | ||||||
| EOF | EOF | ||||||
|     _mscript_merge_branch |     _mscript_merge_branch | ||||||
|  |     after="AFTER_MERGE_${SrcType^^}"; [ -n "${!after}" ] && _scripta <<EOF | ||||||
|  | ( | ||||||
|  | ${!after} | ||||||
|  | )$or_die | ||||||
|  | EOF | ||||||
|     _scripta <<EOF |     _scripta <<EOF | ||||||
| fi | fi | ||||||
| EOF | EOF | ||||||
| @ -55,6 +61,11 @@ if [ -n "\$delete" ]; then | |||||||
| esection "Supprimer la branche" | esection "Supprimer la branche" | ||||||
| EOF | EOF | ||||||
|     _mscript_delete_branch |     _mscript_delete_branch | ||||||
|  |     after="AFTER_DELETE_${SrcType^^}"; [ -n "${!after}" ] && _scripta <<EOF | ||||||
|  | ( | ||||||
|  | ${!after} | ||||||
|  | )$or_die | ||||||
|  | EOF | ||||||
|     _scripta <<EOF |     _scripta <<EOF | ||||||
| fi | fi | ||||||
| EOF | EOF | ||||||
| @ -72,6 +83,11 @@ EOF | |||||||
|         _script_push_branches |         _script_push_branches | ||||||
|         _scripta <<<fi |         _scripta <<<fi | ||||||
|     fi |     fi | ||||||
|  |     after="AFTER_PUSH_${DestType^^}"; [ -n "${!after}" ] && _scripta <<EOF | ||||||
|  | ( | ||||||
|  | ${!after} | ||||||
|  | )$or_die | ||||||
|  | EOF | ||||||
|     _scripta <<EOF |     _scripta <<EOF | ||||||
| fi | fi | ||||||
| EOF | EOF | ||||||
|  | |||||||
							
								
								
									
										19
									
								
								bin/prel
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								bin/prel
									
									
									
									
									
								
							| @ -34,9 +34,11 @@ function ensure_branches() { | |||||||
| function create_release_action() { | function create_release_action() { | ||||||
|     if [ -n "$ReleaseBranch" ]; then |     if [ -n "$ReleaseBranch" ]; then | ||||||
|         Version="${ReleaseBranch#$RELEASE}" |         Version="${ReleaseBranch#$RELEASE}" | ||||||
|  |         Tag="$TAG_PREFIX$Version$TAG_SUFFIX" | ||||||
|         merge_release_action "$@"; return $? |         merge_release_action "$@"; return $? | ||||||
|     elif [ -n "$HotfixBranch" ]; then |     elif [ -n "$HotfixBranch" ]; then | ||||||
|         Version="${HotfixBranch#$HOTFIX}" |         Version="${HotfixBranch#$HOTFIX}" | ||||||
|  |         Tag="$TAG_PREFIX$Version$TAG_SUFFIX" | ||||||
|         merge_hotfix_action "$@"; return $? |         merge_hotfix_action "$@"; return $? | ||||||
|     fi |     fi | ||||||
| 
 | 
 | ||||||
| @ -67,7 +69,7 @@ Vous devrez: | |||||||
|     fi |     fi | ||||||
|     ask_yesno "Voulez-vous continuer?" O || die |     ask_yesno "Voulez-vous continuer?" O || die | ||||||
| 
 | 
 | ||||||
|     local script=".git/rel-release.sh" |     local script=".git/pman-release.sh" | ||||||
|     local -a push_branches push_tags |     local -a push_branches push_tags | ||||||
|     local comment= |     local comment= | ||||||
|     local or_die=" || exit 1" |     local or_die=" || exit 1" | ||||||
| @ -80,6 +82,11 @@ if [ -n "\$create" ]; then | |||||||
| esection "Création de la release" | esection "Création de la release" | ||||||
| EOF | EOF | ||||||
|     _rscript_create_release_branch |     _rscript_create_release_branch | ||||||
|  |     [ -n "$AFTER_CREATE_RELEASE" ] && _scripta <<EOF | ||||||
|  | ( | ||||||
|  | $AFTER_CREATE_RELEASE | ||||||
|  | )$or_die | ||||||
|  | EOF | ||||||
|     _scripta <<EOF |     _scripta <<EOF | ||||||
| fi | fi | ||||||
| EOF | EOF | ||||||
| @ -93,6 +100,11 @@ EOF | |||||||
|     _rscript_merge_release_branch "$DestBranch" "$Tag" |     _rscript_merge_release_branch "$DestBranch" "$Tag" | ||||||
|     _rscript_merge_release_branch "$SrcBranch" |     _rscript_merge_release_branch "$SrcBranch" | ||||||
|     _rscript_delete_release_branch |     _rscript_delete_release_branch | ||||||
|  |     [ -n "$AFTER_MERGE_RELEASE" ] && _scripta <<EOF | ||||||
|  | ( | ||||||
|  | $AFTER_MERGE_RELEASE | ||||||
|  | )$or_die | ||||||
|  | EOF | ||||||
|     _scripta <<EOF |     _scripta <<EOF | ||||||
| fi | fi | ||||||
| EOF | EOF | ||||||
| @ -105,6 +117,11 @@ esection "Pousser branches et tags" | |||||||
| EOF | EOF | ||||||
|     _script_push_branches |     _script_push_branches | ||||||
|     _script_push_tags |     _script_push_tags | ||||||
|  |     [ -n "$AFTER_PUSH_RELEASE" ] && _scripta <<EOF | ||||||
|  | ( | ||||||
|  | $AFTER_PUSH_RELEASE | ||||||
|  | )$or_die | ||||||
|  | EOF | ||||||
|     _scripta <<EOF |     _scripta <<EOF | ||||||
| fi | fi | ||||||
| EOF | EOF | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user