-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
40 lines (32 loc) · 1.02 KB
/
release.sh
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
34
35
36
37
38
39
40
release_tag=$1
repository_name=$2
file_name=RELEASE_NOTES.md
git clone "git@bitbucket.org:agusticonesa/$repository_name.git"
cd test_releases
git checkout -b develop
git pull origin develop
git checkout -b release/$release_tag
input="result.txt"
git log --oneline $(git describe --tags --abbrev=0 @^)..@ --pretty=format:"%s" >> $input
sed -i -e '$a\' $input
sed -i "1s/^/ \n/" $file_name
while read line;
do
sed -i "1s/^/ \n/" $file_name
sed -i "1s/^/ * $line/" $file_name
done < $input; echo $line
sed -i "1s/^/Release $release_tag - Date: $(date '+%Y-%m-%d') \n/" $file_name
rm result.txt
git add -A
git commit -m "feat: release $release_tag"
git tag $release_tag
git push --set-upstream --atomic origin release/$release_tag $release_tag
git checkout master
git pull origin master
git pull origin release/$release_tag
git push --set-upstream --atomic origin master release/$release_tag
git checkout develop
git pull origin master
git push --set-upstream --atomic origin develop release/$release_tag
cd ..
rm -rf $repository_name