Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-ora2
Commits
a33aa848
Commit
a33aa848
authored
Apr 15, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a bash script for cutting a release branch
parent
45b51c2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
scripts/release.sh
+55
-0
No files found.
scripts/release.sh
0 → 100755
View file @
a33aa848
#!/usr/bin/env bash
# Use YYYY-MM-DD format
DATE
=
`
date +%Y-%m-%d
`
read
-p
"Cut the release branch? (You may lose changes that are not committed or stashed.) [y/n] "
RESP
if
[
"
$RESP
"
!=
"y"
]
;
then
exit
0
fi
echo
"Updating origin/master..."
git fetch
&&
git checkout
-q
origin/master
echo
"Creating the release branch..."
BRANCH
=
"rc/
$DATE
"
git branch |
grep
-q
"
$BRANCH
$"
if
[
$?
-eq
0
]
;
then
read
-p
"Branch
$BRANCH
already exists. Delete it? [y/n] "
RESP
if
[
"
$RESP
"
=
"y"
]
;
then
echo
"Deleting
$BRANCH
"
git branch
-D
$BRANCH
else
exit
0
fi
fi
git checkout
-b
$BRANCH
echo
" == Created branch
$BRANCH
"
echo
"Tagging the release branch..."
TAG
=
"release-
$DATE
"
git tag |
grep
-q
"
$TAG
"
if
[
$?
-eq
0
]
;
then
read
-p
"Tag
$TAG
already exists. Delete it? [y/n] "
RESP
if
[
"
$RESP
"
=
"y"
]
;
then
echo
"Deleting
$TAG
"
git tag
-d
$TAG
else
exit
0
fi
fi
git tag
-m
"release for
$DATE
"
"
$TAG
"
echo
" == Created tag
$TAG
"
read
-p
"Push branch
$BRANCH
and tag
$TAG
to origin? [y/n] "
RESP
if
[
"
$RESP
"
=
"y"
]
;
then
git push origin
$BRANCH
&&
git push origin
$TAG
echo
" == Pushed branch
$BRANCH
and tag
$TAG
to origin"
fi
echo
" == Finished =="
echo
"Branch:
$BRANCH
"
echo
"Tag:
$TAG
"
echo
"Commit:
`
git rev-parse HEAD
`
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment