summaryrefslogtreecommitdiff
path: root/docs/cli-examples.rst
diff options
context:
space:
mode:
authorNejc Habjan <nejc.habjan@siemens.com>2022-07-05 14:14:40 +0200
committerJohn Villalovos <john@sodarock.com>2022-07-05 09:19:34 -0700
commitd5de4b1fe38bedc07862bd9446dfd48b92cb078d (patch)
tree0a9cfb7e608246f25c057ef69e1dd9812f840ed8 /docs/cli-examples.rst
parent3f67c4b0fb0b9a39c8b93529a05b1541fcebcabe (diff)
downloadgitlab-d5de4b1fe38bedc07862bd9446dfd48b92cb078d.tar.gz
docs: document CI Lint usage
Diffstat (limited to 'docs/cli-examples.rst')
-rw-r--r--docs/cli-examples.rst42
1 files changed, 42 insertions, 0 deletions
diff --git a/docs/cli-examples.rst b/docs/cli-examples.rst
index 5f4e0bc..7f21f03 100644
--- a/docs/cli-examples.rst
+++ b/docs/cli-examples.rst
@@ -6,6 +6,48 @@ CLI examples
For a complete list of objects and actions available, see :doc:`/cli-objects`.
+CI Lint
+-------
+
+Lint a CI YAML configuration from a string:
+
+.. note::
+
+ To see output, you will need to use the ``-v``/``--verbose`` flag.
+
+.. code-block:: console
+
+ $ gitlab --verbose ci-lint create --content \
+ "---
+ test:
+ script:
+ - echo hello
+ "
+
+Lint a CI YAML configuration from a file (see :ref:`cli_from_files`):
+
+.. code-block:: console
+
+ $ gitlab --verbose ci-lint create --content @.gitlab-ci.yml
+
+Lint a project's CI YAML configuration:
+
+.. code-block:: console
+
+ $ gitlab --verbose project-ci-lint create --project-id group/my-project --content @.gitlab-ci.yml
+
+Lint a project's current CI YAML configuration:
+
+.. code-block:: console
+
+ $ gitlab --verbose project-ci-lint get --project-id group/my-project
+
+Lint a project's current CI YAML configuration on a specific branch:
+
+.. code-block:: console
+
+ $ gitlab --verbose project-ci-lint get --project-id group/my-project --ref my-branch
+
Projects
--------