I want to be able to test my commit against 2 differents PHP configuration.
For me you need to :
- inform php-censor about available php configuration
- define php configuration to be tested agains in .php-censor.yml config
- setup cron/worker to response to the correct PHP configuration
i propose a new variable "php_tags", it can be different version, différent plugin version ...
Change in YAMLs config file
The path of the php executable is not defined because the worker can be in another server, less dependance.
file : config.yaml
php-censor:
language: en
per_page: 10
php_tags:
- php56
- php70
worker:
host: 169.137.666.3
queue: php-censor-queue
In each project config file you set the list of tag to be build agains, it can be non set to keep backward compatibility
file : .php-censor.yaml
build_settings:
verbose: true
prefer_symlink: false
allowed_warnings: 2
php_tags:
- php56
- php70
(can be added in the new environment section too (?) )
if tags not defined in the general config, make an error for the whole build before make beanstalkd queue.
So in our config we need to manage 3 build with different envirnoment :
- one who will respond to php56 tag only
- one who will respond to php70 tag only
- one who will respond to build without tag
Builds with beanstalkd
in the previous exemple we can make worker search build for queue name like :
"php-censor-queue-%php_tags%"
[program:worker-php56]
startsecs = 0
command=/usr/bin/php56 /data/htdocs/php-censor/bin/console php-censor:worker php56
process_name=%(program_name)s_%(process_num)02d
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
user=apache
autostart=true
autorestart=true
environment=HOME="/data/htdocs/php-censor",USER="apache"
numprocs=1
startsecs=10
[program:worker-php70]
startsecs = 0
command=/usr/bin/php70 /data/htdocs/php-censor/bin/console php-censor:worker php70
process_name=%(program_name)s_%(process_num)02d
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
user=apache
autostart=true
autorestart=true
environment=HOME="/data/htdocs/php-censor",USER="apache"
numprocs=1
startsecs=10
[program:worker]
startsecs = 0
command=/data/htdocs/php-censor/bin/console php-censor:worker
process_name=%(program_name)s_%(process_num)02d
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
user=apache
autostart=true
autorestart=true
environment=HOME="/data/htdocs/php-censor",USER="apache"
numprocs=1
startsecs=10
Builds with cron
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
* * * * * /path/to/php56 /path/to/php-censor/bin/console php-censor:run-builds php56
* * * * * /path/to/php56 /path/to/php-censor/bin/console php-censor:run-builds php70
* * * * * /path/to/php-censor/bin/console php-censor:run-builds
What do you think about this type of implementation ?
I want to be able to test my commit against 2 differents PHP configuration.
For me you need to :
i propose a new variable "php_tags", it can be different version, différent plugin version ...
Change in YAMLs config file
The path of the php executable is not defined because the worker can be in another server, less dependance.
file : config.yaml
In each project config file you set the list of tag to be build agains, it can be non set to keep backward compatibility
file : .php-censor.yaml
(can be added in the new environment section too (?) )
if tags not defined in the general config, make an error for the whole build before make beanstalkd queue.
So in our config we need to manage 3 build with different envirnoment :
Builds with beanstalkd
in the previous exemple we can make worker search build for queue name like :
"php-censor-queue-%php_tags%"
Builds with cron
What do you think about this type of implementation ?