Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gitlab CI and gitignores APIs Rework the templates/license API docs
- Loading branch information
Gauvain Pocentek
committed
Nov 6, 2016
1 parent
463893f
commit 570e75d
Showing
7 changed files
with
125 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# license list | ||
licenses = gl.licenses.list() | ||
# end license list | ||
|
||
# license get | ||
license = gl.licenses.get('apache-2.0', project='foobar', fullname='John Doe') | ||
print(license.content) | ||
# end license get | ||
|
||
# gitignore list | ||
gitignores = gl.gitignores.list() | ||
# end gitignore list | ||
|
||
# gitignore get | ||
gitignore = gl.gitignores.get('Python') | ||
print(gitignore.content) | ||
# end gitignore get | ||
|
||
# gitlabciyml list | ||
gitlabciymls = gl.gitlabciymls.list() | ||
# end gitlabciyml list | ||
|
||
# gitlabciyml get | ||
gitlabciyml = gl.gitlabciymls.get('Pelican') | ||
print(gitlabciyml.content) | ||
# end gitlabciyml get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
######### | ||
Templates | ||
######### | ||
|
||
You can request templates for different type of files: | ||
|
||
* License files | ||
* .gitignore files | ||
* GitLab CI configuration files | ||
|
||
License templates | ||
================= | ||
|
||
* Object class: :class:`~gitlab.objects.License` | ||
* Manager object: :attr:`gitlab.Gitlab.licenses` | ||
|
||
Examples | ||
-------- | ||
|
||
List known license templates: | ||
|
||
.. literalinclude:: templates.py | ||
:start-after: # license list | ||
:end-before: # end license list | ||
|
||
Generate a license content for a project: | ||
|
||
.. literalinclude:: templates.py | ||
:start-after: # license get | ||
:end-before: # end license get | ||
|
||
.gitignore templates | ||
==================== | ||
|
||
* Object class: :class:`~gitlab.objects.Gitignore` | ||
* Manager object: :attr:`gitlab.Gitlab.gitognores` | ||
|
||
Examples | ||
-------- | ||
|
||
List known gitignore templates: | ||
|
||
.. literalinclude:: templates.py | ||
:start-after: # gitignore list | ||
:end-before: # end gitignore list | ||
|
||
Get a gitignore template: | ||
|
||
.. literalinclude:: templates.py | ||
:start-after: # gitignore get | ||
:end-before: # end gitignore get | ||
|
||
GitLab CI templates | ||
=================== | ||
|
||
* Object class: :class:`~gitlab.objects.Gitlabciyml` | ||
* Manager object: :attr:`gitlab.Gitlab.gitlabciymls` | ||
|
||
Examples | ||
-------- | ||
|
||
List known GitLab CI templates: | ||
|
||
.. literalinclude:: templates.py | ||
:start-after: # gitlabciyml list | ||
:end-before: # end gitlabciyml list | ||
|
||
Get a GitLab CI template: | ||
|
||
.. literalinclude:: templates.py | ||
:start-after: # gitlabciyml get | ||
:end-before: # end gitlabciyml get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters