indigo-dc / jenkins-pipeline-library

Jenkins pipeline library with common functionalities for CI/CD environments, mainly targeted for the implementation of the SQA baseline requirements from https://indigo-dc.github.io/sqa-baseline/
Apache License 2.0
11 stars 6 forks source link

Update command documentation for config.yml #66

Closed samuelbernardolip closed 3 years ago

samuelbernardolip commented 4 years ago

Must place a warning in config.yml documentation that commands run as independent processes. If a user needs to run a set of commands in same context he should create a script and pass it to command.

orviz commented 4 years ago

@samuelbernardolip we are running one docker-compose exec per command in the list: https://github.com/indigo-dc/jenkins-pipeline-library/blob/126d0c2792c8f7338429862de09bc986b0ca4ae4/src/eu/indigo/compose/DockerCompose.groovy#L165-L169

We might support the concatenation of the list of commands (e.g. with '&&' or ';') and run just one docker-compose exec, if this preserves the context. Hence, library users don't have to create ad-hoc scripts.

This functionality might be handy since most app building process entail multiple commands within the same shell context.

samuelbernardolip commented 4 years ago

@samuelbernardolip we are running one docker-compose exec per command in the list:

https://github.com/indigo-dc/jenkins-pipeline-library/blob/126d0c2792c8f7338429862de09bc986b0ca4ae4/src/eu/indigo/compose/DockerCompose.groovy#L165-L169

We might support the concatenation of the list of commands (e.g. with '&&' or ';') and run just one docker-compose exec, if this preserves the context. Hence, library users don't have to create ad-hoc scripts.

This functionality might be handy since most app building process entail multiple commands within the same shell context.

That is the issue I found with sqaaas-web tests... Command parameter for docker-compose exec can't be a string, but a sequence of strings splited by spaces, where the first is the command we want to run. I think that will not worth the effort to debug or find a solution for this. As I propose in this issue is better to the users place all required commands inside a script and pass after that the required arguments. This is a cleaner approach. This also keeps the pattern of using the supported tools such as tox or maven. Lets keep it simple and keep out unnecessary bugs.

samuelbernardolip commented 4 years ago

Also add to the note that all required white spaces for files or arguments must be escaped, so is possible to distinguish the docker-compose exec parameters.