Skip to content

Commit f4be855

Browse files
committed
Add DRY_RUN mode and update the release script
Update the changes plugin version
1 parent c854144 commit f4be855

File tree

4 files changed

+62
-41
lines changed

4 files changed

+62
-41
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,21 @@ mvn clean install \
604604
-Dtests.cluster.pass=GENERATEDPASSWORD
605605
```
606606

607+
Release guide
608+
=============
609+
610+
To release the project, you simply need to run:
611+
612+
```sh
613+
./release.sh
614+
```
615+
616+
If you want to just test the release without deploying anything, run:
617+
618+
```sh
619+
DRY_RUN=1 ./release.sh
620+
```
621+
607622
Why this name?
608623
==============
609624

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<name>Elasticsearch Beyonder</name>
1010
<url>https://github.com/dadoonet/elasticsearch-beyonder</url>
1111
<description>
12-
Elasticsearch beyonder provides automatic index, mapping, alias, template creation and
13-
index lifecycle policies when an elasticsearch client starts.
12+
Elasticsearch beyonder provides automatic index, mapping, alias, template creation and
13+
index lifecycle policies when an elasticsearch client starts.
1414
</description>
1515

1616
<licenses>
@@ -198,7 +198,7 @@
198198
<plugin>
199199
<groupId>org.apache.maven.plugins</groupId>
200200
<artifactId>maven-changes-plugin</artifactId>
201-
<version>2.12.1</version>
201+
<version>3.0.0-M2</version>
202202
<configuration>
203203
<sslMode>true</sslMode>
204204
<fromDeveloperId>dadoonet</fromDeveloperId>

release.sh

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ promptyn () {
5858
}
5959

6060
run_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
7676
PROJECT_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
8188
cd "$PROJECT_HOME"
@@ -191,28 +198,15 @@ git commit -q -a -m "prepare for next development iteration"
191198
# git checkout branch we started from
192199
git 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
211202
if [ ${RELEASE} -eq 1 ]
212203
then
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
256232
else
257233
if promptyn "Do you want to remove $RELEASE_BRANCH branch and beyonder-${RELEASE_VERSION} tag?"

src/main/documentation/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,21 @@ mvn clean install \
604604
-Dtests.cluster.pass=GENERATEDPASSWORD
605605
```
606606

607+
Release guide
608+
=============
609+
610+
To release the project, you simply need to run:
611+
612+
```sh
613+
./release.sh
614+
```
615+
616+
If you want to just test the release without deploying anything, run:
617+
618+
```sh
619+
DRY_RUN=1 ./release.sh
620+
```
621+
607622
Why this name?
608623
==============
609624

@@ -613,6 +628,21 @@ powerful character.
613628

614629
This project gives some features beyond elasticsearch itself. :)
615630

631+
Release guide
632+
=============
633+
634+
To release the project, you simply need to run:
635+
636+
```sh
637+
./release.sh
638+
```
639+
640+
If you want to just test the release without deploying anything, run:
641+
642+
```sh
643+
DRY_RUN=1 ./release.sh
644+
```
645+
616646
License
617647
=======
618648

0 commit comments

Comments
 (0)