Skip to content
Snippets Groups Projects
Commit 8c515282 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

New release scripts for testing the release.

parent da235431
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ def main():
if os.path.exists(get_working_dir()):
print "Directory %s exists, continuing release process." % get_working_dir()
finalize_release()
else:
prepare_release()
......
import os
import sys
from common import *
def check_tarball():
print "Checking tarball ..."
cmd = "cd %s; wget http://apps.jcns.fz-juelich.de/src/BornAgain/BornAgain-%s.tar.gz" % (get_checktarball_dir(), get_version())
print cmd
cmd = "cd %s; tar zxf BornAgain-%s.tar.gz" % (get_checktarball_dir(), get_version())
print cmd
cmd = "cd %s; mkdir build; mkdir installed" % get_checktarball_dir()
print cmd
cmd = "cd %s/build; cmake -DCMAKE_INSTALL_PREFIX=../installed ../BornAgain-%s; make -j8; make check; make install" % (get_checktarball_dir(), get_version())
print cmd
cmd = "cd %s/installed; source bin/thisbornagain.sh; python -c \"from libBornAgainCore import *; print GetVersionNumber()\"" % (get_checktarball_dir())
print cmd
def check_release():
print "Checking release"
check_tarball()
......@@ -49,6 +49,18 @@ def get_version():
return version
def get_checkrelease_dir():
return get_working_dir()+"/"+"checkrelease"
def get_checkmaster_dir():
return get_checkrelease_dir()+"/"+"checkmaster"
def get_checktarball_dir():
return get_checkrelease_dir()+"/"+"checktarball"
def run_command(cmd):
print ">>>", cmd
returncode = os.system(cmd)
......
import os
import sys
import time
from common import *
from check_release import *
def upload_release():
print "Uploading to the app server ..."
cmd = "rsync --delete -avzhe ssh %s/ apps@apps.jcns.fz-juelich.de:/www/apps/src/BornAgain/" % get_upload_dir()
print cmd
#run_command(cmd)
def finalize_git():
print "Finalizing git ..."
cmd = "cd %s; git commit -a -m \"Release %s\"" % (get_source_dir(), get_version())
#run_command(cmd)
cmd = "cd %s; git push" % get_source_dir()
#run_command(cmd)
# master branch
cmd = "cd %s; git checkout master" % get_source_dir()
#run_command(cmd)
cmd = "cd %s; git merge --no--ff %s -m \"Merge %s\"" % (get_source_dir(), get_branch_name(), get_version())
#run_command(cmd)
cmd = "cd %s; git tag -a %s -m \"Release %s\"" % (get_source_dir(), get_version(), get_version())
#run_command(cmd)
cmd = "cd %s; git push --tags" % get_source_dir()
#run_command(cmd)
# develop branch
cmd = "cd %s; git checkout develop" % get_source_dir()
#run_command(cmd)
cmd = "cd %s; git merge --no--ff %s -m \"Merge %s\"" % (get_source_dir(), get_branch_name(), get_version())
#run_command(cmd)
cmd = "cd %s; git push" % get_source_dir()
#run_command(cmd)
# deleting branch
cmd = "cd %s; git branch -d %s" % (get_source_dir(), get_branch_name())
#run_command(cmd)
cmd = "cd %s; git push origin --delete %s" % (get_source_dir(), get_branch_name())
#run_command(cmd)
def finalize_release():
print "\nFinalizing release %s in working directory '%s'." % (get_version(), get_working_dir())
print "Please select what you want to do:"
print ""
print "1. Upload release to the apps server"
print "2. Finalize git"
print "3. Check release"
print "4. Quit"
is_valid = 0
while not is_valid:
try:
choice = int(raw_input('Enter your choice [1-4] : '))
is_valid = 1
except ValueError, e:
print ("'%s' is not a valid integer." % e.args[0].split(": ")[1])
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...")
......@@ -23,6 +23,9 @@ def make_directories():
os.makedirs(get_build_dir())
os.makedirs(get_upload_dir())
os.makedirs(get_install_dir())
os.makedirs(get_checkrelease_dir())
os.makedirs(get_checktarball_dir())
os.makedirs(get_checkmaster_dir())
def git_clone():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment