Switch to unified view

a/Allura/push_re.py b/Allura/push_re.py
...
...
24
    CP.read(os.path.join(os.environ['HOME'], '.forgepushrc'))
24
    CP.read(os.path.join(os.environ['HOME'], '.forgepushrc'))
25
    engineer = option('re', 'engineer', 'Name of engineer pushing: ')
25
    engineer = option('re', 'engineer', 'Name of engineer pushing: ')
26
    api_key = option('re', 'api_key', 'Forge API Key:')
26
    api_key = option('re', 'api_key', 'Forge API Key:')
27
    secret_key = option('re', 'secret_key', 'Forge Secret Key:')
27
    secret_key = option('re', 'secret_key', 'Forge Secret Key:')
28
    classic_path = option('re', 'classic_path', 'The path to your forge-classic repo:')
28
    classic_path = option('re', 'classic_path', 'The path to your forge-classic repo:')
29
    theme_path = option('re', 'theme_path', 'The path to your sftheme repo:')
29
    if not re_git_dir.match(classic_path):
30
    if not re_git_dir.match(classic_path):
30
        classic_path += '/.git/'
31
        classic_path += '/.git/'
31
    CRED['api_key'] = api_key
32
    CRED['api_key'] = api_key
32
    CRED['secret_key'] = secret_key
33
    CRED['secret_key'] = secret_key
33
    text, tag = make_ticket_text(engineer, classic_path)
34
    text, tag = make_ticket_text(engineer, classic_path, theme_path)
34
    raw_input("Verify that there are no new dependencies, or RPM's are built for all deps...")
35
    raw_input("Verify that there are no new dependencies, or RPM's are built for all deps...")
35
    raw_input("Verify that a new sandbox builds starts without engr help...")
36
    raw_input("Verify that a new sandbox builds starts without engr help...")
36
    print '*** Create a ticket on SourceForge (https://sourceforge.net/p/allura/tickets/new/) with the following contents:'
37
    print '*** Create a ticket on SourceForge (https://sourceforge.net/p/allura/tickets/new/) with the following contents:'
37
    print '*** Summary: Production Push (R:%s, D:%s) - allura' % (
38
    print '*** Summary: Production Push (R:%s, D:%s) - allura' % (
38
        tag, date.today().strftime('%Y%m%d'))
39
        tag, date.today().strftime('%Y%m%d'))
...
...
46
    print re_allura_ref.sub('\nreference: https://sourceforge.net/p/allura/tickets/%s/' % newforge_num, sog_text)
47
    print re_allura_ref.sub('\nreference: https://sourceforge.net/p/allura/tickets/%s/' % newforge_num, sog_text)
47
    print '---END---'
48
    print '---END---'
48
    raw_input('Now link the two tickets...')
49
    raw_input('Now link the two tickets...')
49
    print "Let's tag the forge repo:"
50
    print "Let's tag the forge repo:"
50
    command('git', 'tag', '-a', '-m', '[#%s] - Push to RE' % newforge_num, tag, 'master')
51
    command('git', 'tag', '-a', '-m', '[#%s] - Push to RE' % newforge_num, tag, 'master')
51
    print "Let's make a matching tag in the forge-classic repo:"
52
    command('git', '--git-dir=%s' % classic_path, 'tag', '-a', '-m', '[#%s] - Push to RE' % newforge_num, tag, 'master')
53
    command('git', 'push', 'origin', 'master', '--tags')
52
    command('git', 'push', 'origin', 'master', '--tags')
54
    command('git', 'push', 'live', 'master', '--tags')
53
    command('git', 'push', 'live', 'master', '--tags')
55
54
55
    print "Let's make a matching tag in the forge-classic repo:"
56
    command('git', '--git-dir=%s' % classic_path, 'tag', '-a', '-m', '[#%s] - Push to RE' % newforge_num, tag, 'master')
56
    command('git', '--git-dir=%s' % classic_path, 'push', 'origin', 'master', '--tags')
57
    command('git', '--git-dir=%s' % classic_path, 'push', 'origin', 'master', '--tags')
57
    command('git', '--git-dir=%s' % classic_path, 'push', 'live', 'master', '--tags')
58
    command('git', '--git-dir=%s' % classic_path, 'push', 'live', 'master', '--tags')
59
60
    print "...and in the sftheme repo:"
61
    command('git', '--git-dir=%s' % theme_path, 'tag', '-a', '-m', '[#%s] - Push to RE' % newforge_num, tag, 'master')
62
    command('git', '--git-dir=%s' % theme_path, 'push', 'origin', 'master', '--tags')
63
    command('git', '--git-dir=%s' % theme_path, 'push', 'live', 'master', '--tags')
64
58
    raw_input('Now go to the sog-engr channel and let them know that %s is ready'
65
    raw_input('Now go to the sog-engr channel and let them know that %s is ready'
59
              ' for pushing (include the JIRA ticket #' % tag)
66
              ' for pushing (include the JIRA ticket #' % tag)
60
    raw_input('Make sure SOG restarted reactors and web services.')
67
    raw_input('Make sure SOG restarted reactors and web services.')
61
    CP.write(open(os.path.join(os.environ['HOME'], '.forgepushrc'), 'w'))
68
    CP.write(open(os.path.join(os.environ['HOME'], '.forgepushrc'), 'w'))
62
    print "You're done!"
69
    print "You're done!"
63
70
64
def make_ticket_text(engineer, classic_path):
71
def make_ticket_text(engineer, classic_path, theme_path):
65
    tag_prefix = date.today().strftime('release_%Y%m%d')
72
    tag_prefix = date.today().strftime('release_%Y%m%d')
66
    # get release tag
73
    # get release tag
67
    existing_tags_today = command('git tag -l %s*' % tag_prefix)
74
    existing_tags_today = command('git tag -l %s*' % tag_prefix)
68
    if existing_tags_today:
75
    if existing_tags_today:
69
        tag = '%s.%.2d' % (tag_prefix, len(existing_tags_today))
76
        tag = '%s.%.2d' % (tag_prefix, len(existing_tags_today))
...
...
74
    else: last_release = ''
81
    else: last_release = ''
75
    changes = command(
82
    changes = command(
76
            'git', 'log', "--format=* %h %s", last_release.strip() + '..')
83
            'git', 'log', "--format=* %h %s", last_release.strip() + '..')
77
    changes += command(
84
    changes += command(
78
            'git', '--git-dir=%s' % classic_path, 'log', "--format=* %h %s", last_release.strip() + '..')
85
            'git', '--git-dir=%s' % classic_path, 'log', "--format=* %h %s", last_release.strip() + '..')
86
    changes += command(
87
            'git', '--git-dir=%s' % theme_path, 'log', "--format=* %h %s", last_release.strip() + '..')
79
    if not changes:
88
    if not changes:
80
        print 'There were no commits found; maybe you forgot to merge dev->master? (Ctrl-C to abort)'
89
        print 'There were no commits found; maybe you forgot to merge dev->master? (Ctrl-C to abort)'
81
    changelog = ''.join(changes or [])
90
    changelog = ''.join(changes or [])
82
    changes = ''.join(format_changes(changes))
91
    changes = ''.join(format_changes(changes))
83
    print 'Changelog:\n%s' % changelog
92
    print 'Changelog:\n%s' % changelog
...
...
156
165
157
TICKET_TEMPLATE=string.Template('''{{{
166
TICKET_TEMPLATE=string.Template('''{{{
158
#!push
167
#!push
159
168
160
(engr) Name of Engineer pushing: $engineer
169
(engr) Name of Engineer pushing: $engineer
161
(engr) Which code tree(s): allura, forge-classic
170
(engr) Which code tree(s): allura, forge-classic, sftheme
162
(engr) Is configtree to be pushed?: no
171
(engr) Is configtree to be pushed?: no
163
(engr) Which release/revision is going to be synced?: $tag
172
(engr) Which release/revision is going to be synced?: $tag
164
(engr) Itemized list of changes to be launched with sync:
173
(engr) Itemized list of changes to be launched with sync:
165
174
166
$changes
175
$changes