-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·33 lines (23 loc) · 958 Bytes
/
release.sh
File metadata and controls
executable file
·33 lines (23 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
git remote rm github
# Find last git tag and create commit log
LAST_TAG=`git describe --tags --abbrev=0`
RELEASE_COMMIT_LOG=`git log $LAST_TAG..HEAD --oneline`
# Save commit log to property file as a property
# (replacing newlines with "\n")
echo RELEASE_COMMIT_LOG="${RELEASE_COMMIT_LOG//$'\n'/\\n}" > $PROPERTIES_FILE
# Bump version
./newversion $RELEASE_VERSION
# Remove package lock (temporary)
rm -f package-lock.json
git add .
# Commit release version
git commit -a -m "Release: $RELEASE_VERSION"
# Create and push tag
git tag $RELEASE_VERSION -m "Release: $RELEASE_VERSION"
# Setting username and password for HTTPS to BitBucket
encoded_username=$(echo ${GIT_USERNAME} | jq -Rr @uri)
encoded_password=$(echo ${GIT_PASSWORD} | jq -Rr @uri)
git remote set-url origin https://${encoded_username}:${encoded_password}@git.ib-ci.com/scm/mml/infobip-mobile-messaging-react-native-plugin.git
# Push changes
git push origin master --tags