Open medamineziraoui opened 4 years ago
Release 2.1.2
How to test : Export variables:
plugins {
id 'groovy'
id 'io.saagie.gradle-saagie-dataops-plugin' version '2.1.2'
}
saagie {
server {
url = saagieurl
login = saagieuserid
password = saagiepassword
environment = 4
jwt = true
acceptSelfSigned = true
}
project {
id = saagieprojectid
}
env {
include_all_var = false // <==== should be true or false
scope = 'project' // <=== alternate between project | global
name = ['PROJECT_VAR', 'pro'] // <===== name should bot be empty if include_all_var is false
}
exportArtifacts {
export_file = "/path/to/exported/variable/export_variables.zip"
overwrite=true
}
}
Commande line :
gradle -b build.exportV2.gradle projectsExport
case scope
is global and include_all_var
is true :
case scope
is global and include_all_var
is false with names defined:
case scope
is project and ( include_all_var
is true and include_all_var
is false with names defined )
:
Import Variables :
plugins {
id 'groovy'
id 'io.saagie.gradle-saagie-dataops-plugin' version '2.1.2'
}
saagie {
server {
url = saagieurl
login = saagieuserid
password = saagiepassword
environment = saagieplatformid
jwt = true
acceptSelfSigned = true
}
project {
id = saagieprojectid
}
importArtifacts {
import_file = "/path/to/export/fileShouldExist/export_project_var.zip" // <==== switch between export_project_var and export_global_var_name for global var import and project var import
}
}
export_project_var
:
export_project_var.zip
export_global_var_name
:
export_global_var_name.zip
Commande line :
gradle -b build.import.gradle projectsImport
Should have successful build:
{status=success, job=[], pipeline=[], variable=[{id=id, name=PROJECT_VAR_FROM_TEST_2.1.2}, {id=id, name=pro_FROM_PROJECT_2.1.2}]}
BUILD SUCCESSFUL in 3s
Importing environment variable test for global scope:
Importing environment variable test for project scope: IMPORTANT NOTE: Those variables shouldn t exist on the server.
When using this build with this command line
gradle -b build.exportV2.gradle projectsExport
File name :
Build.exportV2.gradle
We get build failure :