##// END OF EJS Templates
repo-settings: expose pull api endpoint into remote pull view for easier automation.
marcink -
r1551:9c7eeec8 default
parent child Browse files
Show More
@@ -75,7 +75,7 b' Example call for auto pulling from remot'
75 .. code-block:: bash
75 .. code-block:: bash
76
76
77 curl https://server.com/_admin/api -X POST -H 'content-type:text/plain' --data-binary '{"id":1,
77 curl https://server.com/_admin/api -X POST -H 'content-type:text/plain' --data-binary '{"id":1,
78 "auth_token":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull", "args":{"repo":"CPython"}}'
78 "auth_token":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull", "args":{"repoid":"CPython"}}'
79
79
80 Provide those parameters:
80 Provide those parameters:
81 - **id** A value of any type, which is used to match the response with the
81 - **id** A value of any type, which is used to match the response with the
@@ -1992,6 +1992,16 b' def get_last_path_part(file_node):'
1992 return u'../' + path
1992 return u'../' + path
1993
1993
1994
1994
1995 def route_url(*args, **kwds):
1996 """
1997 Wrapper around pyramids `route_url` function. It is used to generate
1998 URLs from within pylons views or templates. This will be removed when
1999 pyramid migration if finished.
2000 """
2001 req = get_current_request()
2002 return req.route_url(*args, **kwds)
2003
2004
1995 def route_path(*args, **kwds):
2005 def route_path(*args, **kwds):
1996 """
2006 """
1997 Wrapper around pyramids `route_path` function. It is used to generate
2007 Wrapper around pyramids `route_path` function. It is used to generate
@@ -6,7 +6,15 b''
6
6
7 %if c.repo_info.clone_uri:
7 %if c.repo_info.clone_uri:
8
8
9 <div class="panel-body-title-text">${_('Remote mirror url')}: <a href="${c.repo_info.clone_uri}">${c.repo_info.clone_uri_hidden}</a></div>
9 <div class="panel-body-title-text">${_('Remote mirror url')}:
10 <a href="${c.repo_info.clone_uri}">${c.repo_info.clone_uri_hidden}</a>
11 <p>
12 ${_('Pull can be automated by such api call called periodically (in crontab etc)')}
13 </p>
14 <code>
15 curl ${h.route_url('apiv2')} -X POST -H 'content-type:text/plain' --data-binary '{"id":1, "auth_token":"SECRET","method":"pull", "args":{"repoid":"${c.repo_info.repo_name}"}}'
16 </code>
17 </div>
10
18
11 ${h.secure_form(url('edit_repo_remote', repo_name=c.repo_name), method='put')}
19 ${h.secure_form(url('edit_repo_remote', repo_name=c.repo_name), method='put')}
12 <div class="form">
20 <div class="form">
@@ -18,7 +26,7 b''
18 %else:
26 %else:
19 <div class="panel-body-title-text">${_('This repository does not have any remote mirror url set.')}</div>
27 <div class="panel-body-title-text">${_('This repository does not have any remote mirror url set.')}</div>
20
28
21 <button class="btn btn-default" type="submit" disabled="disabled">
29 <button class="btn disabled" type="submit" disabled="disabled">
22 ${_('Pull changes from remote location')}
30 ${_('Pull changes from remote location')}
23 </button>
31 </button>
24 %endif
32 %endif
General Comments 0
You need to be logged in to leave comments. Login now