Using the CI/CD
Use CI/CD With GitHub Actions
Make sure you meet the requirements.
-
Open your preferred IDE, link it to Git, and clone the GitHub repository you have configured for this.
-
Make changes in your project. You can create or modify jobs and pipelines in your project. For more information on how to collaborate on projects, see GitHub flow.
You can use the Code tab of the pipeline Edit mode to retrieve your pipeline code. You can copy, import, and export your code from this tab. This can help you write your pipeline code faster and save time. For more information on the Code tab, see Upgrading Pipelines.
-
Trigger your GitHub Actions workflows with events.
This will run your workflow file and trigger the actions defined in it. Your changes will be pushed in your Saagie platform.When you push a job or a pipeline via the CI/CD, a link to the source code is added to your Saagie interface. Note that you cannot edit this link by hand.
-
For jobs, the link to the source code is added to the package of the job, on the Overview page.
Figure 1. Link to the source code generated by CI/CD on a job.If you change your job package via the Saagie platform, the link to the source code is removed as it is no longer relevant. However, the link remains accessible from the corresponding version of your job.
-
For pipelines, the link to the source code is added to the pipeline’s graph, on the Overview page.
Figure 2. Link to the source code generated by CI/CD on a pipeline.If you create a new version of your pipeline via the Saagie platform, the link to the source code is removed as it is no longer relevant. However, the link remains accessible from the corresponding version of your pipeline.
-
Use CI/CD With Command Lines
Make sure you meet the requirements.
-
Install Python
3.8
or higher from your command prompt with the following command line:apt-get install python3.8 +
-
Download the version of Python you need.
-
Install it.
-
-
Install all the libraries listed in the
requirements.txt
file from your command prompt with the following command line:pip install -r requirements.txt
-
In your command prompt, you can manage Saagie jobs and pipelines using the following command lines:
-
Manage a Job
To package a job, run the following command:
python cicd_saagie_tool/__main__.py --action package_job --job_name your_job_name
Where
your_job_name
must be replaced with the name of the job that you want to package.- For Windows
-
To update a job on a Windows environment, run the following command:
python cicd_saagie_tool/__main__.py --action update_job --job_name your_job_name --saagie_url %SAAGIE_URL% --saagie_user %SAAGIE_USER% --saagie_pwd %SAAGIE_PWD% --saagie_realm %SAAGIE_REALM% --saagie_env your_env_name
- For Linux
-
To update a job on a Linux environment, run the following command:
python cicd_saagie_tool/__main__.py --action update_job --job_name your_job_name --saagie_url $SAAGIE_URL --saagie_user $SAAGIE_USER --saagie_pwd $SAAGIE_PWD --saagie_realm $SAAGIE_REALM --saagie_env your_env_name
Where, for both:
-
your_job_name
must be replaced with the name of the job that you want to update. -
your_env_name
must be replaced with the name of your Saagie platform.
- For Windows
-
To run a job on a Windows environment, run the following command:
python cicd_saagie_tool/__main__.py --action run_job --job_name your_job_name --saagie_url %SAAGIE_URL% --saagie_user %SAAGIE_USER% --saagie_pwd %SAAGIE_PWD% --saagie_realm %SAAGIE_REALM% --saagie_env your_env_name
- For Linux
-
To run a job on a Linux environment, run the following command:
python cicd_saagie_tool/__main__.py --action run_job --job_name your_job_name --saagie_url $SAAGIE_URL --saagie_user $SAAGIE_USER --saagie_pwd $SAAGIE_PWD --saagie_realm $SAAGIE_REALM --saagie_env your_env_name
Where, for both:
-
your_job_name
must be replaced with the name of the job that you want to run. -
your_env_name
must be replaced with the name of your Saagie platform.
-
Manage a Pipeline
- For Windows
-
To update a pipeline on a Windows environment, run the following command:
python cicd_saagie_tool/__main__.py --action update_pipeline --pipeline_name your_pipeline_name --saagie_url %SAAGIE_URL% --saagie_user %SAAGIE_USER% --saagie_pwd %SAAGIE_PWD% --saagie_realm %SAAGIE_REALM% --saagie_env your_env_name
- For Linux
-
To update a pipeline on a Linux environment, run the following command:
python cicd_saagie_tool/__main__.py --action update_pipeline --pipeline_name your_pipeline_name --saagie_url $SAAGIE_URL --saagie_user $SAAGIE_USER --saagie_pwd $SAAGIE_PWD --saagie_realm $SAAGIE_REALM --saagie_env your_env_name
Where, for both:
-
your_pipeline_name
must be replaced with the name of the pipeline that you want to update. -
your_env_name
must be replaced with the name of your Saagie platform.
- For Windows
-
To run a pipeline on a Windows environment, run the following command:
python cicd_saagie_tool/__main__.py --action run_pipeline --pipeline_name your_pipeline_name --saagie_url %SAAGIE_URL% --saagie_user %SAAGIE_USER% --saagie_pwd %SAAGIE_PWD% --saagie_realm %SAAGIE_REALM% --saagie_env your_env_name
- For Linux
-
To run a pipeline on a Linux environment, run the following command:
python cicd_saagie_tool/__main__.py --action run_pipeline --pipeline_name your_pipeline_name --saagie_url $SAAGIE_URL --saagie_user $SAAGIE_USER --saagie_pwd $SAAGIE_PWD --saagie_realm $SAAGIE_REALM --saagie_env your_env_name
Where, for both:
-
your_pipeline_name
must be replaced with the name of the pipeline that you want to run. -
your_env_name
must be replaced with the name of your Saagie platform.
-