--- /dev/null
+#!/bin/bash
+set -euo pipefail
+
+RED='\033[0;31m'
+NC='\033[0m' # No Color
+printf "${RED}SETUP RAMDISK${NC}\n"
+printf "${RED}disk size before build${NC}\n"
+df -h
+du -sh $HOME
+
+printf "${RED}move original home${NC}\n"
+sudo mv /home/travis /home/travis.ori
+printf "${RED}create ramdisk mount point${NC}\n"
+sudo mkdir -p /home/travis
+printf "${RED}create ramdisk${NC}\n"
+sudo mount -t tmpfs -o size=8192m tmps /home/travis
+printf "${RED}copy home to ramdisk${NC}\n"
+time sudo cp -R /home/travis.ori/. /home/travis
+printf "${RED}give permissions to travis on its home in ramdisk${NC}\n"
+sudo chown -R travis:travis /home/travis
+
+++ /dev/null
-#!/bin/bash
-RED='\033[0;31m'
-NC='\033[0m' # No Color
-
-echo "start the clock"
-while [ ! -f stop ]; do
- #echo "File not found!"
- seconds=60; date1=$((`date +%s` + $seconds));
- while [ "$date1" -ge `date +%s` ]; do
- #echo -ne "$(date -u --date @$(($date1 - `date +%s` )) +%H:%M:%S)\r"; > /dev/null
- : #busy wait
- done
- printf "${RED}############# `date` ############${NC}\n"
-done
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+set -euo pipefail
+
+RED='\033[0;31m'
+NC='\033[0m' # No Color
+printf "${RED}SETUP RAMDISK${NC}\n"
+printf "${RED}disk size before build${NC}\n"
+df -h
+du -sh $HOME
+
+printf "${RED}move original home${NC}\n"
+sudo mv /home/travis /home/travis.ori
+printf "${RED}create ramdisk mount point${NC}\n"
+sudo mkdir -p /home/travis
+printf "${RED}create ramdisk${NC}\n"
+sudo mount -t tmpfs -o size=8192m tmps /home/travis
+printf "${RED}copy home to ramdisk${NC}\n"
+time sudo cp -R /home/travis.ori/. /home/travis
+printf "${RED}give permissions to travis on its home in ramdisk${NC}\n"
+sudo chown -R travis:travis /home/travis
+
#!/bin/bash
set -euo pipefail
+./.travis/setup_ramdisk.sh
+
function installPhantomJs {
echo "Setup PhantomJS 2.1"
mkdir -p ~/phantomjs
# Configure Maven settings and install some script utilities
#
function configureTravis {
- mkdir ~/.local
+ mkdir -p ~/.local
curl -sSL https://github.com/SonarSource/travis-utils/tarball/v36 | tar zx --strip-components 1 -C ~/.local
source ~/.local/bin/install
}
BUILD)
- # Hack to keep job alive even if no logs during more than 10 minutes.
- # That can occur when uploading sonarqube.zip to Artifactory.
- ./clock.sh &
-
installJdk8
installMaven
fixBuildVersion
# Minimal Maven settings
export MAVEN_OPTS="-Xmx1G -Xms128m"
- MAVEN_ARGS="-Dmaven.test.redirectTestOutputToFile=false -Dsurefire.useFile=false -B -e -V -DbuildVersion=$BUILD_VERSION"
+ MAVEN_ARGS="-T 1C -Dmaven.test.redirectTestOutputToFile=false -Dsurefire.useFile=false -B -e -V -DbuildVersion=$BUILD_VERSION"
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo 'Build and analyze master'
# For this reason errors are ignored with "|| true"
git fetch --unshallow || true
- mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy sonar:sonar \
+ mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy \
$MAVEN_ARGS \
- -Pdeploy-sonarsource,release \
+ -Pdeploy-sonarsource,release
+ mvn sonar:sonar \
-Dsonar.host.url=$SONAR_HOST_URL \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.projectVersion=$INITIAL_VERSION
+
elif [[ "$TRAVIS_BRANCH" == "branch-"* ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo 'Build release branch'
elif [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -n "${GITHUB_TOKEN:-}" ]; then
echo 'Build and analyze internal pull request'
- mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy sonar:sonar \
+ mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy \
$MAVEN_ARGS \
-Dsource.skip=true \
- -Pdeploy-sonarsource \
+ -Pdeploy-sonarsource
+ mvn sonar:sonar \
-Dsonar.analysis.mode=preview \
-Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST \
-Dsonar.github.repository=$TRAVIS_REPO_SLUG \
;;
esac
-
-#stop the clock
-touch stop