Skip to content

Commit 064b365

Browse files
committed
Merge pull request #331 from warrenvw/st2docs
2 parents 78f8f13 + e030246 commit 064b365

32 files changed

Lines changed: 686 additions & 349 deletions

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ sphinx-autobuild -H 127.0.0.1 -b html ./docs/source/ ./docs/build/html
116116
st2 trigger list
117117
118118
* Reference the document
119-
120-
:doc:`/start`
121-
:doc:`in the Rules doc </rules>`
122-
119+
```
120+
:doc:`/start`
121+
:doc:`in the Rules doc </rules>`
122+
```
123123
* Referencing an arbitrary section: for instance, there's examples section in sensors.rst. Define a reference on `examples` section in sensors.rst:
124124
125125
.. _sensors-examples:
@@ -145,14 +145,17 @@ sphinx-autobuild -H 127.0.0.1 -b html ./docs/source/ ./docs/build/html
145145
146146
:github_st2:`st2/st2common/st2common/operators.py </st2common/st2common/operators.py>`
147147
148-
* Link to Github st2contrib repo:
148+
* Link to Github StackStorm-Exchange org:
149+
150+
:github_exchange:`Link to a sensu pack repo inside Exchange<stackstorm-sensu>`
151+
152+
* Link to StackStorm Exchange website with a filter query:
149153
150-
:github_contrib:`Link to docker README on st2contrib<packs/docker/README.md>`
154+
:web_exchange:`Sensu<sensu>`
151155
152-
* Link to st2contrib and st2incubator repos on Github (using a global we set up in source/conf.py)
156+
* Link to the Exchange website on Github (using a global we set up in source/conf.py)
153157
154-
`st2contrib`_
155-
`st2incubator`_
158+
`exchange`_
156159
157160
* The pattern to include an example from `/st2/contrib/examples`: make example file name a reference on github. May say that it is deployed to `/usr/share/doc/st2/examples/`, and auto-include the file:
158161
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. note::
2+
3+
All the information on this page refers to the config files inside the
4+
``/opt/stackstorm/configs/`` directory.
5+
6+
config.yaml files inside the pack directory have been deprecated in |st2|
7+
v1.5. Values from config.yaml file **don't** get saved in the database when
8+
running ``st2 reload --register-configs`` and those configs also don't
9+
support config schemas.
10+
11+
For backward compatibility, if a pack doesn't contain a config inside the
12+
``/opt/stackstorm/configs/`` directory, values from config.yaml are still
13+
used when running an action, but support for config.yaml files inside the
14+
pack directory will be fully removed in the next major release.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.. NOTE: This file has been generated automatically, don't manually edit it
22
3-
* ``env`` (object) - Environment variables which will be available to the script(e.g. key1=val1,key2=val2)
3+
* ``env`` (object) - Environment variables which will be available to the script.
44
* ``timeout`` (integer) - Action timeout in seconds. Action will get killed if it doesn't finish in timeout seconds.
60.4 KB
Loading
91.1 KB
Loading
76.3 KB
Loading
52.8 KB
Loading

docs/source/actions.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ are serialized based on the simple rules described below:
412412
1. ``string``, ``integer``, ``float`` - Serialized as a string.
413413
2. ``boolean`` - Serialized as a string ``1`` (true) or ``0`` (false).
414414
3. ``lists`` - Serialized as a comma delimited string (e.g. ``foo,bar,baz``).
415-
4. ``objects`` - Serialized as JSON.
415+
4. ``object`` - Serialized as JSON.
416416

417417
Using this simple serialization format allows users to easily utilize those
418418
values in their scripts by using standard Bash functionality (``-z`` for check
@@ -552,7 +552,7 @@ passed in, action will be considered as failed (first flag in the result tuple
552552
indicating action status is ``False``).
553553

554554
For a more complex example, please refer to the `actions in the Libcloud pack in
555-
the contrib repository <https://github.com/StackStorm/st2contrib/tree/master/packs/libcloud/actions>`_.
555+
StackStorm Exchange <https://github.com/StackStorm-Exchange/libcloud/tree/master/actions>`_.
556556

557557
Configuration File
558558
~~~~~~~~~~~~~~~~~~
@@ -632,7 +632,7 @@ Pre-defined Actions
632632
^^^^^^^^^^^^^^^^^^^
633633

634634
There are several predefined actions that come out of the box when |st2|
635-
is installed via packages.
635+
is installed via packages. These are in the ``core`` pack:
636636

637637
``core.local`` : This action allows execution of arbitrary \*nix/shell commands
638638
locally. You can excute this command via the CLI using:
@@ -662,15 +662,15 @@ and password:
662662

663663
st2 run core.http url="http://httpbin.org/get" method="GET" username=user1 password=pass1
664664

665-
To see all predefined actions:
665+
To see all actions in the ``core`` pack:
666666

667667
::
668668

669669
st2 action list --pack=core
670670

671671
.. rubric:: What's Next?
672672

673-
* Explore packs and actions contributed by |st2| developers and community in the `StackStorm st2contrib repo on Github <https://github.com/StackStorm/st2contrib/>`_.
673+
* Explore packs and actions contributed by |st2| developers and community in the `StackStorm Exchange <https://exchange.stackstorm.org>`_.
674674
* Check out `tutorials on stackstorm.com <http://stackstorm.com/category/tutorials/>`__ on creating actions, and other practical examples of automating with |st2|.
675675

676676
.. _JSON Schema: http://json-schema.org/documentation.html

docs/source/chatops/notifications.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Notifications
44
If you read through the :ref:`ref-chatops` section, you are familiar with notifications.
55
Even without ChatOps, notifications can be used to post messages to external systems
66
like Chat clients, send emails etc. Notifications require an action that is registered with
7-
|st2| (e.g., the `post_message <https://github.com/StackStorm/st2contrib/blob/master/packs/slack/actions/post_message.yaml>`_ action in the the ``slack`` pack)
7+
|st2| (e.g., the `post_message <https://github.com/StackStorm-Exchange/stackstorm-slack/tree/master/actions/post_message.yaml>`_ action in the the ``slack`` pack)
88
and a notification rule to go with it. Notifications are implemented as triggers, rules and actions.
99
A special ``core.st2.notifytrigger`` is emitted by the system on completion of every action.
1010
A rule to match the trigger to a notify action results in notifications being sent out.
Lines changed: 49 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,78 @@
11
Packs
22
=====
33

4-
Installing packs from st2incubator or st2contrib via ChatOps
5-
------------------------------------------------------------
4+
Installing packs with ChatOps
5+
-----------------------------
66

7-
When you have the bot listening for ChatOps commands in a channel, installing extra packs
8-
can be done by running a single command:
7+
When you have the bot listening for ChatOps commands in a channel, installing extra packs
8+
from StackStorm Exchange can be done by running a single command:
99

1010
.. code-block:: bash
1111
12-
! pack deploy st2contrib elasticsearch,travis_ci
13-
bot: Deploying the requested pack(s) from *st2contrib* for you....
14-
@my_user: Successful deployment of *elasticsearch* *travis_ci* !
15-
> from https://github.com/StackStorm/st2contrib.git (branch: _master_).
12+
!pack install github,slack,trello
13+
bot: Installing the requested pack(s) for you.
14+
@my_user:
15+
> Successful deployment of *github*, *slack*, *trello* packs!
1616
17-
If you're adventurous and wish to install and help develop a pack that's
18-
currently in st2incubator you can install one with the following command:
17+
You can install a pack from any github repository just as easily: supply the full URL
18+
to the bot. Pack name is unnecessary, as it will be read from ``pack.yaml`` later:
1919

2020
.. code-block:: bash
2121
22-
! pack deploy st2incubator vsphere,debian
23-
Deploying the requested pack(s) from *st2incubator* for you
24-
@my_user: Successful deployment of *vsphere* *debian* !
25-
> from https://github.com/StackStorm/st2incubator.git (branch: _master_).
22+
!pack install https://github.com/stackstorm/openstack
23+
bot: Installing the requested pack(s) for you.
2624
27-
The command takes the following very simple format:
25+
You can even mix the two formats in one string:
2826

2927
.. code-block:: bash
30-
31-
! pack deploy {{repo_name}} {{packs}} {{branch=master}} - Download StackStorm packs via ChatOps
3228
33-
Deploying Custom packs via ChatOps
34-
----------------------------------
29+
!pack install github,slack,trello,https://github.com/stackstorm/openstack
3530
36-
The same commands can be used to install your own packs just by adding an entry to `/opt/stackstorm/packs/packs/config.yaml` in the following format:
31+
.. figure :: /_static/images/packs-chatops-install.png
32+
:align: center
3733
38-
.. code-block:: yaml
3934
40-
---
41-
repositories:
42-
NameOfRep:
43-
repo: "https://github.com/<my-GitHub-user>/my-st2.git"
44-
subtree: true
35+
Getting information about an installed pack
36+
-------------------------------------------
4537

46-
This will allow you to install a pack via:
38+
The ``!pack get <pack>`` command shows you information about an installed
39+
pack. There is two sections in the output: the first is pack metadata from
40+
``pack.yaml``, and the optional second is git information, if your pack has
41+
been installed from a git source like StackStorm Exchange or a single repo.
4742

48-
.. code-block:: bash
49-
50-
! pack deploy NameOfRep MyAwesomePack
51-
52-
If you don't have multiple packs within the same repository under a `packs` directory, just set `subtree` to `false` and issue the following command:
53-
54-
.. code-block:: bash
43+
Git status will tell you if there's a difference between your local pack version
44+
and the latest version in the origin repository, and also show the remotes
45+
for your pack.
5546

56-
! pack deploy NameOfRep NameOfRep
47+
If a pack is not installed, but available in StackStorm Exchange, the bot will
48+
gallantly offer to install it:
5749

58-
Automating Custom Pack Deployment
59-
---------------------------------
50+
.. figure :: /_static/images/packs-chatops-get.png
51+
:align: center
6052
61-
Building on the above it's possible to enable auto deployment for a single branch of a
62-
repository which has has `subtree` set to `false` by adding an `auto_deployment` section as shown below:
53+
Getting information about an available pack
54+
-------------------------------------------
6355

64-
.. code-block:: yaml
56+
The remote counterpart to ``pack get`` is ``pack show``: it will show an
57+
entry from the StackStorm Exchange, our pack directory, if a pack with the
58+
given name is available.
6559

66-
---
67-
repositories:
68-
my-st2:
69-
repo: "https://github.com/<my-GitHub-user>/my-st2.git"
70-
subtree: false
71-
auto_deployment:
72-
branch: "master"
73-
notify_channel: "my-chatops-channel"
60+
.. figure :: /_static/images/packs-chatops-show.png
61+
:align: center
7462
75-
Then you need a rule (or a sensor) that will trigger the `packs.deploy` action with the right
76-
parameters. The following is based on an post-commit hook from BitBucket Server:
63+
Searching for a pack
64+
--------------------
7765

78-
.. code-block:: yaml
66+
To search for a pack in StackStorm Exchange, use ``!pack search <query>``. Note that
67+
your query will match results in all pack parameters: for example, you can search for
68+
an author or a keyword, not just name and description. The results are ordered by
69+
relevance: if you search for "cloud", first you will get packs with "cloud" in their
70+
name—because they are the most likely to be what you were looking for—and then packs
71+
with "cloud" in keywords or description. And then packs authored by "Mr. Cloud", if
72+
any.
7973

80-
action:
81-
ref: "packs.deploy"
82-
parameters:
83-
auto_deploy: true
84-
repo_name: "{{trigger.body.repository.name}}"
85-
branch: "{{trigger.body.refChanges[0].refId}}"
86-
packs: [ "{{trigger.body.repository.name}}" ]
87-
message: "{{trigger.body.changesets.get('values')[0].toCommit.message}}"
88-
author: "{{trigger.body.changesets.get('values')[0].toCommit.author.name}}"
74+
**Pro-tip:** if you configure an additional pack index (see "Working with pack indexes" in :doc:`/packs`),
75+
it will be queried alongside StackStorm Exchange by commands like ``show`` or ``search``.
8976

77+
.. figure :: /_static/images/packs-chatops-search.png
78+
:align: center

0 commit comments

Comments
 (0)