-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
82 lines (73 loc) · 3.37 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
# Build script for Travis CI
#
sudo: false
language: java
jdk: openjdk8
# speed up builds by caching maven local repository
cache:
directories:
- "$HOME/.m2/repository"
# as agreed in our SOP
branches:
only:
- master
- development
# added to make logs look cleaner, crisper, certified fresh
before_install: unset _JAVA_OPTIONS &&
if [ -z \"$encrypted_c9fdf0a9e647_key\" ];
then
echo "key is empty";
else
echo "key is set";
fi;
if [ -z "$encrypted_c9fdf0a9e647_iv" ];
then
echo "iv is empty";
else
echo "iv is set";
fi;
# speed up builds by telling Travis that we don't need any special "installation"
install: true
# as agreed in our SOP, build everything (don't deploy, just try to 'mvn install' locally, which covers all phases)
script: mvn --quiet --activate-profiles !development-build,!release-build --settings .travis.settings.xml clean cobertura:cobertura install
# upload code coverage report, generate maven site (javadocs, documentation, static code analysis, etc.)
#after_success:
# #####################UNCOMMENT THIS!!!!!!#############################################################################
#- bash <(curl -s https://codecov.io/bash)
#- mvn --quiet --activate-profiles !development-build,!release-build --settings .travis.settings.xml site
# ########################################################################################################################
# unencrypt file with sensitive information only if needed
before_deploy: source ./.travis.decrypt.sh /tmp/travis_rsa
deploy:
# as agreed in our SOP, builds on development branch will deploy to our maven repository after validating
# the artifact has a proper SNAPSHOT version
# artifact will be installed in our testing instance if it is a .war file
- skip_cleanup: true
provider: script
script: echo $BOGUS_VARIABLE && mvn --quiet --activate-profiles development-build,!release-build --settings .travis.settings.xml deploy &&
find target/ -name *.war -exec rsync --verbose -e "ssh -o StrictHostKeyChecking=no" -e "ssh -i /tmp/travis_rsa" {} $TESTING_USERNAME@$TESTING_SERVER:~/liferay*/deploy \;
on:
branch: development
condition: '"$TRAVIS_EVENT_TYPE" = "push"'
# as agreed in our SOP, tagging a commit on the master branch will upload to our maven repository
# after validating the artifact has a proper release version
# artifact will be installed in our testing instance if it is a .war file
- skip_cleanup: true
provider: script
script: mvn --quiet --activate-profiles !development-build,release-build --settings .travis.settings.xml deploy &&
find target/ -name *.war -exec rsync --verbose -e "ssh -o StrictHostKeyChecking=no" -e "ssh -i /tmp/travis_rsa" {} $TESTING_USERNAME@$TESTING_SERVER:~/liferay*/deploy \;
on:
branch: master
tags: true
# always delete sensitive information
after_deploy: echo \"Deleting all your secrets\" && rm -f /tmp/travis_rsa
# change according to your needs, but we recommend to deactivate email notifications
# for now, we configured Travis to send a notification to the #travis-ci channel
notifications:
email:
on_success: never
on_failure: never
slack:
rooms: "$SLACK_TOKEN"
on_success: always
on_failure: always