示例#1
0
def git_check_for_tag_collision(new_build_number):
    existing_tags = git.tag().split('\n')
    for tag in existing_tags:
        if tag == new_build_number:
            raise Exception(
                'Build number has already been used as a tag in git, aborting.'
            )
def git_check_for_tag_collision(new_build_number):
    existing_tags = git.tag().split('\n')
    for tag in existing_tags:
        if tag == new_build_number:
            raise Exception('Build number has already been used as a tag in git, aborting.')
示例#3
0
        ant('release', _fg=True)

        cd('%s/android-google' % (root_dir, ))

        ant('release', _fg=True)

        cd('%s/android-amazon' % (root_dir, ))

        ant('release', _fg=True)

        cd(root_dir)

        git.commit(a=True,
                   m='Artifacts from release-%s' % (new_build_number, ))
        git.tag('release-%s' % (new_build_number, ))

        tower_consts = open(TOWER_CONSTS_JAVA).read()
        tower_consts = debug_flag_re.sub('boolean DEBUG = true;', tower_consts)
        tower_consts = server_url_re.sub(
            'String HAPPYDROIDS_SERVER = "local.happydroids.com";',
            tower_consts)
        tower_consts = server_https_re.sub(
            'String HAPPYDROIDS_URI = "http://" + HAPPYDROIDS_SERVER;',
            tower_consts)

        with open(TOWER_CONSTS_JAVA, 'w') as fp:
            fp.write(tower_consts)

    except Exception, e:
        print e
        with open('release.properties', 'w') as fp:
            fp.write('project.version=%s' % (new_build_number))

        ant('release', _fg=True)

        cd('%s/android-google' % (root_dir,))

        ant('release', _fg=True)

        cd('%s/android-amazon' % (root_dir,))

        ant('release', _fg=True)

        cd(root_dir)

        git.commit(a=True, m='Artifacts from release-%s' % (new_build_number,))
        git.tag('release-%s' % (new_build_number,))

        tower_consts = open(TOWER_CONSTS_JAVA).read()
        tower_consts = debug_flag_re.sub('boolean DEBUG = true;', tower_consts)
        tower_consts = server_url_re.sub('String HAPPYDROIDS_SERVER = "local.happydroids.com";', tower_consts)
        tower_consts = server_https_re.sub('String HAPPYDROIDS_URI = "http://" + HAPPYDROIDS_SERVER;', tower_consts)

        with open(TOWER_CONSTS_JAVA, 'w') as fp:
            fp.write(tower_consts)

    except Exception, e:
        print e
        sys.exit(1)