Skip to content
Snippets Groups Projects
Commit 5a66c40c authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update build env: use php 8.4.4; add build info

parent 9d3f06ec
No related branches found
No related tags found
No related merge requests found
...@@ -2,4 +2,4 @@ built_packages/ ...@@ -2,4 +2,4 @@ built_packages/
external/ external/
build build
src/include_checks.php src/include_checks.php
src/amcli.php.tmp src/amcli__build.php
...@@ -12,6 +12,8 @@ was ich so sehe ... ...@@ -12,6 +12,8 @@ was ich so sehe ...
⬜ Docker dev environment ⬜ Docker dev environment
⬜ IP Restriction
## Tests schreiben ## Tests schreiben
✅ Test auf gesetzte Metadaten ✅ Test auf gesetzte Metadaten
......
...@@ -40,8 +40,16 @@ if(file_exists($OUTFILE)){ ...@@ -40,8 +40,16 @@ if(file_exists($OUTFILE)){
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
_h1("Prepare source"); _h1("Prepare source");
$sBuildDate=date("Y-m-d H:i:s");
$sBuildPhpcode="\$AMCLI_BUILD_DATE=\"$sBuildDate\";";
$datefile=str_replace('.php', '__build.php', $INFILE);
file_put_contents(
$datefile, "<?php
// This file was generated by ".__FILE__."
$sBuildPhpcode"
);
$in=file_get_contents($INFILE); $in=file_get_contents($INFILE);
$inccode=file_get_contents($INCFILE); $inccode=$sBuildPhpcode . "\n". file_get_contents($INCFILE);
$inccode=str_replace("<?php", "", $inccode); $inccode=str_replace("<?php", "", $inccode);
$tempcode=preg_replace("#\/\/ ---MARK---INCLUDE-CHECKS---START---.*---MARK---INCLUDE-CHECKS---END#s", "$inccode", $in); $tempcode=preg_replace("#\/\/ ---MARK---INCLUDE-CHECKS---START---.*---MARK---INCLUDE-CHECKS---END#s", "$inccode", $in);
...@@ -68,11 +76,40 @@ _exec("$SPC \ ...@@ -68,11 +76,40 @@ _exec("$SPC \
_h1("Test generated binary"); _h1("Test generated binary");
_exec("file \"$OUTFILE\""); _exec("file \"$OUTFILE\"");
_exec("\"$OUTFILE\" --ini=../src/simple.ini"); _exec("\"$OUTFILE\" --ini=../tests/configs/metadata.ini");
_h1("Write architecture specific binary"); _h1("Write architecture specific binary");
_exec("cp \"$OUTFILE\" '$OUTFILE2'"); _exec("cp \"$OUTFILE\" '$OUTFILE2'");
_h1("Create readme");
$readme="{$OUTFILE2}__README.md";
$versionSPC=system("$SPC --version");
file_put_contents($readme,
"# Build infos
Date : $sBuildDate
OS : $myos
architecture: $myarchitecture
File : ".basename($OUTFILE2)."
## Versions
Used SPC : $versionSPC
PHP version : $php_version
PHP modules : $php_libs
## Conmands
Download : `$cmdSpcDownload`
Build : `$cmdSpcBuild`
see https://os-docs.iml.unibe.ch/appmonitor-cli-client/
");
echo "see $readme\n";
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
......
...@@ -8,7 +8,7 @@ $dirPackages="built_packages"; ...@@ -8,7 +8,7 @@ $dirPackages="built_packages";
// ---------- build with spc // ---------- build with spc
// php version for spc // php version for spc
$php_version="8.3"; $php_version="8.4.4";
// extensions - see https://static-php.dev/en/guide/extensions.html // extensions - see https://static-php.dev/en/guide/extensions.html
$php_libs="mysqli,openssl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,sockets"; $php_libs="mysqli,openssl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,sockets";
...@@ -38,3 +38,6 @@ switch ($myos) { ...@@ -38,3 +38,6 @@ switch ($myos) {
$myosextension=$myos=="windows" ? ".exe" : ""; $myosextension=$myos=="windows" ? ".exe" : "";
$SPC=str_replace('/', DIRECTORY_SEPARATOR , "$selfdir/$dirExternal/bin/spc$myosextension"); $SPC=str_replace('/', DIRECTORY_SEPARATOR , "$selfdir/$dirExternal/bin/spc$myosextension");
$cmdSpcDownload="$SPC download --no-interaction --with-php=$php_version --for-extensions \"$php_libs\"";
$cmdSpcBuild="$SPC build --no-interaction --build-micro \"$php_libs\"";
...@@ -171,10 +171,10 @@ if ($bDoBild){ ...@@ -171,10 +171,10 @@ if ($bDoBild){
_exec("$SPC --no-interaction doctor"); _exec("$SPC --no-interaction doctor");
echo "💡 Hint: this can take a minute on a fresh install ...\n"; echo "💡 Hint: this can take a minute on a fresh install ...\n";
_exec("$SPC download --no-interaction --with-php=$php_version --for-extensions \"$php_libs\""); _exec($cmdSpcDownload);
echo "💡 Hint: this can take 4 minutes on a fresh install or less on module changes ...\n"; echo "💡 Hint: this can take 4 minutes on a fresh install or less on module changes ...\n";
_exec("$SPC build --no-interaction --build-micro \"$php_libs\""); _exec($cmdSpcBuild);
file_put_contents("$doneBuild", date("Y-m-d H:i:s") . "\n$sDoneData\n"); file_put_contents("$doneBuild", date("Y-m-d H:i:s") . "\n$sDoneData\n");
} else { } else {
_skip("Micro already built - php $php_version - extensions \"$php_libs\""); _skip("Micro already built - php $php_version - extensions \"$php_libs\"");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment