symbiote / silverstripe-build
Phing build helpers for projects making use of the silverstripe-base installation process.
Installs: 23 539
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 8
Open Issues: 3
Type:silverstripe-module
Requires
- silverstripe/framework: ~4.0
Replaces
- silverstripe-australia/build: 5.3.0
- 5.3.0
- dev-master / 5.2.x-dev
- 5.2.10
- 5.2.9
- 5.2.8
- 5.2.7
- 5.2.6
- 5.2.5
- 5.2.4
- 5.2.3
- 5.2.2
- 5.2.1
- 5.2.0
- 5.1.0
- 5.0.0
- 4.4.x-dev
- 4.4.0
- 4.3.0
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.1
- 4.1.0
- 4.0.x-dev
- 4.0.1
- 4.0.0
- 3.4.x-dev
- 3.4.1
- 3.4.0
- 3.3.x-dev
- 3.3.0
- 3.2.x-dev
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.x-dev
- 3.1.5
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.2
- 3.0.1
- 3.0.0
- 2.1.x-dev
- 2.1.1
- 2.1.0
- 2.0.1
- 2.0.0
- 1.5.x-dev
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.x-dev
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.x-dev
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.x-dev
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.x-dev
- 1.1.1
- 1.1.0
- 1.0.x-dev
- 1.0.1
- 1.0.0
- dev-feature-package-ignore
- dev-nglasl-patch-2
- dev-nglasl-patch-1
- dev-feature-satis
- dev-feature-phpstan-target
- dev-version-bump
- dev-fix-removesqlite
This package is auto-updated.
Last update: 2024-11-29 04:58:03 UTC
README
- Phing
- php cli
- PEAR (with a version of phpunit supported by silverstripe)
Installation
- Edit scripts/build.xml and change the name attribute to
- Copy scripts/build.properties.sample to scripts/build.properties
- Edit build.properties and change the DB configuration and rewrite.base settings.
- Run
phing -f scripts/build.xml
to make sure everything installs - If you require additional modules, add them into the scripts/dependent-modules file, then run
phing -f scripts/build.xml update_modules
- Run
phing -f scripts/build.xml test
to make sure everything's working as expected
Phing targets
Commonly used targets
- build
- test
- package
Helpful for development:
pak
- builds a .sspak file at mysite/build/site.sspak . Useful for CIphpstan
- Runs PHPStan + PHPStan for SilverStripe if it's installed via Composer. Useful for static analysis of PHP code.- Define folders to scan by placing following in your build.xml file, underneath the
<project>
tag.<property name="phpstan.dir" value="mysite/src mysite/tests" />
- Define folders to scan by placing following in your build.xml file, underneath the
Composer scripts
If your themes use yarn based dependencies, you can add the following post-install scripts to be triggered by a composer call, which will ensure the node_modules are installed correctly
"scripts": {
"post-update-cmd": [
"Symbiote\\Build\\ThemeBuilder::run"
],
"post-install-cmd": [
"Symbiote\\Build\\ThemeBuilder::run"
]
},
Optional Scripts
There are three scripts that may optionally be used for your projects, and can be done using the following commands.
sh build/scripts/cache
This will clear out any project cache files (for all projects), and is basically the forced equivalent of doing a ?flush for everything in your site.
sh ~/path/to/permissions
This requires you to update the "{user}" and as such will need to be copied out to a location of your choice, and will apply the appropriate owner and permissions to both the cache and repository.
sh build/scripts/recursive-status
This will recursively trigger a "git status" on each module directory found within your repository, primarily so you check for changes that may have been made in a module that hasn't been included in the repository code base.
sh build/scripts/recursive-status assume-unchanged-listing
When you have patched files (resulting in them coming up as being modified during a recursive-status), you can git update-index --assume-unchanged {file_name}
, and use this script with a parameter. This will not only list out the files that have been assumed unchanged, but it will also force the files to reflect the upstream. This makes sure you don't have local changes that have been accidentally made, however it will also remove any patches that were put in place. Therefore, you can run this and then phing
to ensure the patches remain in place.
Excluding files from packages
Create a {root}/.pkgignore file with a set of paths to be excluded from built up package files
vendor/un-used/module/
themes/mytheme/node_modules/
mysite/cypress/