forked from umple/umple
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
140 lines (120 loc) · 5.4 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
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:
- php-common
- php-cli
before_install:
- ./travis/deps.sh # run linux or osx depending on environment
- chmod +x gradlew
install:
- true # See https://github.com/travis-ci/travis-ci/issues/8667
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:
# Gradle build (TODO: figure out why test needs to be run twice)
- if [ "$USE_GRADLE" ]; then ./gradlew fullbuild && ./gradlew testall; fi
- if [ -z "$USE_GRADLE" ]; then php --version ; ruby -v; fi
- if [ -z "$USE_GRADLE" ]; then cd build/; fi
- if [ -z "$USE_GRADLE" ]; then ant bootstrap; fi
# We resolve all of the dependencies before, this way the command will be unlikely to time out
- if [ -z "$USE_GRADLE" ]; then ant deps-resolve-all; fi
# Do a modified version of `first-build` (build using last successful build)
- if [ -z "$USE_GRADLE" ]; then $ANT_FIRST clean init codegen umpleParser rtcpp template.setVersion resetUmpleSelf; fi
- if [ -z "$USE_GRADLE" ]; then $ANT_FIRST compile; fi
- if [ -z "$USE_GRADLE" ]; then $ANT_FIRST package template.resetVersion; fi
# Do a modified version of `build`to create new jars
- if [ -z "$USE_GRADLE" ]; then $ANT_BUILD clean init codegen umpleParser rtcpp template.setVersion resetUmpleSelf; fi
- if [ -z "$USE_GRADLE" ]; then $ANT_BUILD compile; fi
- if [ -z "$USE_GRADLE" ]; then $ANT_BUILD package; fi
# Repeat creation of the compiler in case last build made a bad compiler
- if [ -z "$USE_GRADLE" ]; then $ANT_BUILD codegen umpleParser rtcpp template.setVersion resetUmpleSelf; fi
- if [ -z "$USE_GRADLE" ]; then $ANT_BUILD compile; fi
- if [ -z "$USE_GRADLE" ]; then $ANT_BUILD package; fi
# Run the unit tests
- if [ -z "$USE_GRADLE" ]; then $ANT_BUILD template.test template.resetVersion; fi
# Build and run the testbed (tests that test generated code)
- if [ -z "$USE_GRADLE" ]; then $ANT_TESTBED clean template.clean init; fi
- if [ -z "$USE_GRADLE" ]; then $ANT_TESTBED compile; fi
- if [ -z "$USE_GRADLE" ]; then $ANT_TESTBED test; fi
# Compile all known Umple examples and verify they compile in Java
- if [ -z "$USE_GRADLE" ]; then $ANT_EXAMPLES allUserManualAndExampleTests; fi
- if [ -z "$USE_GRADLE" ]; then $ANT_TESTBED template.resetVersion; fi
# Build the user manual and copy it to a subfolder of UmpleOnline
- if [ -z "$USE_GRADLE" ]; then $ANT_BUILD packageDocs travisCopyManual; fi
# 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"
# --build-arg gitbranch=$TRAVIS_BRANCH ../umpleonline;
# fi
# Commenting out docker since will use bdock tool and manual pushing
#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: openjdk12
addons:
apt:
packages:
- ant
- ant-optional
# only Linux supports Docker right now
# env:
# - HAVE_DOCKER=1
# services:
# - docker
# - os: osx
# osx_image: xcode12.2
# test gradle builds - commented out for now
# - os: linux
# jdk: openjdk12
# env:
# - USE_GRADLE=1
# # TODO: test Docker
# - os: osx
# env:
# - USE_GRADLE=1