Skip to main content

Pre Deployment Jobs

This feature is intended for jobs that must be executed before the deployment of an application or service and that need to be added to the CI/CD process.

For example: You need to create a record in MongoDB with a Python script that your application should use later on.

INFO

The pre jobs will be executed prior to the deployment of all applications in all the environments that have been selected in the #Environments section

1. To enable the functionality, you must add the following feature flag to your pipeline file and set it to true:

a. In the main branch you will edit the YAML file named .github/workflows/github-ci.yaml

b. In the github-ci.yaml file search for the Features section, you will find it like this:


## Features -------------------------------------------------------------------------------------#

c. Bellow the section title, add the following configuration and change the values as you need:

# Pre-deploy Jobs
pre_jobs_enabled: 'true'
pre_jobs_blocker: 'true'

5. In the application repository you'll need to genereate the following folders structure:

prejobs

  • The pre-jobs directory (which will be located in the repository root) will contain one folder for each job you want to run and inside each folder a Dockerfile with the code you want to run.
ATENTION

If running the list of pre jobs any of these fails this step will fail and in case there are any subsequent jobs pending they will not be executed.