diff --git a/aip-console-tools-cli/src/main/java/com/castsoftware/aip/console/tools/commands/AnalyzeCommand.java b/aip-console-tools-cli/src/main/java/com/castsoftware/aip/console/tools/commands/AnalyzeCommand.java index b3a2b4c5..5d2c9c79 100644 --- a/aip-console-tools-cli/src/main/java/com/castsoftware/aip/console/tools/commands/AnalyzeCommand.java +++ b/aip-console-tools-cli/src/main/java/com/castsoftware/aip/console/tools/commands/AnalyzeCommand.java @@ -92,7 +92,7 @@ public class AnalyzeCommand extends BasicCollable { defaultValue = "true", fallbackValue = "true") private boolean consolidation = true; - @CommandLine.Option(names = "--module-option", description = "Generates a user defined module option forr either technology module or analysis unit module. Possible value is one of: full_content, one_per_au, one_per_techno") + @CommandLine.Option(names = "--module-option", description = "Generates a user defined module option for either technology module or analysis unit module. Possible value is one of: full_content, one_per_au, one_per_techno") private ModuleGenerationType moduleGenerationType; public AnalyzeCommand(RestApiService restApiService, JobsService jobsService, ApplicationService applicationService) { diff --git a/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/Architecture-Studio-Model-Check-integ-tests.bat b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/Architecture-Studio-Model-Check-integ-tests.bat new file mode 100644 index 00000000..8b0387a0 --- /dev/null +++ b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/Architecture-Studio-Model-Check-integ-tests.bat @@ -0,0 +1,42 @@ +@echo off +REM -- Check architecture model against an application -- +SET SERVER_URL=%~1 +SET API_KEY=%~2 +SET APP_NAME=%~3 +SET MODEL_CHECK_REPORT_PATH=%~4 +SET MODEL_NAME=%~5 +SET UPLOAD_FILE_PATH=%~6 +set TOOLS_EXTENSION=com.castsoftware.aip.console.tools.%TOOLS_VERSION% +set EXTEND_URL=https://extend.castsoftware.com +set PATH=C:\CAST-Caches\Win64;%PATH% + +for %%a in ( TOOLSDIR ) do ( + if not defined %%a ( + @echo. + @echo ERROR : Environment variable %%a should exist as environment var... + @echo. + exit /b 1 + ) +) +if not exist %TOOLSDIR%\%TOOLS_EXTENSION%.zip ( + @echo ===== Processing NUPKG artifact version %TOOLS_VERSION% ========== +7z.exe e "%DEV_ARTIFACT%\upload\com.castsoftware.aip.console.tools*.nupkg" -y -o"%TOOLSDIR%" %TOOLS_EXTENSION%.zip +) +echo ---------------------------- +echo Unziping the downloaded build artifact +echo 7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" +echo ---------------------------- +7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" + +echo -- Check architecture model against an application -- +echo java -jar aip-console-tools-cli.jar ArchitectureStudioModelChecker --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --model-name="%MODEL_NAME%" --report-path="%MODEL_CHECK_REPORT_PATH" --file-path="%UPLOAD_FILE_PATH" --verbose=%VERBOSE% +echo -------------------------------- + +SET TOOLS_CLI_PATH=%TOOLSDIR%\%TOOLS_EXTENSION% +CD /d "%TOOLS_CLI_PATH%" + +java -jar aip-console-tools-cli.jar ArchitectureStudioModelChecker --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --model-name="%MODEL_NAME%" --report-path="%MODEL_CHECK_REPORT_PATH" --file-path="%UPLOAD_FILE_PATH" --verbose=%VERBOSE% + +echo exit code=%errorlevel% \ No newline at end of file diff --git a/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/Publish-Imaging-integ-tests.bat b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/Publish-Imaging-integ-tests.bat new file mode 100644 index 00000000..235f21c7 --- /dev/null +++ b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/Publish-Imaging-integ-tests.bat @@ -0,0 +1,40 @@ +@echo off +REM -- Publish existing application data to Imaging -- +SET SERVER_URL=%~1 +SET API_KEY=%~2 +SET APP_NAME=%~3 +set TOOLS_EXTENSION=com.castsoftware.aip.console.tools.%TOOLS_VERSION% +set EXTEND_URL=https://extend.castsoftware.com +set PATH=C:\CAST-Caches\Win64;%PATH% + +for %%a in ( TOOLSDIR ) do ( + if not defined %%a ( + @echo. + @echo ERROR : Environment variable %%a should exist as environment var... + @echo. + exit /b 1 + ) +) +if not exist %TOOLSDIR%\%TOOLS_EXTENSION%.zip ( + @echo ===== Processing NUPKG artifact version %TOOLS_VERSION% ========== +7z.exe e "%DEV_ARTIFACT%\upload\com.castsoftware.aip.console.tools*.nupkg" -y -o"%TOOLSDIR%" %TOOLS_EXTENSION%.zip +) +echo ---------------------------- +echo Unziping the downloaded build artifact +echo 7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" +echo ---------------------------- +7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" + +echo -- Publish existing application data to Imaging -- +echo java -jar aip-console-tools-cli.jar Publish-Imaging --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --verbose=%VERBOSE% +echo -------------------------------- + +SET TOOLS_CLI_PATH=%TOOLSDIR%\%TOOLS_EXTENSION% +CD /d "%TOOLS_CLI_PATH%" + +java -jar aip-console-tools-cli.jar Publish-Imaging --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --verbose=%VERBOSE% + +echo exit code=%errorlevel% + diff --git a/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/add-rescan-version-integ-test.bat b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/add-rescan-version-integ-test.bat new file mode 100644 index 00000000..c2f3fd70 --- /dev/null +++ b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/add-rescan-version-integ-test.bat @@ -0,0 +1,66 @@ +@echo off +REM -- deliver version to existing Application -- +SET SERVER_URL=%~1 +SET API_KEY=%~2 +SET APP_NAME=%~3 +SET IN_PLACE_MODE=%~4 +SET DOMAIN_NAME=%~5 +SET CSS=%~6 +REM SET NODE_NAME=%~7 +set TOOLS_EXTENSION=com.castsoftware.aip.console.tools.%TOOLS_VERSION% +set EXTEND_URL=https://extend.castsoftware.com +set PATH=C:\CAST-Caches\Win64;%PATH% + +REM EXAMPLE +REM +SET MORE_OPTIONS= +if not "%DOMAIN_NAME%" == "" SET MORE_OPTIONS=--domain-name="%DOMAIN_NAME%" +if not "%NODE_NAME%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --node-name="%NODE_NAME%" +if not "%VERSION_NAME%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --version-name="%VERSION_NAME%" +if "%SHOW_SQL%" == "true" SET MORE_OPTIONS=%MORE_OPTIONS% --show-sql +if "%AMT_PROFILING%" == "true" SET MORE_OPTIONS=%MORE_OPTIONS% --amt-profiling" +if not "%VERSION_DATE%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --version-date="%VERSION_DATE%" +if not "%BACKUP_NAME%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --backup-name="%BACKUP_NAME%" +if not "%CSS%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --css-server=%CSS% +if not "%SNAPSHOT_NAME%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --snapshot-name="%SNAPSHOT_NAME%" + +REM Add all boolean +SET MORE_OPTIONS=%MORE_OPTIONS% --backup=%BACKUP% --enable-security-assessment=%SECURITY_ASSESSMENT% --enable-security-dataflow=%SECURITY_DATAFLOW% +SET MORE_OPTIONS=%MORE_OPTIONS% --blueprint=%BLUEPRINT% --auto-create=%AUTO_CREATE% +if "%PROCESS_IMAGING%" == "true" SET MORE_OPTIONS=%MORE_OPTIONS% --process-imaging +if "%UPLOAD_APPLICATION%" == "true" SET MORE_OPTIONS=%MORE_OPTIONS% --upload-application +if not "%MODULE_OPTION%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --module-option="%MODULE_OPTION%" + +for %%a in ( SOURCES_ZIP TOOLSDIR ) do ( + if not defined %%a ( + @echo. + @echo ERROR : Environment variable %%a should exist as environment var... + @echo. + exit /b 1 + ) +) +if not exist %TOOLSDIR%\%TOOLS_EXTENSION%.zip ( + @echo ===== Processing NUPKG artifact version %TOOLS_VERSION% ========== +7z.exe e "%DEV_ARTIFACT%\upload\com.castsoftware.aip.console.tools*.nupkg" -y -o"%TOOLSDIR%" %TOOLS_EXTENSION%.zip +) +echo ---------------------------- +echo Unzip the downloaded build artifact +echo 7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" +echo ---------------------------- +7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" + +echo -- Delivers a new version to AIP Console -- +echo OPTIONS= %MORE_OPTIONS% +echo java -jar aip-console-tools-cli.jar add --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --file="%SOURCES_ZIP%" --verbose=%VERBOSE% ^ + %MORE_OPTIONS% +echo -------------------------------- +SET TOOLS_CLI_PATH=%TOOLSDIR%\%TOOLS_EXTENSION% +CD /d "%TOOLS_CLI_PATH%" + +java -jar aip-console-tools-cli.jar add --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --file="%SOURCES_ZIP%" --verbose=false ^ + %MORE_OPTIONS% + +echo exit code=%errorlevel% + diff --git a/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/analyze-version-integ-test.bat b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/analyze-version-integ-test.bat new file mode 100644 index 00000000..ce1df976 --- /dev/null +++ b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/analyze-version-integ-test.bat @@ -0,0 +1,57 @@ +@echo off +REM -- Analyses an existing version on AIP Console Application -- +SET SERVER_URL=%~1 +SET API_KEY=%~2 +SET APP_NAME=%~3 +SET VERSION_NAME=%~4 + +set TOOLS_EXTENSION=com.castsoftware.aip.console.tools.%TOOLS_VERSION% +set EXTEND_URL=https://extend.castsoftware.com +set PATH=C:\CAST-Caches\Win64;%PATH% + +REM EXAMPLE +REM call "analyzer-version-integ-test.bat" "server-url" "api-key" "app-name" "version-name" +REM +SET MORE_OPTIONS= +if "%SHOW_SQL%" == "true" SET MORE_OPTIONS=%MORE_OPTIONS% --show-sql +if "%AMT_PROFILING%" == "true" SET MORE_OPTIONS=%MORE_OPTIONS% --amt-profiling" + +if not "%MODULE_OPTION%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --module-option="%MODULE_OPTION%" +if "%UPLOAD_APPLICATION%" == "true" SET MORE_OPTIONS=%MORE_OPTIONS% --upload-application +if "%PROCESS_IMAGING%" == "true" SET MORE_OPTIONS=%MORE_OPTIONS% --process-imaging +if "%WITH_SNAPSHOT%" == "true" SET MORE_OPTIONS=%MORE_OPTIONS% --snapshot + + +for %%a in ( VERSION_NAME APP_NAME TOOLSDIR) do ( + if not defined %%a ( + @echo. + @echo ERROR : Environment variable %%a should exist as environment var... + @echo. + exit /b 1 + ) +) +if not exist %TOOLSDIR%\%TOOLS_EXTENSION%.zip ( + @echo ===== Processing NUPKG artifact version %TOOLS_VERSION% ========== +7z.exe e "%DEV_ARTIFACT%\upload\com.castsoftware.aip.console.tools*.nupkg" -y -o"%TOOLSDIR%" %TOOLS_EXTENSION%.zip +) +echo ---------------------------- +echo Unzip the downloaded build artifact +echo 7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" +echo ---------------------------- +7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" + +echo -- Analyses an existing version on AIP Console -- +echo OPTIONS= %MORE_OPTIONS% +echo java -jar aip-console-tools-cli.jar analyze --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --version-name="%VERSION_NAME%" --verbose=%VERBOSE% ^ + %MORE_OPTIONS% +echo -------------------------------- +SET TOOLS_CLI_PATH=%TOOLSDIR%\%TOOLS_EXTENSION% +CD /d "%TOOLS_CLI_PATH%" + +java -jar aip-console-tools-cli.jar analyze --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --version-name="%VERSION_NAME%" --verbose=false ^ + %MORE_OPTIONS% + +echo exit code=%errorlevel% + diff --git a/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/create-application-integ-test.bat b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/create-application-integ-test.bat new file mode 100644 index 00000000..da7e4d12 --- /dev/null +++ b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/create-application-integ-test.bat @@ -0,0 +1,58 @@ +@echo off +REM -- Create Application -- +SET SERVER_URL=%~1 +SET API_KEY=%~2 +SET APP_NAME=%~3 +SET IN_PLACE_MODE=%~4 +SET DOMAIN_NAME=%~5 +SET CSS=%~6 +REM SET NODE_NAME=%~7 +set TOOLS_EXTENSION=com.castsoftware.aip.console.tools.%TOOLS_VERSION% +set EXTEND_URL=https://extend.castsoftware.com +set PATH=C:\CAST-Caches\Win64;%PATH% + +REM EXAMPLE +REM create-application-integ-test.bat "download folder" "http://machine.corp.castsoftware.com:8081" "LPZ5i8lJ.5dKr2Y4e39cVIJ70rJETgG0sY29C2ElH" "WEBITOOLS-102-Test-App" false "TOOLS-CLI-TEST_DOM" +REM +SET MORE_OPTIONS= +if not "%DOMAIN_NAME%" == "" SET MORE_OPTIONS=--domain-name="%DOMAIN_NAME%" +if not "%IN_PLACE_MODE%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --no-version-history=%IN_PLACE_MODE% +if not "%CSS%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --css-server=%CSS% +if not "%NODE_NAME%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --node-name="%NODE_NAME%" + +if not defined TOOLSDIR ( + set TOOLSDIR=%WORKSPACE%\bin +) + +if not exist %TOOLSDIR%\%TOOLS_EXTENSION%.zip ( + @echo ===== Processing NUPKG artifact version %TOOLS_VERSION% ========== +7z.exe e "%DEV_ARTIFACT%\upload\com.castsoftware.aip.console.tools*.nupkg" -y -o"%TOOLSDIR%" %TOOLS_EXTENSION%.zip + REM @echo. + REM @echo ERROR : %TOOLSDIR%\%TOOLS_EXTENSION%.zip file should be downloaded from DEV Build job ... + REM @echo. + REM exit /b -1 +) + +@echo ---------------------------- +@echo Unzip the downloaded extension +@echo 7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%*.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" +@echo ---------------------------- +7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" + +SET TOOLS_CLI_PATH=%TOOLSDIR%\%TOOLS_EXTENSION% +echo -- Create Application command -- +echo NODE name= %NODE_NAME% +echo OPTIONS= %MORE_OPTIONS% +echo java -jar aip-console-tools-cli.jar CreateApplication --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ +--app-name="%APP_NAME%" --verbose=false ^ +%MORE_OPTIONS% +echo -------------------------------- + +CD /d "%TOOLS_CLI_PATH%" + +java -jar aip-console-tools-cli.jar CreateApplication --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --verbose=false ^ + %MORE_OPTIONS% + +echo exit code=%errorlevel% + diff --git a/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/deept-analysis-integ-test.bat b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/deept-analysis-integ-test.bat new file mode 100644 index 00000000..c55698bd --- /dev/null +++ b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/deept-analysis-integ-test.bat @@ -0,0 +1,49 @@ +@echo off +REM -- Onboard application -- +SET SERVER_URL=%~1 +SET API_KEY=%~2 +SET APP_NAME=%~3 +set TOOLS_EXTENSION=com.castsoftware.aip.console.tools.%TOOLS_VERSION% +set EXTEND_URL=https://extend.castsoftware.com +set PATH=C:\CAST-Caches\Win64;%PATH% + +REM +SET MORE_OPTIONS= +if not "%SNAPSHOT_NAME%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --snapshot-name="%SNAPSHOT_NAME%" +if not "%MODULE_GENERATION_TYPE%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --module-option="%MODULE_GENERATION_TYPE%" +if not "%SLEEP_DURATION%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --sleep-duration="%SLEEP_DURATION%" + +for %%a in ( SOURCES_ZIP TOOLSDIR ) do ( + if not defined %%a ( + @echo. + @echo ERROR : Environment variable %%a should exist as environment var... + @echo. + exit /b 1 + ) +) +if not exist %TOOLSDIR%\%TOOLS_EXTENSION%.zip ( + @echo ===== Processing NUPKG artifact version %TOOLS_VERSION% ========== +7z.exe e "%DEV_ARTIFACT%\upload\com.castsoftware.aip.console.tools*.nupkg" -y -o"%TOOLSDIR%" %TOOLS_EXTENSION%.zip +) +echo ---------------------------- +echo Unzip the downloaded build artifact +echo 7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" +echo ---------------------------- +7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" + +echo -- Onboard application to CAST Imaging Console -- +echo -- DEEP-ANALYSIS +echo OPTIONS= %MORE_OPTIONS% +echo java -jar aip-console-tools-cli.jar Deep-Analyze --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --verbose=%VERBOSE% ^ + %MORE_OPTIONS% +echo -------------------------------- +SET TOOLS_CLI_PATH=%TOOLSDIR%\%TOOLS_EXTENSION% +CD /d "%TOOLS_CLI_PATH%" + +java -jar aip-console-tools-cli.jar Deep-Analyze --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --verbose=false ^ + %MORE_OPTIONS% + +echo exit code=%errorlevel% + diff --git a/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/deliver-version-integ-test.bat b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/deliver-version-integ-test.bat new file mode 100644 index 00000000..a35e6f7b --- /dev/null +++ b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/deliver-version-integ-test.bat @@ -0,0 +1,65 @@ +@echo off +REM -- deliver version to existing Application -- +SET SERVER_URL=%~1 +SET API_KEY=%~2 +SET APP_NAME=%~3 +SET IN_PLACE_MODE=%~4 +SET DOMAIN_NAME=%~5 +SET CSS=%~6 +REM SET NODE_NAME=%~7 +set TOOLS_EXTENSION=com.castsoftware.aip.console.tools.%TOOLS_VERSION% +set EXTEND_URL=https://extend.castsoftware.com +set PATH=C:\CAST-Caches\Win64;%PATH% + +REM EXAMPLE +REM +SET MORE_OPTIONS= +if not "%VERSION_NAME%" == "" SET MORE_OPTIONS=--version-name="%VERSION_NAME%" +if not "%NODE_NAME%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --node-name="%NODE_NAME%" +if not "%VERSION_DATE%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --version-date="%VERSION_DATE%" +if not "%EXCLUSION_PATTERNS%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --exclude-patterns="%EXCLUSION_PATTERNS%" +if not "%EXCLUSION_RULES%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --exclusion-rules="%EXCLUSION_RULES%" +if not "%BACKUP_NAME%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --backup-name="%BACKUP_NAME%" +if not "%CSS%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --css-server=%CSS% + +REM Add all boolean +if "%CLONE_VERSION%" == "false" SET MORE_OPTIONS=%MORE_OPTIONS% --create-new-version +if "%CLONE_VERSION%" == "true" SET MORE_OPTIONS=%MORE_OPTIONS% +if "%SET_AS_CURRENT%" == "true" SET MORE_OPTIONS=%MORE_OPTIONS% --set-as-current +SET MORE_OPTIONS=%MORE_OPTIONS% --backup=%BACKUP% --enable-security-assessment=%SECURITY_ASSESSMENT% --enable-security-dataflow=%SECURITY_DATAFLOW% +SET MORE_OPTIONS=%MORE_OPTIONS% --blueprint=%BLUEPRINT% --auto-create=%AUTO_CREATE% --auto-discover=%AUTO_DISCOVER% + +for %%a in ( SOURCES_ZIP TOOLSDIR ) do ( + if not defined %%a ( + @echo. + @echo ERROR : Environment variable %%a should exist as environment var... + @echo. + exit /b 1 + ) +) +if not exist %TOOLSDIR%\%TOOLS_EXTENSION%.zip ( + @echo ===== Processing NUPKG artifact version %TOOLS_VERSION% ========== +7z.exe e "%DEV_ARTIFACT%\upload\com.castsoftware.aip.console.tools*.nupkg" -y -o"%TOOLSDIR%" %TOOLS_EXTENSION%.zip +) + +echo ---------------------------- +echo Unzip the downloaded build artifact +echo 7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" +echo ---------------------------- +7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" + +echo -- Delivers a new version to AIP Console -- +echo OPTIONS= %MORE_OPTIONS% +echo java -jar aip-console-tools-cli.jar deliver --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --file="%SOURCES_ZIP%" --verbose=%VERBOSE% ^ + %MORE_OPTIONS% +echo -------------------------------- +SET TOOLS_CLI_PATH=%TOOLSDIR%\%TOOLS_EXTENSION% +CD /d "%TOOLS_CLI_PATH%" + +java -jar aip-console-tools-cli.jar deliver --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --file="%SOURCES_ZIP%" --verbose=false ^ + %MORE_OPTIONS% + +echo exit code=%errorlevel% + diff --git a/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/fast-scan-integ-test.bat b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/fast-scan-integ-test.bat new file mode 100644 index 00000000..e4e2347f --- /dev/null +++ b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/fast-scan-integ-test.bat @@ -0,0 +1,51 @@ +@echo off +REM -- Onboard application FAST-SCAN-- +SET SERVER_URL=%~1 +SET API_KEY=%~2 +SET APP_NAME=%~3 +SET DOMAIN_NAME=%~4 +set TOOLS_EXTENSION=com.castsoftware.aip.console.tools.%TOOLS_VERSION% +set EXTEND_URL=https://extend.castsoftware.com +set PATH=C:\CAST-Caches\Win64;%PATH% + +REM +SET MORE_OPTIONS=--file="%SOURCES_ZIP%" +if not "%EXCLUSION_PATTERNS%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --exclude-patterns="%EXCLUSION_PATTERNS%" +if not "%EXCLUSION_RULES%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --exclusion-rules="%EXCLUSION_RULES%" +if not "%DOMAIN_NAME%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --domain-name="%DOMAIN_NAME%" +if not "%SLEEP_DURATION%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --sleep-duration="%SLEEP_DURATION%" + +for %%a in ( SOURCES_ZIP TOOLSDIR ) do ( + if not defined %%a ( + @echo. + @echo ERROR : Environment variable %%a should exist as environment var... + @echo. + exit /b 1 + ) +) +if not exist %TOOLSDIR%\%TOOLS_EXTENSION%.zip ( + @echo ===== Processing NUPKG artifact version %TOOLS_VERSION% ========== +7z.exe e "%DEV_ARTIFACT%\upload\com.castsoftware.aip.console.tools*.nupkg" -y -o"%TOOLSDIR%" %TOOLS_EXTENSION%.zip +) +echo ---------------------------- +echo Unzip the downloaded build artifact +echo 7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" +echo ---------------------------- +7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" + +echo -- Onboard application to CAST Imaging Console -- +echo -- FAST-SCAN +echo OPTIONS= %MORE_OPTIONS% +echo java -jar aip-console-tools-cli.jar FAst-Scan --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --verbose=%VERBOSE% ^ + %MORE_OPTIONS% +echo -------------------------------- +SET TOOLS_CLI_PATH=%TOOLSDIR%\%TOOLS_EXTENSION% +CD /d "%TOOLS_CLI_PATH%" + +java -jar aip-console-tools-cli.jar Fast-Scan --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --verbose=false ^ + %MORE_OPTIONS% + +echo exit code=%errorlevel% + diff --git a/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/onboard-application-integ-test.bat b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/onboard-application-integ-test.bat new file mode 100644 index 00000000..85023d08 --- /dev/null +++ b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/onboard-application-integ-test.bat @@ -0,0 +1,53 @@ +@echo off +REM -- Onboard-application All-in-one -- +SET SERVER_URL=%~1 +SET API_KEY=%~2 +SET APP_NAME=%~3 +SET DOMAIN_NAME=%~4 +set TOOLS_EXTENSION=com.castsoftware.aip.console.tools.%TOOLS_VERSION% +set EXTEND_URL=https://extend.castsoftware.com +set PATH=C:\CAST-Caches\Win64;%PATH% + +REM +SET MORE_OPTIONS=--file="%SOURCES_ZIP%" +if not "%EXCLUSION_PATTERNS%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --exclude-patterns="%EXCLUSION_PATTERNS%" +if not "%EXCLUSION_RULES%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --exclusion-rules="%EXCLUSION_RULES%" +if not "%DOMAIN_NAME%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --domain-name="%DOMAIN_NAME%" +if not "%SLEEP_DURATION%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --sleep-duration="%SLEEP_DURATION%" +if not "%SNAPSHOT_NAME%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --snapshot-name="%SNAPSHOT_NAME%" +if not "%MODULE_GENERATION_TYPE%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --module-option="%MODULE_GENERATION_TYPE%" + +for %%a in ( SOURCES_ZIP TOOLSDIR ) do ( + if not defined %%a ( + @echo. + @echo ERROR : Environment variable %%a should exist as environment var... + @echo. + exit /b 1 + ) +) +if not exist %TOOLSDIR%\%TOOLS_EXTENSION%.zip ( + @echo ===== Processing NUPKG artifact version %TOOLS_VERSION% ========== +7z.exe e "%DEV_ARTIFACT%\upload\com.castsoftware.aip.console.tools*.nupkg" -y -o"%TOOLSDIR%" %TOOLS_EXTENSION%.zip +) +echo ---------------------------- +echo Unzip the downloaded build artifact +echo 7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" +echo ---------------------------- +7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" + +echo -- Onboard application to CAST Imaging Console -- +echo -- FAST-SCAN +echo OPTIONS= %MORE_OPTIONS% +echo java -jar aip-console-tools-cli.jar Onboard-Application --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --verbose=%VERBOSE% ^ + %MORE_OPTIONS% +echo -------------------------------- +SET TOOLS_CLI_PATH=%TOOLSDIR%\%TOOLS_EXTENSION% +CD /d "%TOOLS_CLI_PATH%" + +java -jar aip-console-tools-cli.jar Onboard-Application --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --verbose=false ^ + %MORE_OPTIONS% + +echo exit code=%errorlevel% + diff --git a/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/snapshot-version-integ-test.bat b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/snapshot-version-integ-test.bat new file mode 100644 index 00000000..bddc07f1 --- /dev/null +++ b/aip-console-tools-cli/src/test/java/com/castsoftware/aip/console/tools/testbatches/snapshot-version-integ-test.bat @@ -0,0 +1,52 @@ +@echo off +REM -- Take a snapshot of an existing version on AIP Console Application -- +SET SERVER_URL=%~1 +SET API_KEY=%~2 +SET APP_NAME=%~3 +SET VERSION_NAME=%~4 +SET SNAPSHOT_NAME=%~5 + +set TOOLS_EXTENSION=com.castsoftware.aip.console.tools.%TOOLS_VERSION% +set EXTEND_URL=https://extend.castsoftware.com +set PATH=C:\CAST-Caches\Win64;%PATH% + +REM EXAMPLE +REM call "snapshot-version-integ-test.bat" "server-url" "api-key" "app-name" "version-name" "snapshot-name" +REM +SET MORE_OPTIONS= +if not "%SNAPSHOT_DATE%" == "" SET MORE_OPTIONS=%MORE_OPTIONS% --snapshot-date="%SNAPSHOT_DATE%" +if "%UPLOAD_APPLICATION%" == "true" SET MORE_OPTIONS=%MORE_OPTIONS% --upload-application +if "%PROCESS_IMAGING%" == "true" SET MORE_OPTIONS=%MORE_OPTIONS% --process-imaging + + +for %%a in ( VERSION_NAME APP_NAME SNAPSHOT_NAME TOOLSDIR) do ( + if not defined %%a ( + @echo. + @echo ERROR : Environment variable %%a should exist as environment var... + @echo. + exit /b 1 + ) +) +if not exist %TOOLSDIR%\%TOOLS_EXTENSION%.zip ( + @echo ===== Processing NUPKG artifact version %TOOLS_VERSION% ========== +7z.exe e "%DEV_ARTIFACT%\upload\com.castsoftware.aip.console.tools*.nupkg" -y -o"%TOOLSDIR%" %TOOLS_EXTENSION%.zip +) +echo ---------------------------- +echo Unzip the downloaded build artifact +echo 7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" +echo ---------------------------- +7z.exe x "%TOOLSDIR%\%TOOLS_EXTENSION%.zip" -y -o"%TOOLSDIR%\%TOOLS_EXTENSION%" + +echo -- Analyses an existing version on AIP Console -- +echo OPTIONS= %MORE_OPTIONS% + +echo -------------------------------- +SET TOOLS_CLI_PATH=%TOOLSDIR%\%TOOLS_EXTENSION% +CD /d "%TOOLS_CLI_PATH%" + +java -jar aip-console-tools-cli.jar snapshot --server-url="%SERVER_URL%" --apikey="%API_KEY%" --timeout=5000 ^ + --app-name="%APP_NAME%" --version-name="%VERSION_NAME%" --snapshot-name="%SNAPSHOT_NAME%" --verbose=%VERBOSE% ^ + %MORE_OPTIONS% + +echo exit code=%errorlevel% +