Repository navigation
Description
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-buildsWhat do you think about this type of implementation ?
Activity
corpsee commentedon Mar 31, 2017
The idea is good and right, I also thought about this. But I see the implementation like this:
Tag is the rout to specific group of workers with selfown queue etc.
It seems to me that this will be a more universal option, which can be used not only for versions of PHP.
P.S.: I would also transfer the environment settings to the build config (.php-censor.yml).
@vinpel @ss-gxp What do you think about it?
vinpel commentedon Mar 31, 2017
yes fine, it will be important to have a full exemple with config to be clear about this feature
corpsee commentedon Mar 31, 2017
I will think about it seriously soon and try to add examples. I don't insist on my vision, I just propose to consider all variants before implementing such huge feature. Thanks for the idea and description, @vinpel!
@vinpel Is it just a proposal or are you planning to implement it by yourself?
ss-gxp commentedon Mar 31, 2017
I thought about it, but:
In accordance with this, it will not be possible to place information about the environments and their links to the branches in the repository.
As for the expansion of the configuration of the environment, I agree. Something like this
ss-gxp commentedon Mar 31, 2017
I probably did not quite understand, you're talking about the configuration dependent on the environment?
corpsee commentedon Mar 31, 2017
@ss-gxp I understood you about build config (.php-censor.yml).
About "configuration dependent on the environment", - No) I want to add different environment variables to the different environments (I didn't write about it in this topic) and routs to specific group of workers.
Environment variables may be useful for different databases in different environments (for example).