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

Export / import variables environments #284

Closed medamineziraoui closed 4 years ago

medamineziraoui commented 4 years ago

Why ?

We would like to export new environment variables from v2 platform with the projectsExport. to then import to the same target environment with projectsImport task.

Links / Ressources

https://github.com/saagie/gradle-saagie-dataops-plugin/issues/285

Actual status / Investigations

We checked for the api call for export v2: Those are the ones we need Query for getting all scope GLOBAL:

query globalEnvironmentVariablesQuery {
  globalEnvironmentVariables {    
    id    name    scope   value    description   isPassword  
  }
}

Query for getting all scope PROJECT:

query environmentVariablesQuery($projectId: UUID!) {
  projectEnvironmentVariables(projectId: $projectId) {
    id   scope   name    value   description   isPassword  
    overriddenValues {      
      id      scope     value     description     isPassword     
    }    
  }
}

Mutation for adding environment variables: For scope GLOBAL creation: image (8)

For scope GLOBAL edition:

image (9)

For scope PROJECT creation:

image (10)

For scope PROJECT edition:

image (11)

How?

Our work will be devided in two main part Export V2 and Import V2.

First part Export V2 :

OverridenValues Class

### Second part Import: