build.bat 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. :: Licensed to the Apache Software Foundation (ASF) under one or more
  2. :: contributor license agreements. See the NOTICE file distributed with
  3. :: this work for additional information regarding copyright ownership.
  4. :: The ASF licenses this file to You under the Apache License, Version 2.0
  5. :: (the "License"); you may not use this file except in compliance with
  6. :: the License. You may obtain a copy of the License at
  7. ::
  8. :: http://www.apache.org/licenses/LICENSE-2.0
  9. ::
  10. :: Unless required by applicable law or agreed to in writing, software
  11. :: distributed under the License is distributed on an "AS IS" BASIS,
  12. :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. :: See the License for the specific language governing permissions and
  14. :: limitations under the License.
  15. ::
  16. @echo off
  17. echo "------ dolphinscheduler start - build -------"
  18. set
  19. if not defined VERSION (
  20. echo "set environment variable [VERSION]"
  21. for /f %%l in (%cd%\sql\soft_version) do (set VERSION=%%l)
  22. )
  23. if not defined DOCKER_REPO (
  24. echo "set environment variable [DOCKER_REPO]"
  25. set DOCKER_REPO='dolphinscheduler'
  26. )
  27. echo "Version: %VERSION%"
  28. echo "Repo: %DOCKER_REPO%"
  29. echo "Current Directory is %cd%"
  30. :: maven package(Project Directory)
  31. echo "call mvn clean compile package -Prelease"
  32. call mvn clean compile package -Prelease -DskipTests=true
  33. if "%errorlevel%"=="1" goto :mvnFailed
  34. :: move dolphinscheduler-bin.tar.gz file to docker/build directory
  35. echo "move %cd%\dolphinscheduler-dist\target\apache-dolphinscheduler-incubating-%VERSION%-SNAPSHOT-dolphinscheduler-bin.tar.gz %cd%\docker\build\"
  36. move %cd%\dolphinscheduler-dist\target\apache-dolphinscheduler-incubating-%VERSION%-SNAPSHOT-dolphinscheduler-bin.tar.gz %cd%\docker\build\
  37. :: docker build
  38. echo "docker build --build-arg VERSION=%VERSION% -t %DOCKER_REPO%:%VERSION% %cd%\docker\build\"
  39. docker build --build-arg VERSION=%VERSION% -t %DOCKER_REPO%:%VERSION% %cd%\docker\build\
  40. if "%errorlevel%"=="1" goto :dockerBuildFailed
  41. echo "------ dolphinscheduler end - build -------"
  42. :mvnFailed
  43. echo "MAVEN PACKAGE FAILED!"
  44. :dockerBuildFailed
  45. echo "DOCKER BUILD FAILED!"