@@ -58,7 +58,7 @@ promptyn () {
5858}
5959
6060run_integration_tests () {
61- echo " Building the release..."
61+ echo " Building the release... If asked, please enter your GPG passphrase. "
6262 mvn clean install -DskipTests -Prelease ${MAVEN_OPTION} >> /tmp/beyonder-${RELEASE_VERSION} .log
6363
6464 if [ $? -ne 0 ]
@@ -75,7 +75,14 @@ PROJECT_HOME=`dirname "$SCRIPT"`
7575# make PROJECT_HOME absolute
7676PROJECT_HOME=` cd " $PROJECT_HOME " ; pwd`
7777
78- DRY_RUN=0
78+ # Dry run mode (default is 0). This can be set externally by running the script with the CLI option DRY_RUN:
79+ # DRY_RUN=1 ./release.sh
80+ if [ -z " $DRY_RUN " ]; then
81+ DRY_RUN=0
82+ else
83+ DRY_RUN=1
84+ echo " Running in dry run mode"
85+ fi
7986
8087# Enter project dir
8188cd " $PROJECT_HOME "
@@ -191,28 +198,15 @@ git commit -q -a -m "prepare for next development iteration"
191198# git checkout branch we started from
192199git checkout -q ${CURRENT_BRANCH}
193200
194- if [ ${DRY_RUN} -eq 0 ]
195- then
196- echo " Inspect Sonatype staging repositories"
197- open https://s01.oss.sonatype.org/# stagingRepositories
198-
199- if promptyn " Is the staging repository ok?"
200- then
201- echo " releasing the nexus repository"
202- mvn nexus-staging:release >> /tmp/beyonder-${RELEASE_VERSION} .log
203- else
204- echo " dropping the nexus repository"
205- RELEASE=0
206- mvn nexus-staging:drop >> /tmp/beyonder-${RELEASE_VERSION} .log
207- fi
208- fi
209-
210201# We are releasing, so let's merge into the original branch
211202if [ ${RELEASE} -eq 1 ]
212203then
213204 echo " Merging changes into ${CURRENT_BRANCH} "
214- git merge -q ${RELEASE_BRANCH}
215- git branch -q -d ${RELEASE_BRANCH}
205+ if [ ${DRY_RUN} -eq 0 ]
206+ then
207+ git merge -q ${RELEASE_BRANCH}
208+ git branch -q -d ${RELEASE_BRANCH}
209+ fi
216210 echo " Push changes to origin"
217211 if [ ${DRY_RUN} -eq 0 ]
218212 then
@@ -234,24 +228,6 @@ then
234228 echo " Message not sent. You can send it manually using:"
235229 echo " mvn changes:announcement-mail -Dchanges.username=EMAIL_FROM -Dchanges.password=EMAIL_PASSWORD"
236230 fi
237- else
238- if promptyn " Do you want to announce the release?"
239- then
240- # We need to checkout the tag, announce and checkout the branch we started from
241- git checkout -q beyonder-${RELEASE_VERSION}
242- SMTP_USERNAME=
$( readvalue " Enter your SMTP username" " [email protected] " ) 243- SMTP_PASSWORD=$( readvalue " Enter your SMTP password" " " )
244- mvn changes:announcement-mail -Dchanges.username=${SMTP_USERNAME} -Dchanges.password=${SMTP_PASSWORD} -Dchanges.toAddresses=${SMTP_USERNAME} >> /tmp/beyonder-${RELEASE_VERSION} .log
245- if [ $? -ne 0 ]
246- then
247- tail -20 /tmp/beyonder-${RELEASE_VERSION} .log
248- echo " We have not been able to send the email. Full log available at /tmp/beyonder-$RELEASE_VERSION .log"
249- fi
250- git checkout -q ${CURRENT_BRANCH}
251- else
252- echo " Message not sent. You can send it manually using:"
253- echo " mvn changes:announcement-mail -Dchanges.username=${SMTP_USERNAME} -Dchanges.password=${SMTP_PASSWORD} -Dchanges.toAddresses=${SMTP_USERNAME} "
254- fi
255231 fi
256232else
257233 if promptyn " Do you want to remove $RELEASE_BRANCH branch and beyonder-${RELEASE_VERSION} tag?"
0 commit comments