forked from mghadiri/imposm3-for-windows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
136 lines (111 loc) · 3.72 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
dist: trusty
sudo: false
language: go
go:
- "1.9.x"
- "1.10.x"
- "1.12.x"
- "1.13.x" # we use this for releases, see deploy.on.condition below
- tip
matrix:
allow_failures:
- go: tip
fast_finish: true
env:
global:
- GEOS_VERSION=3.7.3
- LEVELDB_VERSION=1.22
# NOTE increase DEPS_REVISION everytime one of the compiled deps changes!
- DEPS_REVISION=3
# PREFIX is where we install our compiled deps
- PREFIX=${HOME}/local-${DEPS_REVISION}
# tell Go to find our compiled deps
- CGO_CFLAGS=-I${PREFIX}/include
- CGO_LDFLAGS=-L${PREFIX}/lib
- LD_LIBRARY_PATH=${PREFIX}/lib
# PKG_DIR is where we assemble the final package for releases
- PKG_DIR=/tmp/imposm_packaging
- PGUSER=postgres
# enable ccache by updating PATH
- PATH=/usr/lib/ccache:$PATH
- CCACHE_TEMPDIR=/tmp/.ccache-temp
cache:
directories:
- ${HOME}/.ccache
- ${PREFIX}
addons:
postgresql: "9.5"
apt:
# List of whitelisted in travis packages for ubuntu-trusty can be found here:
# https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-trusty
packages:
- postgresql-9.5-postgis-2.3
- osmosis
- chrpath
before_script:
- psql -U postgres -c 'create database travis' || true
- psql -U postgres -c "create extension if not exists postgis"
- psql -U postgres -c "create extension if not exists hstore"
before_install:
- echo "TRAVIS_GO_VERSION = " ${TRAVIS_GO_VERSION}
- ccache --show-stats
# build GEOS
- |
if [[ ! -e ${PREFIX}/lib/libgeos_c.so ]]; then
curl -fsSL http://download.osgeo.org/geos/geos-${GEOS_VERSION}.tar.bz2 | \
tar -jxf - -C ${HOME}/build
cd ${HOME}/build/geos-${GEOS_VERSION}
./configure --prefix=$PREFIX
make -j2
make install
fi
# build LevelDB
- |
if [[ ! -e ${PREFIX}/lib/libleveldb.so ]]; then
mkdir -p ${HOME}/build/leveldb
curl -fsSL https://github.com/google/leveldb/archive/${LEVELDB_VERSION}.tar.gz | \
tar -zxf - --strip-components 1 -C ${HOME}/build/leveldb
mkdir -p ${HOME}/build/leveldb/build
cd ${HOME}/build/leveldb/build
cmake .. -DBUILD_SHARED_LIBS=1 -DCMAKE_BUILD_TYPE=Release && make -j 2
mkdir -p ${PREFIX}/{lib,include}
cp -R ${HOME}/build/leveldb/build/liblevel* ${PREFIX}/lib/
cp -R ${HOME}/build/leveldb/include/leveldb ${PREFIX}/include/
fi
- ccache --show-stats
script:
- cd ${TRAVIS_BUILD_DIR}
- LEVELDB_POST_121=1 make
before_deploy:
- cd ${TRAVIS_BUILD_DIR}
- mkdir -p ${PKG_DIR}/lib
# copy files
- cp imposm ${PKG_DIR}
- ln -s imposm ${PKG_DIR}/imposm3
- cp README.md ${PKG_DIR}
- cp example-mapping.json ${PKG_DIR}/mapping.json
# copy/link libs
- cd ${PREFIX}/lib
- cp libgeos_c.so ${PKG_DIR}/lib
- ln -s libgeos_c.so ${PKG_DIR}/lib/libgeos_c.so.1
- cp libgeos.so ${PKG_DIR}/lib
- ln -s libgeos.so ${PKG_DIR}/lib/libgeos-${GEOS_VERSION}.so
- cp -R libleveldb.so* ${PKG_DIR}/lib
# update RPATH of libgeos_c.so so that is points to our libgeos.so
- chrpath ${PKG_DIR}/lib/libgeos_c.so -r '${ORIGIN}'
# create tar.gz
- BUILD_VERSION=`${PKG_DIR}/imposm version`-linux-x86-64
- mv ${PKG_DIR} /tmp/imposm-${BUILD_VERSION}
- cd /tmp && tar zcvf imposm-${BUILD_VERSION}.tar.gz imposm-${BUILD_VERSION}
# move back to build dir for deploy
- cd ${TRAVIS_BUILD_DIR}
deploy:
provider: releases
api_key:
secure: BLksCdG9x/D3Giprtq1VtFGQSF2k9+0OjeOL2bjAaf/4mFho1IDGsJlsOEKBNUngacHIB2udoHeta4Cijs6NLCQrzHcO1la6djF/HYJ5oCFkM7RxPWK5Zim4b2FB8ktVEX20VOjPpsDrBi56P97YI7bVVrOaSThashz4bpj/3Z4=
file: /tmp/imposm-${BUILD_VERSION}.tar.gz
skip_cleanup: true
on:
repo: omniscale/imposm3
tags: true
condition: $TRAVIS_GO_VERSION =~ ^1\.13