-
Hahn Axel (hahn) authoredHahn Axel (hahn) authored
Requirements
To update and test the command line tool you need
- git
- a local PHP8 cli.
Prepare environment
Get sources
In your personal development folder checkout the repsitory
cd <YOUR-PROJECTS>
git clone https://git-repo.iml.unibe.ch/iml-open-source/appmonitor-cli-client.git
cd appmonitor-cli-client
You get this initial structure:
.
├── build.php
├── examples
└── embed_example.php
├── inc_functions.php
├── inc_vars.php
├── installer.php
├── readme.md
└── src
└── amcli.php
Installer
Run the ./installer.php
to download apmonitor source and spc. It prepares the micro build and creates a merged php file of all appmonitor client checks.
The newly created files and dirs are:
.
├── build << working directory for builds
│
├── external
│ ├── appmonitor << cloned IML appmonitor project
│ └── bin
│ └── spc << downloaded spc binary
│
├── src
│ └── include_checks.php << merged appmonitor client checks
:
Build
To build the amcli binary start ./build.php
. First it merges src/amcli.php and src/include_checks.php to src/amcli.php**.tmp** which is used for the build command of spc.
Output directory is built_packages
.
After building the binary it executes it (with -V to show the version). If it is OK then it creates a copy with platform and architecture suffix.
Repeat?
You need to re-run install.php + build.php if
- there is a newer appmonitor client version
- you compile with a newer php version
- you change the set of included php modules.
The build.php (without install.php) needs to be executed if the src/amcli.php was changed.
Start over
Remove the dirs
- built_packages
- build
- external
... and this file
- src/include_checks.php
Then start ./installer.php
and ./build.php