Permalink
Fetching contributors…
Cannot retrieve contributors at this time
115 lines (98 sloc) 4.1 KB
language: java
# Notes:
# To enabled openjdk8 we need to use the `trusty` environment which is currently in Beta
# We do not use this due to the length of time required to start-up the builds
#sudo: required
#dist: trusty
cache:
directories:
- $HOME/.ant/lib/
- $HOME/.ivy2/
- $HOME/.m2/
- $TRAVIS_BUILD_DIR/dist/libs
addons:
apt:
packages:
- php5-common
- php5-cli
before_install:
- ./travis/deps.sh # run linux or osx depending on environment
env:
global:
- ANT_FIRST='ant -f build.umple.xml -Dfirst.build=true'
- ANT_BUILD='ant -f build.umple.xml -Dfirst.build=false'
- ANT_TESTBED='ant -f build.testbed.xml -Dfirst.build=false'
- ANT_EXAMPLES='ant -f build.exampletests.xml'
script:
- php --version ; ruby -v
- cd build/
- ant bootstrap
# We resolve all of the dependencies before, this way the command will be unlikely to time out
- ant deps-resolve-all
# Do a modified version of `first-build` (build using last successful build)
- $ANT_FIRST clean init codegen umpleParser rtcpp template.setVersion resetUmpleSelf
- $ANT_FIRST compile compileValidator compileUmplificator
- $ANT_FIRST package template.resetVersion
# Do a modified version of `build`to create new jars
- $ANT_BUILD clean init codegen umpleParser rtcpp template.setVersion resetUmpleSelf
- $ANT_BUILD compile compileValidator compileUmplificator
- $ANT_BUILD package
# Repeat creation of the compiler in case last build made a bad compiler
- $ANT_BUILD codegen umpleParser rtcpp template.setVersion resetUmpleSelf
- $ANT_BUILD compile
- $ANT_BUILD package
# Run the unit tests
- $ANT_BUILD template.test template.resetVersion
# Build and run the testbed (tests that test generated code)
- $ANT_TESTBED clean template.clean init
- $ANT_TESTBED compile
- $ANT_TESTBED test
# Compile all known Umple examples and verify they compile in Java
- $ANT_EXAMPLES allUserManualAndExampleTests
- $ANT_TESTBED template.resetVersion
# Build the user manual and copy it to a subfolder of UmpleOnline
- $ANT_BUILD packageDocs travisCopyManual
# Set up UmpleOnline to be packaged into its Docker image, then build the image.
- if [ "$HAVE_DOCKER" ]; then
$ANT_BUILD -DshouldPackageUmpleOnline=true packageUmpleonline &&
docker build -t "umple/umpleonline-base:local"
-f ../umpleonline/Dockerfile-base ../umpleonline &&
docker build -t "umple/umpleonline:recentbuild" ../umpleonline;
fi
after_success:
if ( [ "$HAVE_DOCKER" ] && [ "$TRAVIS_SECURE_ENV_VARS" ] ); then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
DOCKER_IMAGE_NAME="umple/umpleonline:recentbuild" &&
DOCKER_HASH_NAME="umple/umpleonline:$TRAVIS_COMMIT" &&
docker push "$DOCKER_IMAGE_NAME" &&
if [ "$TRAVIS_PULL_REQUEST" != 'false' ]; then
docker tag "$DOCKER_IMAGE_NAME" "umple/umpleonline:pr-$TRAVIS_PULL_REQUEST" &&
docker push "umple/umpleonline:pr-$TRAVIS_PULL_REQUEST";
elif [ "$TRAVIS_BRANCH" = 'master' ]; then
docker tag "$DOCKER_IMAGE_NAME" "umple/umpleonline:latest" &&
docker push "umple/umpleonline:latest" &&
docker tag "$DOCKER_IMAGE_NAME" "$DOCKER_HASH_NAME" &&
docker push "$DOCKER_HASH_NAME";
elif [ "$TRAVIS_BRANCH" = 'latest' ]; then
echo 'The branch name is "latest", not pushing branch tag';
elif ( echo "$TRAVIS_BRANCH" | grep -Eq '^pr\-[0-9]*$' ); then
echo 'The branch name looks like a pull request tag, not pushing branch tag';
else
docker tag "$DOCKER_IMAGE_NAME" "umple/umpleonline:$TRAVIS_BRANCH" &&
docker push "umple/umpleonline:$TRAVIS_BRANCH";
fi &&
if [ "$TRAVIS_TAG" ]; then
docker tag "umple/umpleonline-base:local" "umple/umpleonline-base:latest" &&
docker push "umple/umpleonline-base:latest";
fi
fi
matrix:
include:
- os: linux
jdk: oraclejdk8
# only Linux supports Docker right now
env:
- HAVE_DOCKER=1
services:
- docker
- os: osx