Skip to content
Snippets Groups Projects
Commit d990d250 authored by Van Herck, Walter's avatar Van Herck, Walter
Browse files

Merge branch 'release_script' into develop

parents 559c3ef1 4814f376
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ def check_tarball(): ...@@ -22,7 +22,7 @@ def check_tarball():
run_command(cmd) run_command(cmd)
cmd = "cd %s/build; cmake -DCMAKE_INSTALL_PREFIX=../installed ../BornAgain-%s; make -j8; make check; make install" % (get_checktarball_dir(), get_version()) cmd = "cd %s/build; cmake -DCMAKE_INSTALL_PREFIX=../installed ../BornAgain-%s; make -j8; make check; make install" % (get_checktarball_dir(), get_version())
run_command(cmd) run_command(cmd)
cmd = "source %s/installed/bin/thisbornagain.sh; python -c \"from libBornAgainCore import *; print GetVersionNumber()\"" % (get_checktarball_dir()) cmd = "cd %s/installed/lib; python -c \"from libBornAgainCore import *; print GetVersionNumber()\"" % (get_checktarball_dir())
print cmd print cmd
result = subprocess.check_output(cmd, shell=True) result = subprocess.check_output(cmd, shell=True)
received_version = result.split("\n")[0] received_version = result.split("\n")[0]
......
...@@ -20,7 +20,7 @@ def finalize_git(): ...@@ -20,7 +20,7 @@ def finalize_git():
run_command(cmd) run_command(cmd)
# master branch # master branch
cmd = "cd %s; git checkout master" % get_source_dir() cmd = "cd %s; git checkout master; git pull" % get_source_dir()
run_command(cmd) run_command(cmd)
cmd = "cd %s; git merge --no-ff %s -m \"Merge %s\"" % (get_source_dir(), get_branch_name(), get_version()) cmd = "cd %s; git merge --no-ff %s -m \"Merge %s\"" % (get_source_dir(), get_branch_name(), get_version())
...@@ -33,7 +33,7 @@ def finalize_git(): ...@@ -33,7 +33,7 @@ def finalize_git():
run_command(cmd) run_command(cmd)
# develop branch # develop branch
cmd = "cd %s; git checkout develop" % get_source_dir() cmd = "cd %s; git checkout develop; git pull" % get_source_dir()
run_command(cmd) run_command(cmd)
cmd = "cd %s; git merge --no-ff %s -m \"Merge %s\"" % (get_source_dir(), get_branch_name(), get_version()) cmd = "cd %s; git merge --no-ff %s -m \"Merge %s\"" % (get_source_dir(), get_branch_name(), get_version())
...@@ -47,8 +47,7 @@ def finalize_git(): ...@@ -47,8 +47,7 @@ def finalize_git():
cmd = "cd %s; git push origin --delete %s" % (get_source_dir(), get_branch_name()) cmd = "cd %s; git push origin --delete %s" % (get_source_dir(), get_branch_name())
run_command(cmd) run_command(cmd)
def get_menu_option():
def finalize_release():
print "\nFinalizing release %s in working directory '%s'." % (get_version(), get_working_dir()) print "\nFinalizing release %s in working directory '%s'." % (get_version(), get_working_dir())
print "Please select what you want to do:" print "Please select what you want to do:"
...@@ -58,6 +57,7 @@ def finalize_release(): ...@@ -58,6 +57,7 @@ def finalize_release():
print "3. Check release" print "3. Check release"
print "4. Quit" print "4. Quit"
choice = 0
is_valid = 0 is_valid = 0
while not is_valid: while not is_valid:
...@@ -66,14 +66,20 @@ def finalize_release(): ...@@ -66,14 +66,20 @@ def finalize_release():
is_valid = 1 is_valid = 1
except ValueError, e: except ValueError, e:
print ("'%s' is not a valid integer." % e.args[0].split(": ")[1]) print ("'%s' is not a valid integer." % e.args[0].split(": ")[1])
return choice
def finalize_release():
choice = get_menu_option()
while choice != 4:
if choice == 1:
upload_release()
elif choice == 2:
finalize_git()
elif choice == 3:
check_release()
else:
print ("Invalid number. Try again...")
choice = get_menu_option()
exit("Good bye")
if choice == 1:
upload_release()
elif choice == 2:
finalize_git()
elif choice == 3:
check_release()
elif choice == 4:
exit("Good bye")
else:
print ("Invalid number. Try again...")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment