File tree Expand file tree Collapse file tree 4 files changed +23
-0
lines changed Expand file tree Collapse file tree 4 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -180,3 +180,13 @@ project and build documentations without having elasticsearch.
180
180
181
181
182
182
.. _elasticsearch-dsl-py.connections.configure : https://elasticsearch-dsl.readthedocs.io/en/stable/configuration.html#multiple-clusters
183
+
184
+ EXTERNAL_VERSION_URL
185
+ --------------------
186
+
187
+ Default: ``None ``
188
+
189
+ The URL where we host external version builds (Pull Requests).
190
+ Set this to the URL where the static files are uploaded to,
191
+ with a prefix of `/external/ `,
192
+ to make it work.
Original file line number Diff line number Diff line change @@ -273,6 +273,16 @@ def commit_name(self):
273
273
return self .identifier
274
274
275
275
def get_absolute_url (self ):
276
+ # Hack external versions for now.
277
+ # TODO: We can integrate them into the resolver
278
+ # but this is much simpler to handle since we only link them a couple places for now
279
+ if self .type == EXTERNAL :
280
+ url = f'{ settings .EXTERNAL_VERSION_URL } /html/' \
281
+ f'{ self .project .slug } /{ self .slug } /'
282
+ # Django's static file serving doesn't automatically append index.html
283
+ if settings .DEBUG :
284
+ url += 'index.html'
285
+ return url
276
286
if not self .built and not self .uploaded :
277
287
return reverse (
278
288
'project_version_detail' ,
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ class CommunityBaseSettings(Settings):
41
41
PUBLIC_DOMAIN_USES_HTTPS = False
42
42
USE_SUBDOMAIN = False
43
43
PUBLIC_API_URL = 'https://{}' .format (PRODUCTION_DOMAIN )
44
+ EXTERNAL_VERSION_URL = None # for pull request builds
44
45
45
46
# Doc Builder Backends
46
47
MKDOCS_BACKEND = 'readthedocs.doc_builder.backends.mkdocs'
Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ def DATABASES(self): # noqa
32
32
SLUMBER_API_HOST = 'http://127.0.0.1:8000'
33
33
PUBLIC_API_URL = 'http://127.0.0.1:8000'
34
34
35
+ EXTERNAL_VERSION_URL = 'http://127.0.0.1:8000/static/external'
36
+
35
37
BROKER_URL = 'redis://localhost:6379/0'
36
38
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
37
39
CELERY_RESULT_SERIALIZER = 'json'
You can’t perform that action at this time.
0 commit comments