gitlab CI/CD pipeline cannot run php spark - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: gitlab CI/CD pipeline cannot run php spark (/showthread.php?tid=77284) |
gitlab CI/CD pipeline cannot run php spark - adty - 08-11-2020 i'm implementing gitlab CI/CD pipeline in my CI4 project. running PHP Code: php spark migrate in gitlab CI/CD script get this error Code: CodeIgniter CLI Tool - Version 4.0.4 - Server-Time: 2020-08-11 16:49:30pm I don't get error when execute migration on live server. is it bug? please help... thanks. RE: gitlab CI/CD pipeline cannot run php spark - adty - 08-11-2020 Found the problem in CodeIgniter.php file, detectEnvironment() function. PHP Code: protected function detectEnvironment() When we run under CI server, we will always get ENVIRONMENT = testing. Testing environment can't get clirequest in getRequestObject() function if we run it in cli. PHP Code: protected function getRequestObject() It means we dont have flexibility to change/use custom ENVIRONMENT in CI/CD server. Can i request to remove the code that always set ENVIRONMENT = testing in CI/CD server? or request to allow testing environment to get/use clirequest? RE: gitlab CI/CD pipeline cannot run php spark - InsiteFX - 08-12-2020 You can set the environment in the env file. Code: #-------------------------------------------------------------------- You can also set it in the root .htaccess file. Code: #SetEnv CI_ENVIRONMENT 'production' Worse case add the environment to the spark file. RE: gitlab CI/CD pipeline cannot run php spark - adty - 08-18-2020 My work around right now is by ignoring environment (start with an empty environment) PHP Code: env -i php spark migrate -n App I'm still digging to find a better way (08-12-2020, 05:03 AM)InsiteFX Wrote: You can set the environment in the env file. Changing environment in .env file doesnt work for me. I'll try the .htaccess approach RE: gitlab CI/CD pipeline cannot run php spark - janiscp - 01-03-2021 (08-18-2020, 08:01 PM)adty Wrote: My work around right now is by ignoring environment (start with an empty environment) Thank you for this! |