saagie / gradle-saagie-dataops-plugin

Saagie Gradle Plugin for the new version (2.0) of Saagie Dataops Orchestrator
Apache License 2.0
2 stars 0 forks source link

Support Environment Variables - Export / Import #243

Open sgokaram-saagie opened 4 years ago

sgokaram-saagie commented 4 years ago

Export / Import (V2) and ExportV1 tasks should support ability to export environment variables and import them back.

Refer to https://github.com/saagie/gradle-saagie-dataops-plugin/wiki/projectsExport for details. Refer to https://github.com/saagie/gradle-saagie-dataops-plugin/wiki/projectsExportV1

ZouhairBear commented 4 years ago

How to test :

Version to test : 2.1.8

The Export phase:

Create a build file: Example of build.projectsExportV1.gradle:

plugins {
  id "io.saagie.gradle-saagie-dataops-plugin" version "2.1.8"
}
saagie {
    server {
        url = "REPLACE_SAAGIEURL"
        login = "REPLACE_SAAGIELOGIN"
    password = "REPLACE_SAAGIEPASSWORD"
        environment = "REPLACE_SAAGIE"
    jwt = true
    }
       env {
         include_all_var=<true|false>
         name = ['env_id1','env_id2']
     }
    exportArtifacts {
          export_file = "./job/export.zip" // <=== url "./job/" should exist  
          overwrite=true
      temporary_directory='./tmp'    // <=== temporary_directory ./tmp'  should exist        
    }
}

Export job using this commande : The command line : gradle -b build.projectsExportV1.gradle projectsExportV1

The import phase:

Create a new build file: Example : build.projectsImport.gradle:

plugins {
    id 'groovy'
    id 'io.saagie.gradle-saagie-dataops-plugin' version '2.1.8'
}

saagie {
    server {
        url = "REPLACE_SAAGIEURL"
        login = "REPLACE_SAAGIELOGIN"
    password = "REPLACE_SAAGIEPASSWORD"
        environment = "REPLACE_SAAGIE"
    jwt = true
        acceptSelfSigned = true
    }
    project {
        id = "REPLACE_SAAGIE_PROJECT_ID"
    }
     propertyOverride{
        scope= 'global'
        }
    importArtifacts {
        import_file = "./job/export.zip"
        temporary_directory='./tmp'
    }
}

Then use this command line: The command line : gradle -b build.projectsImport.gradle projectsImport