Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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-platform
Commits
565b6759
Commit
565b6759
authored
Oct 07, 2015
by
Bill DeRusha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add automatic release branch cutting to release script
parent
0d2dc431
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
scripts/release.py
+35
-0
No files found.
scripts/release.py
View file @
565b6759
...
...
@@ -17,6 +17,7 @@ try:
from
path
import
Path
as
path
from
git
import
Repo
,
Commit
from
git.refs.symbolic
import
SymbolicReference
from
git.exc
import
GitCommandError
from
dateutil.parser
import
parse
as
parse_datestring
import
requests
import
yaml
...
...
@@ -99,6 +100,9 @@ def make_parser():
parser
.
add_argument
(
'--table'
,
'-t'
,
action
=
"store_true"
,
default
=
False
,
help
=
"only print table"
)
parser
.
add_argument
(
'--cut-branch'
,
'-b'
,
action
=
"store_true"
,
default
=
False
,
help
=
"automatically cut the release branch"
)
return
parser
...
...
@@ -522,6 +526,26 @@ def generate_email(start_ref, end_ref, release_date=None):
return
textwrap
.
dedent
(
email
)
.
strip
()
def
cut_release_branch
(
release_date
=
None
):
if
release_date
is
None
:
release_date
=
default_release_date
()
release_branch_name
=
"rc/{date}"
.
format
(
date
=
release_date
)
print
(
"Cutting release branch '{name}'..."
.
format
(
name
=
release_branch_name
))
try
:
print
(
git
.
checkout
(
'master'
))
print
(
git
.
pull
())
print
(
git
.
checkout
(
'HEAD'
,
b
=
release_branch_name
))
print
(
git
.
push
())
except
GitCommandError
as
exception
:
print
(
exception
)
return
None
return
release_branch_name
def
main
():
parser
=
make_parser
()
args
=
parser
.
parse_args
()
...
...
@@ -560,6 +584,17 @@ def main():
print
(
"
\n
"
)
print
(
generate_commit_table
(
args
.
previous
,
args
.
current
))
if
args
.
cut_branch
:
branch_name
=
cut_release_branch
(
args
.
date
)
if
branch_name
:
print
(
"OPEN THE PULL REQUEST: https://github.com/edx/edx-platform/compare/release...{name}"
.
format
(
name
=
branch_name
)
)
else
:
print
(
"Skipping branch cut"
)
if
__name__
==
"__main__"
:
main
()
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