Help Creating Packs

packs
(Hnanchahal) #1

I am trying to follow the documentation to create packs. I have all the files configured under stackstorm_automation folder.

The problem i am having is after i update the contents, it still loads the old pack.

vagrant@stackstorm:~/stackstorm-automation$ sudo st2 pack install file:///$PWD

[ succeeded ] download pack
[ succeeded ] make a prerun
[ succeeded ] install pack dependencies
[ succeeded ] register pack

±------------±-------------------------------------------------------------+
| Property | Value |
±------------±-------------------------------------------------------------+
| name | SRE Automation |
| description | Simple pack containing examples of sensor, rule, and action. |
| version | 0.1.0 |
| author | xxxxxxxxx

I updated the sensor and pack.yaml to


ref: sre_automation

name: automation

description: Simple pack containing examples of sensor, rule, and action.

keywords:

  • automation

  • sre

version: 0.1.1

author:

Then i uninstalled the pack but when i run the install from $PWD i still see the old version getting installed.

(Lindsay Hill) #2

Make sure you’ve committed your changes. When installing from a repo, it will install the last commit by default. So if you have changes that are not committed, they won’t be picked up.

(Hnanchahal) #3

Thanks that worked. Thought this would not be need if installing from a local directory.

(Lindsay Hill) #4

From the perspective of the pack install action, it’s just another path to a git repo - same as if you gave it http://. It doesn’t really know it’s a local folder.

If you’re doing pack development, you can just directly edit the content at /opt/stackstorm/packs/<pack> and re-register it with st2ctl reload. If you’re using that registration process (as opposed to st2 pack install), then it will use the content on disk.