feat: Having before_job definition

Hey,

Sometimes, when you are running the base image, you would like to have some commands to be executed on every job, for example, installing a package or updating a specific library, etc.

Adding the same commands over and over again will produce a lengthy workflow file.

Some services provide a section called before_script which should host all the commands we want to execute before each job.

Adding a before_job top section (same level with name/on/jobs) will help make the code less cluttered and more organized.

Same thing for services and container why we should repeat them within each job if all the jobs need them?

I am not saying that all jobs will have access to the same service/container. Instead, we are going to separate the repeated code, and each job will create its own service and attach it to the job or use the container to execute the commands.

Also with the ability to define services/container within the job which will then used instead of the general one defined at the top level.

1 Like

Thanks for the feedback! I’ve taken your suggestions and passed it along to the appropriate teams. Thanks again for reaching out :grinning:

1 Like