Skip to content

saagie/saagie_cicd_tool

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Saagie DataOps Platform CI/CD GitHub Action

This GitHub Action is designed to streamline the CI/CD process for the Saagie Platform. It provides a set of customizable options to enhance your jobs and pipelines on the Saagie platform.

Usage

Before you begin:

  • You must have a Saagie account with at least editor rights to the platform(s). For more information on access rights, see About Groups Page.
  • You must have at least one project on your Saagie platform(s). For more information on how to create projects, see Creating Projects.
  1. Create the following environment variables:

    • SAAGIE_URL: This is the URL of your Saagie platform.
    • SAAGIE_USER: This is the username of your Saagie account.
    • SAAGIE_PWD: This is the password of your Saagie account.
    • SAAGIE_REALM: This is the DNS prefix determined when Saagie was installed. The Realm allows you to connect to your Saagie platform.

    They will be used to make the connection with your Saagie platform. For more information on how to create environment variables, you can see:

    Environment Documentation Link
    GitHub Creating configuration variables for a repository.
    📝 Note: If you have password type variables, you must create them as secrets.
    Linux Environment Variables
    Windows Create and Modify Environment Variables on Windows
    Mac Use environment variables in Terminal on Mac
  2. Import the cicd_saagie_tool folder in your work directory, which includes the __main__.py, requirements.txt, and utils.py files.

  3. Create a GitHub Action workflow file in your repository. For more information, see the GitHub documentation for Using workflows.

  4. Add the following step to your workflow file:

    name: Saagie CICD
    
    on:
      push:
        branches:
          - main
    
    jobs:
      saagie-cicd:
        runs-on: ubuntu-latest
        steps:
          - name: Checkout Repository
            uses: actions/checkout@v2
    
          - name: Saagie CICD Action
            uses: saagie/saagie_cicd_tool@<release-tag>
            with:
              action: 'update'  # Available values: package_job, update_job, update_pipeline, update. Default: update
              saagie_url: ${{ secrets.SAAGIE_URL }}
              saagie_user: ${{ secrets.SAAGIE_USER }}
              saagie_pwd: ${{ secrets.SAAGIE_PASSWORD }}
              saagie_realm: ${{ secrets.SAAGIE_REALM }}
              saagie_env: 'dev' # Environment to connect to the Saagie Platform. It should be the same as the one in the env config files.
              job_config_folder: 'saagie/jobs/*.json'  # Folder where job config files are stored
              pipeline_config_folder: 'saagie/pipelines/*.json'  # Folder where pipeline config files are stored
              env_config_folder: './saagie/envs/*.json'  # Folder where env config files are stored
              job_source_folder: './code/jobs/*/*'  # Folder where job source code files are stored
              pipeline_source_folder: './code/pipelines/*.yaml'  # Folder where pipeline source code files are stored
              artefact_code_folder: './dist/*/*'  # Folder where artefact code files are stored

    Where the path to configuration and code files can be replaced with your own value.

    📝 Note: When using the package_job action, the zip file will be stored in the {artefact_code_folder}/{job_name} folder. The name of the zip file will be {job_name}.zip.

  5. Make sure you have the required configuration and code files for each Saagie platform, job, and pipeline. For more information, see our template repository.

    📝 Note: The configuration files are stored in the saagie directory. The code files are stored in the code directory.

    📝 Note: For more information on the set up process, see CI/CD With Saagie Python API.

Inputs

Inputs Description
action
(optional)
What you want to do on your Saagie platform.
The available values are: package_job, update_job, update_pipeline, update.
The default value is: update.
saagie_url
(optional)
The URL of your Saagie platform.
saagie_user
(optional)
The username of your Saagie account.
saagie_pwd
(optional)
The password of your Saagie account.
saagie_realm
(optional)
The DNS prefix determined when Saagie was installed. The Realm allows you to connect to your Saagie platform.
saagie_env
(optional)
The Saagie platform you want to connect to.
Example: dev, prod, preprod, etc.
debug_mode
(optional)
Debug mode. It is deactivated by default.
Set something other than ' ' to enable the debug mode.
job_config_folder
(optional)
The folder where the job configuration files are stored.
The default location is: 'saagie/jobs/*.json'.
pipeline_config_folder
(optional)
The folder where the pipeline configuration files are stored.
The default location is: 'saagie/pipelines/*.json'.
env_config_folder
(optional)
The folder where the environment configuration files are stored.
The default location is: './saagie/envs/*.json'.
job_source_folder
(optional)
The folder where the job source code files are stored.
The default location is: './code/jobs/*/*'.
pipeline_source_folder
(optional)
The folder where the pipeline source code files are stored.
The default location is: './code/pipelines/*.yaml'.
artefact_code_folder
(optional)
The folder where the artefact code files are stored.
The default location is: './dist/*/*'.

Example

with:
  action: 'update'
  saagie_url: ${{ secrets.SAAGIE_URL }}
  saagie_user: ${{ secrets.SAAGIE_USER }}
  saagie_pwd: ${{ secrets.SAAGIE_PASSWORD }}
  saagie_realm: ${{ secrets.SAAGIE_REALM }}
  saagie_env: dev
  job_config_folder: 'saagie/jobs/*.json'
  pipeline_config_folder: 'saagie/pipelines/*.json'
  env_config_folder: './saagie/envs/*.json'
  job_source_folder: './code/jobs/*/*'
  pipeline_source_folder: './code/pipelines/*.yaml'
  artefact_code_folder: './dist/*/*'

Compatibility with your Saagie platform

Saagie platform version saagie_cicd_tool release
>= 2023.03 =v0.0.1
>= 2024.01 =v0.0.2
>= 2024.02 =v0.0.3

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages