Closed sgokaram-saagie closed 4 years ago
When exporting a pipeline from the v1 you must include _job because when importing the pipeline we search for the job name in the jobs property of the pipeline from the job list of the v2. and since we export pipeline from v1, the jobs that contains are from v1. so if we don t export them from v1, the import will not find them. i don t see a simple way to fix this.
So if thats not an option then why even ask , automatically make it true or do it. I dont see the point of the option, we should just remove it for v1 then.
Alright roger that :+1:
Duplication with #232
How to test :
Version to test : 2.0.28 We going to call this process Export/Import-job
The Export phase:
Create a build file:
Example of build.projectsExportV1.gradle
:
plugins {
id "io.saagie.gradle-saagie-dataops-plugin" version "2.0.28"
}
saagie {
server {
url = "REPLACE_SAAGIEURL"
login = "REPLACE_SAAGIELOGIN"
password = "REPLACE_SAAGIEPASSWORD"
environment = "REPLACE_SAAGIE"
jwt = true
}
pipeline {
ids = [ "484" ]
}
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 build file:
Example of build.projectsImport.gradle
:
plugins {
id 'groovy'
id 'io.saagie.gradle-saagie-dataops-plugin' version '2.0.28'
}
saagie {
server {
url = saagieurl
login = saagieuserid
password = saagiepassword
environment = saagieplatformid
jwt = true
acceptSelfSigned = true
}
project {
id = saagieProject
}
importArtifacts {
import_file = "./job/export.zip"
temporary_directory='/import/path/must/exist/tmp'
}
}
Import job using this commande :
The command line : gradle -b build.projectsImport.gradle projectsImport
You should get
> Task :projectsImport
{status=success, job=[{id=2779, name=ERP Data Cleansing}, {id=2778, name=Import ERP Data}, {id=9726, name=Build model (sales / ERP)}, {id=2777, name=Build new Model}], pipeline=[{id=484, name=Churn Update model}]}
BUILD SUCCESSFUL in 11s
1 actionable task: 1 executed
Exported a V1 pipeline - 484.
Tried to import this pipeline , but this failed with error
saagies-mbp:Gradle shivakumar$ gradle projectImportPipelineWithJobandVersion
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':projectImportPipelineWithJobandVersion'.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 37s 2 actionable tasks: 2 executed