Skip to content

Commit

Permalink
Add suggested packages
Browse files Browse the repository at this point in the history
  • Loading branch information
abn290 committed Nov 19, 2017
1 parent ca34da0 commit 972b747
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion build/release/make_munkireport_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def set_version(version):
f.truncate()
f.write(content)

def get_version_from_string(str):
return str.split(" ", 1)[0]

def main():
"""Builds and pushes a new munkireport-php release from an existing Git clone
Expand Down Expand Up @@ -214,7 +216,17 @@ def main():
# install dependencies
subprocess.check_call(['composer', 'install', '--no-dev',
'--ignore-platform-reqs', '--optimize-autoloader'])


# also install all suggested packages
data = json.load(open('composer.json'))
for key, value in data['suggest'].iteritems():
version = get_version_from_string(value)
pkg = "%s:%s" % (key, version)
print ['composer', 'require', '--update-no-dev',
'--ignore-platform-reqs', '--optimize-autoloader', pkg]
subprocess.check_call(['composer', 'require', '--update-no-dev',
'--ignore-platform-reqs', '--optimize-autoloader', pkg])

# zip up
zip_file = 'munkireport-%s.zip' % current_version
subprocess.check_call(['zip', '-r', zip_file, '.', '--exclude', '.git*'])
Expand Down

0 comments on commit 972b747

Please sign in to comment.