-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.py
More file actions
31 lines (27 loc) · 1.33 KB
/
release.py
File metadata and controls
31 lines (27 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
from configuration import *
VERSION = ARGS.pop(0)
def release():
for project, folder, configuration in projects():
libfolders = [os.path.join(folder, lib) for lib in configuration.get('libs', [])]
for location in [folder] + libfolders:
tags = git_capture(location, 'tag')
if not VERSION in tags:
git(location, 'fetch', 'origin')
if configuration.get('gitflow', True):
for branch in ['develop', 'master']:
git(location, 'checkout', branch)
git(location, 'merge', '--ff-only', 'remotes/origin/%s' % branch)
else:
git(location, 'checkout', 'master')
git(location, 'merge', '--ff-only', 'remotes/origin/master')
git(location, "tag", '-a', '-m', VERSION, VERSION)
if configuration.get('gitflow', True):
git(location, 'checkout', 'develop')
git(location, 'merge', 'master', '--no-ff', '-m', VERSION)
git(location, "push", "--all")
git(location, "push", "--tags")
tagged = "../%s/%s" % (VERSION, folder)
if not os.path.exists(tagged):
worked('git', 'clone', '--recursive', '--branch', VERSION, folder, tagged)
ACTIONS.append(release)