Skip to content

Commit adbd233

Browse files
committed
feat: add pre-install script execution
Signed-off-by: Maximilian Bösing <[email protected]>
1 parent 3653e6f commit adbd233

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,20 @@ jobs:
6565
Some packages may require additional setup steps: setting up a web server to test an HTTP client, seeding a database or cache service, etc.
6666
Other times, you may want to do additional reporting, particularly if the QA command failed.
6767
68-
To enable this, you may create one or both of the following files in your package:
68+
To enable this, you may create one or more of the following files in your package:
6969
70-
- `.laminas-ci/pre-run.sh`
70+
- `.laminas-ci/pre-install.sh`
71+
- `.laminas-ci/pre-run.sh`
7172
- `.laminas-ci/post-run.sh`
7273

7374
(Note: the files MUST be executable to be consumed!)
7475

76+
These runs immediately before any other command is being executed in this action.
77+
The `.laminas-ci/pre-install.sh` command will receive the following arguments:
78+
- `$1`: the user the QA command will run under
79+
- `$2`: the WORKDIR path
80+
- `$3`: the `$JOB` passed to the entrypoint (see above)
81+
7582
These run immediately before and after the QA command, respectively.
7683
The `.laminas-ci/pre-run.sh` command will receive the following arguments:
7784

entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ fi
157157
echo "Marking PHP ${PHP} as configured default"
158158
update-alternatives --set php /usr/bin/php${PHP}
159159

160+
# Is there a pre-install script available?
161+
if [ -x ".laminas-ci/pre-install.sh" ];then
162+
echo "Executing pre-install commands from .laminas-ci/pre-install.sh"
163+
./.laminas-ci/pre-install.sh testuser "${PWD}" "${JOB}"
164+
fi
165+
160166
echo "PHP version: $(php --version)"
161167
echo "Installed extensions:"
162168
php -m

0 commit comments

Comments
 (0)