|
| 1 | +# Stackstorm-Nexus3 |
| 2 | + |
| 3 | +[Sontatype nexus3](https://www.sonatype.com/nexus-repository-oss) stackstorm pack |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +Install this pack with: `st2 pack install file://$PWD` |
| 8 | + |
| 9 | +Or if in remote repository: `st2 pack install https://github.com/MY/PACK` |
| 10 | + |
| 11 | +## Configuration |
| 12 | + |
| 13 | +Copy the example configuration in [nexus3.yaml.example](./nexus3.yaml.example) |
| 14 | +to `/opt/stackstorm/configs/nexus3.yaml` and edit as required. |
| 15 | + |
| 16 | +add nexus3 server connection profile: |
| 17 | + |
| 18 | +* ``url`` - URL of the nexus3 server (e.g. ``http://localhost:8081``) |
| 19 | +* ``user`` - username |
| 20 | +* ``password`` - Password |
| 21 | +* ``verify`` - https tls verify, only used if the `url` option specifies an `https` connection |
| 22 | + |
| 23 | +You can also add multiple profiles: |
| 24 | + |
| 25 | +When you add multiple profile, above parameters becomes defaults for any key missing in the profile. |
| 26 | + |
| 27 | +``` yaml |
| 28 | +--- |
| 29 | +url: "http://localhost:8081" |
| 30 | +user: "admin" |
| 31 | +password: "admin123" |
| 32 | +verify: True |
| 33 | +default_profile: "dev" # use this to make for missing config_profile parameter when calling any action |
| 34 | +profiles: |
| 35 | + "dev": |
| 36 | + url: "http://localhost:8081" |
| 37 | + user: "dev-user" |
| 38 | + password: "mypas" |
| 39 | + verify: True |
| 40 | + "dev-2": |
| 41 | + user: "dev2-user" |
| 42 | + password: "mypass2" |
| 43 | + # url : fallback to url: "http://localhost:8081" |
| 44 | + # verify: fallback to verify: True |
| 45 | +``` |
| 46 | + |
| 47 | +**Note** : When modifying the configuration in `/opt/stackstorm/configs/` please |
| 48 | + remember to tell StackStorm to load these new values by running |
| 49 | + `st2ctl reload --register-configs` |
| 50 | + |
| 51 | +## Actions |
| 52 | + |
| 53 | +While naming actions following convention is used: |
| 54 | + |
| 55 | + < VERB >_< RESOURCE(plural) > |
| 56 | + eg. |
| 57 | + list_repositories |
| 58 | + get_scripts |
| 59 | + |
| 60 | +Supported Resources |
| 61 | + |
| 62 | +* Repositories |
| 63 | +* Scripts |
| 64 | + |
| 65 | +### Available actions |
| 66 | + |
| 67 | +* **list_repositories** : List nexus3 repositories |
| 68 | +* **get_repositories** : get nexus3 repositories |
| 69 | +* **create_repositories** : create nexus3 repository |
| 70 | +* **delete_repositories** : delete nexus3 repository |
| 71 | + |
| 72 | +* **list_scripts** : List nexus3 scripts |
| 73 | +* **get_scripts** : get nexus3 scripts |
| 74 | +* **create_scripts** : create(& upload) if missing, groovy script |
| 75 | +* **delete_scripts** : delete nexus3 script |
| 76 | + |
| 77 | +## Policies |
| 78 | + |
| 79 | +* **http.retry** : Retry core.http action on timeout. |
| 80 | + |
| 81 | +## Aliases |
| 82 | + |
| 83 | +--NIL-- |
| 84 | + |
| 85 | +## Rules |
| 86 | + |
| 87 | +--NIL-- |
| 88 | + |
| 89 | +## Sensors |
| 90 | + |
| 91 | +--NIL-- |
| 92 | + |
| 93 | +## Testing |
| 94 | + |
| 95 | +While testing you can leverage [Makefile](./tests/Makefile) to ease writing and testing actions. Read the Makefile for the list of useful commands. |
| 96 | + |
| 97 | +## Contributing |
| 98 | + |
| 99 | +Before submitting make sure python linter is happy with your changes first |
| 100 | + |
| 101 | +``` bash |
| 102 | +pip install flake8 |
| 103 | + |
| 104 | +#executing flake8 ./ |
| 105 | +make -f tests/Makefile lint |
| 106 | +``` |
0 commit comments