package.bat 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. @echo off
  2. @rem Licensed to the Apache Software Foundation (ASF) under one or more
  3. @rem contributor license agreements. See the NOTICE file distributed with
  4. @rem this work for additional information regarding copyright ownership.
  5. @rem The ASF licenses this file to You under the Apache License, Version 2.0
  6. @rem (the "License"); you may not use this file except in compliance with
  7. @rem the License. You may obtain a copy of the License at
  8. @rem
  9. @rem http://www.apache.org/licenses/LICENSE-2.0
  10. @rem
  11. @rem Unless required by applicable law or agreed to in writing, software
  12. @rem distributed under the License is distributed on an "AS IS" BASIS,
  13. @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. @rem See the License for the specific language governing permissions and
  15. @rem limitations under the License.set ARTIFACT_DIR=artifacts
  16. @echo on
  17. IF dummy==dummy%1 (
  18. SET SCOM_VERSION="1.0.0"
  19. ) ELSE (
  20. SET SCOM_VERSION=%1
  21. )
  22. echo SCOM_VERSION = %SCOM_VERSION%
  23. set ARTIFACT_DIR=artifacts
  24. set TEMP_DIR=%ARTIFACT_DIR%\temp
  25. set FINAL_ZIPS=%ARTIFACT_DIR%\zips
  26. set SCOM_DIR=%TEMP_DIR%\server
  27. set SINK_DIR=%TEMP_DIR%\metrics-sink
  28. set MP_DIR=%TEMP_DIR%\mp
  29. rmdir /s /q %ARTIFACT_DIR%
  30. mkdir %FINAL_ZIPS% || exit /b 1
  31. mkdir %SCOM_DIR% || exit /b 1
  32. mkdir %MP_DIR% || exit /b 1
  33. mkdir %SINK_DIR% || exit /b 1
  34. copy ambari-scom-server\target\ambari-scom*.zip %SCOM_DIR% || exit /b 1
  35. copy ambari-scom-server\target\ambari-scom*.jar %SCOM_DIR% || exit /b 1
  36. copy metrics-sink\target\*.jar %SINK_DIR% || exit /b 1
  37. copy metrics-sink\db\*.ddl %SINK_DIR% || exit /b 1
  38. copy management-pack\Hadoop_MP\ManagementMp\bin\Debug\*.mpb %MP_DIR% || exit /b 1
  39. copy management-pack\Hadoop_MP\HadoopMp\bin\Debug\*.mpb %MP_DIR% || exit /b 1
  40. copy management-pack\Hadoop_MP\PresentationMp\bin\Debug\*.mpb %MP_DIR% || exit /b 1
  41. copy msi\*.msi %FINAL_ZIPS% || exit /b 1
  42. copy README.md %FINAL_ZIPS% || exit /b 1
  43. powershell.exe -NoProfile -InputFormat none -ExecutionPolicy unrestricted -command "%cd%\msi\build\zip.ps1" "%SCOM_DIR%" "%FINAL_ZIPS%\server.zip" || exit /b 1
  44. powershell.exe -NoProfile -InputFormat none -ExecutionPolicy unrestricted -command "%cd%\msi\build\zip.ps1" "%SINK_DIR%" "%FINAL_ZIPS%\metrics-sink.zip" || exit /b 1
  45. powershell.exe -NoProfile -InputFormat none -ExecutionPolicy unrestricted -command "%cd%\msi\build\zip.ps1" "%MP_DIR%" "%FINAL_ZIPS%\mp.zip" || exit /b 1
  46. powershell.exe -NoProfile -InputFormat none -ExecutionPolicy unrestricted -command "%cd%\msi\build\zip.ps1" "%FINAL_ZIPS%" "%ARTIFACT_DIR%\ambari-scom-%SCOM_VERSION%.zip" || exit /b 1