@@ -33,6 +33,7 @@ do_ci=0
3333do_sign=1
3434do_pull=0
3535do_daily=0
36+ do_revision=0
3637
3738while [ $# -gt 0 ] ; do
3839 case " $1 " in
@@ -45,6 +46,9 @@ while [ $# -gt 0 ] ; do
4546 --test)
4647 do_test=1
4748 ;;
49+ --revision-info)
50+ do_revision=1
51+ ;;
4852 --daily)
4953 do_sign=0
5054 do_pull=1
@@ -59,18 +63,36 @@ while [ $# -gt 0 ] ; do
5963 branch=" ci"
6064 fi
6165 ;;
66+ --no-sign)
67+ do_sign=0
68+ ;;
69+ --kits)
70+ KITS=" $2 "
71+ # Skip one position, the value
72+ shift
73+ ;;
74+ --compressions)
75+ COMPRESSIONS=" $2 "
76+ # Skip one position, the value
77+ shift
78+ ;;
6279 --help)
6380 echo " Usages:"
64- echo " create-release.sh <version> <from_branch> [--tag] [--stable] [--test] [--ci]"
81+ echo " create-release.sh <version> <from_branch> [--tag] [--stable] [--test] [--ci] [--daily] [--revision-info] [--compressions] [--kits] [--no-sign] "
6582 echo " "
6683 echo " If --tag is specified, release tag is automatically created (use this for all releases including pre-releases)"
6784 echo " If --stable is specified, the STABLE branch is updated with this release"
6885 echo " If --test is specified, the testsuite is executed before creating the release"
6986 echo " If --ci is specified, the testsuite is executed and no actual release is created"
87+ echo " If --no-sign is specified, the ouput files will not be signed"
88+ echo " If --daily is specified, the ouput files will have snapshot information"
89+ echo " If --revision-info is specified, the output files will contain git revision info"
90+ echo " If --compressions is specified, it changes the compressions available. Space separated values. Valid values: $COMPRESSIONS "
91+ echo " If --kits is specified, it changes the kits to be built. Space separated values. Valid values: $KITS "
7092 echo " "
7193 echo " Examples:"
72- echo " create-release.sh 2.9.0-rc1 QA_2_9 "
73- echo " create-release.sh 2.9.0 MAINT_2_9_0 --tag --stable"
94+ echo " create-release.sh 5.2.2-dev QA_5_2 "
95+ echo " create-release.sh 5.2.2 QA_5_2 --tag --stable"
7496 exit 65
7597 ;;
7698 * )
@@ -89,19 +111,20 @@ while [ $# -gt 0 ] ; do
89111 fi
90112 else
91113 echo " Unknown parameter: $1 !"
114+ echo " Use --help to check the syntax."
92115 exit 1
93116 fi
94117 esac
95118 shift
96119done
97120
98- if [ -z " $branch " ]; then
99- echo " Branch must be specified!"
121+ if [ -z " $version " ] && [ $do_ci -eq 0 ]; then
122+ echo " Version must be specified!"
100123 exit 1
101124fi
102125
103- if [ -z " $version " ] && [ $do_ci -eq 0 ]; then
104- echo " Version must be specified!"
126+ if [ -z " $branch " ]; then
127+ echo " Branch must be specified!"
105128 exit 1
106129fi
107130
@@ -504,6 +527,9 @@ if [ -f ./bin/console ]; then
504527 composer install --no-interaction
505528 # Warm up the routing cache for 5.1+ releases
506529 ./bin/console cache:warmup --routing
530+ if [ $do_revision -eq 1 ] ; then
531+ ./bin/console write-revision-info
532+ fi
507533fi
508534
509535echo " * Writing the version to composer.json (version: $version )"
@@ -597,6 +623,8 @@ security_checkup
597623
598624cd ..
599625
626+ SIGN_FILES=" "
627+
600628# Prepare all kits
601629for kit in $KITS ; do
602630 echo " * Building kit: $kit "
@@ -653,15 +681,18 @@ for kit in $KITS ; do
653681 if [ " $comp " = txz ] ; then
654682 echo " * Creating $name .tar.xz"
655683 xz -9k " $name " .tar
684+ SIGN_FILES=" $SIGN_FILES $name .tar.xz"
656685 fi
657686 if [ " $comp " = tgz ] ; then
658687 echo " * Creating $name .tar.gz"
659688 gzip -9c " $name " .tar > " $name " .tar.gz
689+ SIGN_FILES=" $SIGN_FILES $name .tar.gz"
660690 fi
661691 ;;
662692 zip-7z)
663693 echo " * Creating $name .zip"
664694 7za a -bd -tzip " $name " .zip " $name " > /dev/null
695+ SIGN_FILES=" $SIGN_FILES $name .zip"
665696 ;;
666697 * )
667698 echo " WARNING: ignoring compression '$comp ', not known!"
@@ -681,8 +712,13 @@ rm -r "$workdir_name"
681712git worktree prune
682713
683714# Signing of files with default GPG key
684- echo " * Signing files"
685- for file in " $kit_prefix " -* .gz " $kit_prefix " -* .zip " $kit_prefix " -* .xz ; do
715+ if [ $do_sign -eq 1 ] ; then
716+ echo " * Signing and making .sha{1,256} files"
717+ else
718+ echo " * Making .sha{1,256} files"
719+ fi
720+
721+ for file in $SIGN_FILES ; do
686722 if [ $do_sign -eq 1 ] ; then
687723 gpg --detach-sign --armor " $file "
688724 fi
@@ -707,7 +743,7 @@ echo ""
707743echo " Files:"
708744echo " ------"
709745
710- ls -la -- * .gz * .zip * .xz
746+ ls -la $SIGN_FILES
711747
712748cd ..
713749
0 commit comments