forked from lucee/Lucee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
106 lines (83 loc) · 3.39 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
language: java
# cache the maven dependancies
# cache lucee extension cache
cache:
directories:
- $HOME/.m2
- $HOME/build/lucee/Lucee/cache/
jdk:
# - oraclejdk9
- openjdk8
# build only commits to branch master or where pattern matches "n.n" (where n is a number), e.g. 5.2
branches:
only:
- master
- /^\d+(\.\d+)+$/
#os:
# - linux
# - osx
# copy the settings.xml for maven from the "travis" branch
before_install:
# - "git clone -b travis `git config --get remote.origin.url` target/travis"
### for more see https://docs.travis-ci.com/user/database-setup
services:
- mysql # server:"127.0.0.1"; user:"root"; password:""
- postgresql # server:"127.0.0.1"; user:"postgres"; password:""
- mongodb # server:"127.0.0.1" user/pass see below
- memcached # Memcached uses the default configuration and binds to localhost.
before_script:
- mysql -e "CREATE DATABASE IF NOT EXISTS testdb;" -uroot
- psql -c 'CREATE DATABASE testdb;' -U postgres
### enable the below only if authentication is implemented in MongoDB extension
# - sleep 15 # necessary for the mongodb because it does not accept connections immediately
# - mongo testdb --eval "printjson(db.version())"
# - mongo testdb --eval 'db.createUser({user:"travis", pwd:"testpw", roles:["readWrite"]});'
# - mongo testdb --eval 'db.auth({user:"travis", pwd:"testpw"})'
script:
# maven deploy process (builds lucee and deploys to sonatype)
- echo "${TRAVIS_PULL_REQUEST} $TRAVIS_BRANCH $TRAVIS_BUILD_NUMBER $TRAVIS_BUILD_ID "
#- if [ "${TRAVIS_PULL_REQUEST}" == "false" && ${TRAVIS_BRANCH} == "5.2" ]; then always false even both seperatly are true
#- if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
- export DO_DEPLOY="false"
- if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
if [ "${TRAVIS_BRANCH}" == "5.2" ]; then
export DO_DEPLOY="true";
fi
fi
- if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
if [ "${TRAVIS_BRANCH}" == "5.3" ]; then
export DO_DEPLOY="true";
fi
fi
- echo "DO_DEPLOY ${DO_DEPLOY}"
- if [ "${DO_DEPLOY}" == "true" ]; then
echo "------- Maven Deploy -------";
mvn -e -f loader/pom.xml clean deploy --settings travis-settings.xml;
else
echo "------- Maven Install ---------";
mvn -e -f loader/pom.xml clean install --settings travis-settings.xml;
fi
############ increment maven version (not working) ###########
# - mvn --batch-mode -f loader/pom.xml release:update-versions
# - git config --global user.email "${GIT_EMAIL}"
# - git config --global user.name "${GIT_USERNAME}"
# - git config --global user.password "${GIT_PASSWORD}"
# - git add -f loader/pom.xml # add the updated pom
# - git commit -m "update maven version"
# - git remote -v
# - git remote set-url origin https://github.com/lucee/Lucee.git
# - git push origin master
#deploy:
# skip_cleanup: true
notifications:
slack: luceeserver:ZTfbu4bVSLFmakRcLInrNZIT
email:
- michael@lucee.org
- igal@lucee.org
after_success:
# - version=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | egrep -v '^\[|Downloading:' | tr -d ' \n')
- curl "https://update.lucee.org/rest/update/provider/buildLatest"
- curl "https://extension.lucee.org/rest/extension/provider/reset"
- curl "https://download.lucee.org/?type=snapshots&reset=force"
- chmod +x travis-docker-build.sh && ./travis-docker-build.sh
#- git commit -a -m "Committed by Travis-CI build number: $TRAVIS_JOB_ID "