-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build: expose VCS-related environment variables #10168
Changes from all commits
73d573d
d3f1bff
39c1fd3
58c49c3
04088d5
5fde482
5bb3d74
4687f09
3114f95
0ffc99a
8432ef5
420ba97
4b2eb75
6d4dd3b
77af82e
735d21b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,31 @@ All :doc:`build processes </builds>` have the following environment variables au | |
:Example: ``https://docs.readthedocs.io/ja/stable/`` | ||
:Example: ``https://example--17.org.readthedocs.build/fr/17/`` | ||
|
||
.. envvar:: READTHEDOCS_GIT_CLONE_URL | ||
|
||
URL for the remote source repository, from which the documentation is cloned. | ||
It could be HTTPS, SSH or any other URL scheme supported by Git. | ||
This is the same URL defined in your Project's :term:`dashboard` in :menuselection:`Admin --> Settings --> Repository URL`. | ||
|
||
:Example: ``https://github.com/readthedocs/readthedocs.org`` | ||
:Example: ``[email protected]:readthedocs/readthedocs.org.git`` | ||
|
||
.. envvar:: READTHEDOCS_GIT_IDENTIFIER | ||
|
||
Contains the Git identifier that was *checked out* from the remote repository URL. | ||
Possible values are either a branch or tag name. | ||
|
||
:Example: ``v1.x`` | ||
:Example: ``bugfix/docs-typo`` | ||
:Example: ``feature/signup`` | ||
:Example: ``update-readme`` | ||
|
||
.. envvar:: READTHEDOCS_GIT_COMMIT_HASH | ||
|
||
Git commit hash identifier checked out from the repository URL. | ||
humitos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
:Example: ``1f94e04b7f596c309b7efab4e7630ed78e85a1f1`` | ||
|
||
.. seealso:: | ||
|
||
:doc:`/environment-variables` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -279,6 +279,9 @@ def test_get_env_vars(self, load_yaml_config, build_environment, config, externa | |
"READTHEDOCS_OUTPUT": os.path.join( | ||
self.project.checkout_path(self.version.slug), "_readthedocs/" | ||
), | ||
"READTHEDOCS_GIT_CLONE_URL": self.project.repo, | ||
"READTHEDOCS_GIT_IDENTIFIER": self.version.identifier, | ||
"READTHEDOCS_GIT_COMMIT_HASH": self.build.commit, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible that the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's possible that some of these values may be None if there is an error, we use docker, not sure if that also has a problem with None. Are you hitting this problem somwhere? |
||
} | ||
|
||
self._trigger_update_docs_task() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is clearer 👍