|
1 | | -# PHPIPAM Action |
| 1 | +# phpIPAM Action |
2 | 2 |
|
3 | 3 | [](https://github.com/codeaffen/phpipam-action/actions/workflows/main.yml) |
4 | 4 | [](https://www.codacy.com/gh/codeaffen/phpipam-action/dashboard?utm_source=github.com&utm_medium=referral&utm_content=codeaffen/phpipam-action&utm_campaign=Badge_Grade) |
5 | 5 |
|
6 | | -This action Spin up a PHPIPAM instance for api testing purpose in github workflows. |
| 6 | +This action start a complete phpIPAM instance for api testing purpose in github workflows. \ |
| 7 | +In detail the action start two containers: |
7 | 8 |
|
8 | | -## Inputs |
| 9 | +* a mariadb container with a phpipam database |
| 10 | +* a phpipam container with a phpipam installation |
9 | 11 |
|
10 | | -**note** Input parameters are not used yet in our action. They are for future use. We need to work on that feature. |
| 12 | +After that the action does a few things to prepare the phpipam installation: |
11 | 13 |
|
12 | | -### `ipam_database_host` |
| 14 | +* populate the database with a default data |
| 15 | +* activate the api |
| 16 | +* create a app for api connection |
| 17 | +* set required password change for defaut admin to _no_ - this is for local testing purposes |
13 | 18 |
|
14 | | -**optional** Database host phpipam connects to. Default: "database" |
| 19 | +## Parameters |
15 | 20 |
|
16 | | -### `ipam_database_user` |
| 21 | +--- |
| 22 | +**Note:** |
17 | 23 |
|
18 | | -**optional** Database user phpipam needs to authenticate. Default: "phpipam" |
| 24 | +There are several parameters defined in readme. These parameters were currently not used but they are here for future use. |
19 | 25 |
|
20 | | -### `ipam_database_pass` |
| 26 | +--- |
21 | 27 |
|
22 | | -**optional** Database password phpipam needs to authenticate Default: "phpipam" |
| 28 | +The parameters are prepared as follows: |
23 | 29 |
|
24 | | -### `ipam_database_name` |
| 30 | +* **ipam_database_host**: Database host phpipam connects to. Default: "database" |
| 31 | +* **ipam_database_user**: Database user phpipam needs to authenticate. Default: "phpipam" |
| 32 | +* **ipam_database_pass**: Database password phpipam needs to authenticate. Default: "phpipam" |
| 33 | +* **ipam_database_name**: Database name phpipam uses. Default: "phpipam" |
| 34 | +* **database_root_password**: Root password for the database. Default: "root" |
25 | 35 |
|
26 | | -**optional** Database name phpipam uses. Default: "phpipam" |
| 36 | +## Usage |
27 | 37 |
|
28 | | -### `database_root_password` |
| 38 | +The action is hosted in a separate repository and available on [github marketplace](https://github.com/marketplace/actions/phpipam-action){:target="_blank"}. To use it you have to add the following to your github workflow: |
29 | 39 |
|
30 | | -**optional** Root password for the database. Default: "root" |
31 | | - |
32 | | -## Example usage |
33 | | - |
34 | | -```yaml |
| 40 | +~~~yaml |
35 | 41 | steps: |
36 | 42 | - uses: actions/checkout@v2 |
37 | 43 | - uses: codeaffen/phpipam-action@v1 |
38 | | - with: |
39 | | - ipam_database_host: 'database' |
40 | | - ipam_database_user: 'phpipam' |
41 | | - ipam_database_pass: 'phpipamadmin' |
42 | | - ipam_database_name: 'phpipam' |
43 | | - database_root_password: 'rootpw' |
44 | | -``` |
| 44 | +~~~ |
| 45 | + |
| 46 | +If the action finishes successfully you will be able to run your api tests against the phpipam installation. |
| 47 | + |
| 48 | +~~~yaml |
| 49 | +- name: "Test phpipam api" |
| 50 | + run: | |
| 51 | + curl -k --user Admin:ipamadmin -X POST https://localhost/api/ansible/user/ |
| 52 | +~~~ |
0 commit comments