File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,11 @@ The JSON string should represent an object with the following information:
39
39
"command" : " command to run to perform the check (empty in case you dont want to excecute any command)" ,
40
40
"additional_composer_arguments" : [
41
41
" arguments which will be passed to `composer install` or `composer update`, passed as a list or as a list; e.g. --no-scripts"
42
+ ],
43
+ "gatekeeper_commands" : [
44
+ " tool configuration linting" ,
45
+ " tool specific setting overrides" ,
46
+ " specific composer dependency to be installed prior executing command"
42
47
]
43
48
}
44
49
```
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
set -e
4
+ set -o pipefail
4
5
5
6
function help {
6
7
echo " $0 <JSON>"
@@ -14,6 +15,7 @@ function help {
14
15
echo " - dependencies: the dependency set to run against (lowest, latest, locked)"
15
16
echo " - ignore_php_platform_requirement: flag to enable/disable the PHP platform requirement when executing composer \` install\` or \` update\` "
16
17
echo " - additional_composer_arguments: a list of composer arguments to be added when \` install\` or \` update\` is called."
18
+ echo " - gatekeeper_commands: a list of commands to run prior the real command"
17
19
echo " "
18
20
}
19
21
@@ -138,6 +140,8 @@ if [[ "${PHP}" == "" ]];then
138
140
exit 1
139
141
fi
140
142
143
+ readarray -t GATEKEEPER_COMMANDS=$( echo " ${JOB} " | jq -rc ' (.gatekeeper_commands // [])[]' )
144
+
141
145
echo " Marking PHP ${PHP} as configured default"
142
146
update-alternatives --quiet --set php " /usr/bin/php${PHP} "
143
147
update-alternatives --quiet --set php-config " /usr/bin/php-config${PHP} "
@@ -216,6 +220,11 @@ if [ -x ".laminas-ci/pre-run.sh" ];then
216
220
./.laminas-ci/pre-run.sh testuser " ${PWD} " " ${JOB} "
217
221
fi
218
222
223
+ # Execute gatekeeper commands before executing the CI command
224
+ for GATEKEEPER_COMMAND in " ${GATEKEEPER_COMMANDS[@]} " ; do
225
+ sudo --preserve-env --set-home -u testuser /bin/bash -c " ${GATEKEEPER_COMMAND} "
226
+ done
227
+
219
228
# Disable exit-on-non-zero flag so we can run post-commands
220
229
set +e
221
230
You can’t perform that action at this time.
0 commit comments