Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
639c077
add support for --check-github-config (WIP)
boegel Feb 15, 2016
b0db2a9
further flesh out --check-github implementaton (still WIP)
boegel Feb 16, 2016
d3401e4
add support for --install-github-token
boegel Feb 16, 2016
eaea5d6
add tests for validate_github_token and install_github_token functions
boegel Feb 16, 2016
d6aa695
check whether we're online first, befor checking GitHub access
boegel Feb 17, 2016
1dcfae3
cleanup/refactor
boegel Feb 17, 2016
fac1e80
include status overview of GitHub integration
boegel Feb 17, 2016
6c95190
add check for --git-working-dirs-path
boegel Feb 17, 2016
1be4d62
Merge branch 'develop' into check_github
boegel Feb 17, 2016
284f6f3
Merge branch 'develop' into check_github
boegel Feb 19, 2016
2b1f2b8
fix if check for GitHub integration options (argh!)
boegel Feb 19, 2016
080e64f
flesh out handling of GitHub integration options
boegel Feb 19, 2016
cbaab17
refactor, fix FIXMEs, drop clone_rep
boegel Feb 19, 2016
c162444
pass down orig_paths
boegel Feb 19, 2016
b63c9c6
fix error msg
boegel Feb 21, 2016
ad9ac07
first round of fixing remarks
boegel Feb 22, 2016
914e4c8
fix moar remarks
boegel Feb 22, 2016
e5d9c5c
fix even moarrrrr remarks
boegel Feb 22, 2016
273cb85
rewrite --install-github-token with getpass
boegel Feb 23, 2016
27d94d5
fix test for install_github_token
boegel Feb 23, 2016
8258fa9
Merge branch 'develop' into check_github
boegel Mar 1, 2016
094aa95
Merge branch 'develop' into check_github
boegel Mar 3, 2016
f684860
always set up repo with [email protected] to test push access, use corre…
boegel Mar 3, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 31 additions & 17 deletions easybuild/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
from easybuild.framework.easyconfig.tweak import obtain_ec_for, tweak
from easybuild.tools.config import find_last_log, get_repository, get_repositorypath, build_option
from easybuild.tools.filetools import adjust_permissions, cleanup, write_file
from easybuild.tools.github import new_pr, update_pr
from easybuild.tools.github import check_github, install_github_token, new_pr, update_pr
from easybuild.tools.options import process_software_build_specs
from easybuild.tools.robot import det_robot_path, dry_run, resolve_dependencies, search_easyconfigs
from easybuild.tools.package.utilities import check_pkg_support
Expand Down Expand Up @@ -152,6 +152,31 @@ def build_and_install_software(ecs, init_session_state, exit_on_failure=True):
return res


def handle_github_options(options, orig_paths):
"""Handle options related to GitHub integration, if any are set."""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc args

done = True

if options.check_github:
check_github()

elif options.install_github_token:
install_github_token(options.install_github_token, options.github_user, silent=build_option('silent'))

elif options.new_pr:
new_pr(orig_paths, title=options.pr_title, descr=options.pr_descr, commit_msg=options.pr_commit_msg)

elif options.review_pr:
print review_pr(options.review_pr, colored=options.color)

elif options.update_pr:
update_pr(options.update_pr, orig_paths, commit_msg=options.pr_commit_msg)

else:
done = False

return done


def main(args=None, logfile=None, do_build=None, testing=False):
"""
Main function: parse command line options, and act accordingly.
Expand Down Expand Up @@ -230,28 +255,17 @@ def main(args=None, logfile=None, do_build=None, testing=False):
else:
_log.debug("Packaging not enabled, so not checking for packaging support.")

# GitHub integration
if options.review_pr or options.new_pr or options.update_pr:
if options.review_pr:
print review_pr(options.review_pr, colored=options.color)

elif options.new_pr:
new_pr(orig_paths, title=options.pr_title, descr=options.pr_descr, commit_msg=options.pr_commit_msg)

elif options.update_pr:
update_pr(options.update_pr, orig_paths, commit_msg=options.pr_commit_msg)

cleanup(logfile, eb_tmpdir, testing)
sys.exit(0)

# search for easyconfigs, if a query is specified
query = options.search or options.search_filename or options.search_short
if query:
search_easyconfigs(query, short=options.search_short, filename_only=options.search_filename,
terse=options.terse)

# non-verbose cleanup and exit after printing terse info
if options.terse:
# GitHub integration
cleanup_and_exit = handle_github_options(options, orig_paths)

# non-verbose cleanup and exit after handling GitHub integration stuff or printing terse info
if cleanup_and_exit or options.terse:
cleanup(logfile, eb_tmpdir, testing, silent=True)
sys.exit(0)

Expand Down
Loading