Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Project Export / Import #244

Open
sgokaram-saagie opened this issue Jun 30, 2020 · 2 comments
Open

Support Project Export / Import #244

sgokaram-saagie opened this issue Jun 30, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@sgokaram-saagie
Copy link
Contributor

Support Ability to export all the artifacts of the project and import them into the target platform. This is not intended to create a new project but just the artifacts inside the project.

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

@sgokaram-saagie sgokaram-saagie added the enhancement New feature or request label Jun 30, 2020
@sgokaram-saagie sgokaram-saagie added this to the 2.1 milestone Jul 20, 2020
@sgokaram-saagie sgokaram-saagie modified the milestones: 2.1, 2.3 Jul 23, 2020
@ZouhairBear ZouhairBear mentioned this issue Sep 7, 2020
8 tasks
@medamineziraoui
Copy link
Contributor

medamineziraoui commented Sep 10, 2020

How to test:

Version to test: 2.1.10

The Export phase:

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

plugins {
  id "io.saagie.gradle-saagie-dataops-plugin" version "2.1.10"
}
saagie {
    server {
        url = "REPLACE_SAAGIEURL"
        login = "REPLACE_SAAGIELOGIN"
	password = "REPLACE_SAAGIEPASSWORD"
        environment = "REPLACE_SAAGIE"
	jwt = true
    }
    project {
        id = "REPLACE_SAAGIE_PROJECT_ID"
        include_all_artifacts = true
    }

    exportArtifacts {
          export_file = "./job/bash.zip" // <=== url "./job/" should exist  
          overwrite=true  // <=== temporary_directory ./tmp'  should exist        
    }
}

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

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.4'
}

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

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

Expected behavior

> Task :projectsImport
{status=success, job=[{id=job_id_v2, name=bash job name}], pipeline=[]}

BUILD SUCCESSFUL in 5s
1 actionable task: 1 executed

@medamineziraoui
Copy link
Contributor

medamineziraoui commented Sep 10, 2020

Pretest data:

Source project : *Project test v1 to v2

id : 6d8168ba-0d16-41da-b5cf-964eb9c3581d
Status: Contains 28 jobs 1 pipeline and 40 variables of scope project
image

Target project : Project test to export all artifacts

id : 535faac7-a705-4a02-b5bd-1be21e494452
Status: project empty
image

After that we used the export script above with the include_all_artifacts = true property
image

Result: Export successful

image

After that we used the import script from above:

image

Result: Import successful

image

Target project : Project test to export all artifacts after import

id : 535faac7-a705-4a02-b5bd-1be21e494452
Status: Contains 28 jobs 1 pipeline and 40 variables of scope project

all_artifact_impot_success

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants