build-ambari.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/usr/bin/env bash
  2. # Licensed under the Apache License, Version 2.0 (the "License");
  3. # you may not use this file except in compliance with the License.
  4. # You may obtain a copy of the License at
  5. #
  6. # http://www.apache.org/licenses/LICENSE-2.0
  7. #
  8. # Unless required by applicable law or agreed to in writing, software
  9. # distributed under the License is distributed on an "AS IS" BASIS,
  10. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. # See the License for the specific language governing permissions and
  12. # limitations under the License.
  13. # Clean up files from previous build to make sure there are no artifacts that would trigger rat failure.
  14. pushd .
  15. cd $WORKSPACE
  16. git clean -xdf
  17. popd
  18. # We stash node.js installation into this weird place
  19. # because on one hand we want it to be somewhere inside
  20. # the current workspace and on the other hand we don't
  21. # want RAT to be ran on files that comprise it. The following
  22. # location is excluded from RAT by default
  23. REPO_NAME=contrib/views/node.js/target
  24. [ -d "$REPO_NAME" ] && exit 0
  25. rm -rf $REPO_NAME
  26. mkdir -p $REPO_NAME.tmp
  27. pushd $REPO_NAME.tmp
  28. curl --retry 3 --retry-delay 5 -k http://nodejs.org/dist/v4.5.0/node-v4.5.0-linux-x64.tar.gz | tar xzvf -
  29. mv node-v4.5.0-linux-x64/* .
  30. rmdir node-v4.5.0-linux-x64
  31. popd
  32. mv $REPO_NAME.tmp $REPO_NAME
  33. export PATH=`pwd`/$REPO_NAME/bin:$PATH
  34. npm install -g brunch@1.7.20
  35. export _JAVA_OPTIONS="-Xmx2048m -Djava.awt.headless=true"
  36. export JAVA_HOME=/home/jenkins/tools/java/latest1.8
  37. export MAVEN_HOME=/home/jenkins/tools/maven/latest
  38. export PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH
  39. PATH=`pwd`/contrib/views/node.js/target/bin:$PATH
  40. echo "Checking Hudson Java"
  41. ls -l /home/hudson/tools/java
  42. echo "Checking Jenkins Java"
  43. ls -l /home/jenkins/tools/java
  44. which java
  45. java -version
  46. python -V
  47. uname -a
  48. cd $WORKSPACE
  49. $MAVEN_HOME/bin/mvn -fae clean install