|
17 | 17 |
|
18 | 18 | prefix=camel-kafka-connector-
|
19 | 19 |
|
20 |
| -read -p "Enter release version: " releaseV |
| 20 | +read -r -p "Enter release version: " releaseV |
21 | 21 | export RELEASE_VERSION=$releaseV
|
22 | 22 | releaseVbranch="${releaseV%.*}.x"
|
23 | 23 |
|
24 |
| -read -p "Enter next version: " nextV |
| 24 | +read -r -p "Enter next version: " nextV |
25 | 25 | export NEXT_VERSION=$nextV
|
26 | 26 |
|
27 | 27 | defaultReleaseBranch=$prefix$releaseVbranch
|
28 |
| -read -p "Enter release branch [$defaultReleaseBranch]: " releaseBranch |
| 28 | +read -r -p "Enter release branch [$defaultReleaseBranch]: " releaseBranch |
29 | 29 | export RELEASE_BRANCH=${releaseBranch:-$defaultReleaseBranch}
|
30 | 30 |
|
31 | 31 | defaultReleaseTag=$prefix$releaseV
|
32 |
| -read -p "Enter release tag: [$defaultReleaseTag]" releaseTag |
| 32 | +read -r -p "Enter release tag: [$defaultReleaseTag]" releaseTag |
33 | 33 | export RELEASE_TAG=${releaseTag:-$defaultReleaseTag}
|
34 | 34 |
|
35 |
| -read -p "Enter apache username: " user |
| 35 | +read -r -p "Enter apache username: " user |
36 | 36 | export APACHE_USER=$user
|
37 | 37 |
|
38 |
| -read -p "Enter apache password: " pass |
| 38 | +read -r -s -p "Enter apache password: " pass |
39 | 39 | export APACHE_PASS=$pass
|
| 40 | +echo "" |
40 | 41 |
|
41 |
| -git checkout -b $RELEASE_BRANCH && \ |
42 |
| -./mvnw -Prelease -Pgpg -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$NEXT_VERSION -Dtag=$RELEASE_TAG -Dusername=$APACHE_USER -Dpassword=$APACHE_PASS release:prepare && \ |
43 |
| -git checkout $RELEASE_TAG && git add *.json && git commit -m"[after release perform chore]: regen catalog descriptors with new version" && git tag -f $RELEASE_TAG && git push -f upstream $RELEASE_TAG && git checkout $RELEASE_BRANCH && \ |
44 |
| -./mvnw -Prelease -Pgpg -Dusername=$APACHE_USER -Dpassword=$APACHE_PASS release:perform |
| 42 | +defaultGpgProfile=gpg |
| 43 | +read -r -p "Enter the maven gpg profile: [$defaultGpgProfile]" gpgProfile |
| 44 | +export GPG_PROFILE=${gpgProfile:-$defaultGpgProfile} |
| 45 | + |
| 46 | +defaultCheckoutReleaseBranch=Y |
| 47 | +while true; do |
| 48 | + read -r -p "Do you want to automatically checkout -b into $RELEASE_BRANCH branch?: [Y/n]" checkoutReleaseBranch |
| 49 | + checkoutReleaseBranch=${checkoutReleaseBranch:-$defaultCheckoutReleaseBranch} |
| 50 | + case $checkoutReleaseBranch in |
| 51 | + [Yy]* ) |
| 52 | + export CHECKOUT_RELEASE_TAG=Y |
| 53 | + break |
| 54 | + ;; |
| 55 | + [Nn]* ) |
| 56 | + export CHECKOUT_RELEASE_TAG=N |
| 57 | + break |
| 58 | + ;; |
| 59 | + * ) |
| 60 | + echo "Invalid input. Please enter y or n" |
| 61 | + ;; |
| 62 | + esac |
| 63 | +done |
| 64 | + |
| 65 | +if [ "$CHECKOUT_RELEASE_TAG" == Y ]; then |
| 66 | + git checkout -b "$RELEASE_BRANCH" |
| 67 | +fi |
| 68 | +./mvnw -Prelease -P"$GPG_PROFILE" -DreleaseVersion="$RELEASE_VERSION" -DdevelopmentVersion="$NEXT_VERSION" -Dtag="$RELEASE_TAG" -Dusername="$APACHE_USER" -Dpassword="$APACHE_PASS" release:prepare && \ |
| 69 | +git checkout "$RELEASE_TAG" && git add ./*.json && git commit -m"[after release perform chore]: regen catalog descriptors with new version" && git tag -f "$RELEASE_TAG" && git push -f upstream "$RELEASE_TAG" && git checkout "$RELEASE_BRANCH" && \ |
| 70 | +./mvnw -Prelease -Pgpg -Dusername="$APACHE_USER" -Dpassword="$APACHE_PASS" release:perform |
0 commit comments