diff options
author | Henk Hesselink <henk@hondo.nl> | 2016-11-20 19:03:40 -0500 |
---|---|---|
committer | Henk Hesselink <henk@hondo.nl> | 2016-11-20 19:03:40 -0500 |
commit | 394954fc80230e01112166db4fe133c107febead (patch) | |
tree | 3d8cf58c9838fa2f9ac7d9446a74fad076023a7a /gitautodeploy/parsers/common.py | |
parent | 749ce13ae6e9cecf69997d36228f2cab9a2eb8ec (diff) | |
download | Git-Auto-Deploy-394954fc80230e01112166db4fe133c107febead.zip Git-Auto-Deploy-394954fc80230e01112166db4fe133c107febead.tar.gz Git-Auto-Deploy-394954fc80230e01112166db4fe133c107febead.tar.bz2 |
Allow more than one GitHub repo from the same user
GitHub does not allow the same SSH key to be used for multiple
repositories on the same server belonging to the same user, see:
http://snipe.net/2013/04/multiple-github-deploy-keys-single-server
The fix there doesn't work because the "url" field is used both to
get the repo and to identify it when a push comes in. Using a local
SSH name for the repo works for getting the repo but then the name in
the push doesn't match.
This patch adds a 'repo' option that that can be set to the name of
the repo as given in the push. If 'repo' is not set the behaviour
is unchanged.
Example:
"url": "git@repo-a-shortname/somerepo.git"
"repo": "git@github.com/somerepo.git"
Diffstat (limited to 'gitautodeploy/parsers/common.py')
-rw-r--r-- | gitautodeploy/parsers/common.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gitautodeploy/parsers/common.py b/gitautodeploy/parsers/common.py index 42cbbdd..e999a25 100644 --- a/gitautodeploy/parsers/common.py +++ b/gitautodeploy/parsers/common.py @@ -16,9 +16,9 @@ class WebhookRequestParser(object): for repo_config in self._config['repositories']: if repo_config in configs: continue - if repo_config['url'] == url: + if repo_config.get('repo', repo_config.get('url')) == url: configs.append(repo_config) elif 'url_without_usernme' in repo_config and repo_config['url_without_usernme'] == url: configs.append(repo_config) - return configs
\ No newline at end of file + return configs |