Environment flags for deployment
If you've migrated recently to Frontastic-as-a-library, you might have some problems deploying to staging.
To prevent the deployment from failing, you'll need to specify some flags in your environment
file which will be detected on compiling a build. Once set, you can use these environment flags to set which checks can be ignored if any of these flags fail and the whole build won't fail.
To set these flags:
1. Go to your GitHub project folder and open your build.xml
file, then add the below lines to it:
<property file="${basedir}/environment" />
<property file="${basedir}/../environment" />
If you have multiple projects, you'll need to add the above lines to each project's
build.xml
file.
2. Go to your GitHub customer repository root folder and open the environment
file. Then add to environment flags and set to true
or false
. For example:
test_unit_fail_on_violation=true
test_feature_fail_on_violation=true
test_static_checkstyle_fail_on_violation=true
test_static_pmd_fail_on_violation=false
test_static_pdepend_fail_on_violation=true
test_static_phpstan_fail_on_violation=true
The build won't fail when you set any flags to
false
. You'll need to check manually if any rules are violated for every flag you set tofalse
.
Available flags
To stop the build if any integrated unit tests fail during deployment use:
test_unit_fail_on_violation
To stop the build if integrated feature tests fail during deployment use:
test_feature_fail_on_violation
To stop the build if any rules set by PHP Statistic Analysis Tool (PHPStan) fail during deployment use:
test_phpstan_fail_on_violation
See the PHPStan GitHub for more information.
To stop the build if coding conventions set by PHPCheckstyle are violated during deployment use:
test_checkstyle_fail_on_violation
See the PHPCheckstyle GitHub for more information.
To stop the build on a PHP Copy/Paste Detector (PHPCPD) violation use:
test_static_cpd_fail_on_violation
See the PHP Copy/Paste Detector GitHub for more information.
To stop the build if any of the checks set by PHP Mess Detector (PMD) fail use:
test_static_pmd_fail_on_violation
See the PHP Mess Detector websitefor more information.
To stop the build if any PHP depend checks fail for reusability, maintainability, and extensibility use:
test_static_pdepend_fail_on_violation
See the PHP Depend GitHub for more information.
Updated over 1 year ago