Open sgokaram-saagie opened 4 years ago
Can you share the build for this issue please
Steps to recreate issues
Select project that does not have any PROJECT scope variables defined in it.
Run the below plugins { id "io.saagie.gradle-saagie-dataops-plugin" version "2.1.4" }
saagie {
server {
url = saagieurl
login = saagieuserid
password = saagiepassword
environment = saagieplatformid
jwt = true
}
project {
id = saagieprojectid
}
env {
include_all_var = 'true'
scope = 'project'
}
exportArtifacts {
export_file = "./env/env.zip"
overwrite=true
temporary_directory='./tmp'
}
}
This gradle tasks errors with the below
saagies-mbp:Gradle shivakumar$ gradle -b build.gradle.projectExportEnvV2 projectExport
Task :projectsExport FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':projectsExport'.
jobs, pipelines and variables to be exported can t be empty at the same time
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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 3s 1 actionable task: 1 executed
How to test :
Version to test : 2.1.8
The error build case with warning message:
Case platform have no project scope env.
Create a build file:
Example of build.projectsExport.gradle
:
plugins {
id 'groovy'
id 'io.saagie.gradle-saagie-dataops-plugin' version '2.1.8'
}
saagie {
server {
url = saagieurl
login = saagieuserid
password = saagiepassword
environment = 4
jwt = true
acceptSelfSigned = true
}
project {
id = saagieprojectid
}
env {
include_all_var=true
scope = "project"
}
importArtifacts {
import_file = "./job/export.zip"
temporary_directory='./tmp'
}
}
Export job using this commande :
The command line : gradle -b build.projectsExport.gradle projectsExport
The successful case : The platform have one job requested in the build but have no project scope env.
Create a new build file: Example : build.projectsExport.gradle:
plugins {
id 'groovy'
id 'io.saagie.gradle-saagie-dataops-plugin' version '2.1.8'
}
saagie {
server {
url = saagieurl
login = saagieuserid
password = saagiepassword
environment = 4
jwt = true
acceptSelfSigned = true
}
job {
ids = ['19d89f9a-1175-4833-a0cb-7d5ab4a8fd34']
}
project {
id = saagieprojectid
}
env {
include_all_var=true
scope = "project"
}
}
Then use this command line:
The command line : gradle -b build.projectsImport.gradle projectsImport
Expected behvior
Warning message will be displayed in every case.
This is still misleading. saagies-mbp:Gradle shivakumar$ gradle -b build.gradle.projectExportEnvV2 projectExport
**> Task :projectsExport FAILED WARNING: No environment variable found on the targeted platform with scope project
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':projectsExport'.
jobs, pipelines and variables to be exported cannot be empty at the same time, and cannot generate zip file**
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 2s 1 actionable task: 1 executed
The out put has a failure which is correct but then there is additional statements like what went wrong and thats misleading. Why are we printing 2 contradicting statements.
Export enviroment variable of scope = project
with an existing job and without an existing pipline : test validated
Export enviroment variable of scope = project
without an existing job and an existing pipline: test validated
Trying to export all project environment variables from a project where none is defined then the task fails with a mis leading error message
saagies-mbp:Gradle shivakumar$ gradle -b build.gradle.projectExportEnvV2 projectExport
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':projectsExport'.
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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2s 1 actionable task: 1 executed
In the usecase of exporting all Global or Project level environment variables and if none is found then just print out a WARN statement that No variables found and do not create the zip file.
Also the message jobs, pipelines and variables to be exported can t be empty at the same time
What is this " can t " ? Gramatically wrong in ENGLISH, change this to cannot