Skip to content

Commit bb6f6c0

Browse files
authored
Merge pull request #90 from tarantool/v2
V2
2 parents da1407c + df6ba7d commit bb6f6c0

35 files changed

+3411
-2222
lines changed

.editorconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
# Unix-style newlines with a newline ending every file
5+
[*]
6+
end_of_line = lf
7+
insert_final_newline = true
8+
9+
[CMakeLists.txt]
10+
indent_style = space
11+
indent_size = 4
12+
13+
[*.cmake]
14+
indent_style = space
15+
indent_size = 4
16+
17+
[*.lua]
18+
indent_style = space
19+
indent_size = 4
20+
21+
[*.{h,c,cc}]
22+
indent_style = tab
23+
tab_width = 8

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ install_manifest.txt
1818
VERSION
1919
Testing
2020
CTestTestfile.cmake
21+
*.snap
22+
*.xlog
23+
VERSION.lua
24+
.rocks

.luacheckrc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
redefined = false
2+
include_files = {"**/*.lua", "*.rockspec", "*.luacheckrc"}
3+
exclude_files = {"lua_modules", ".luarocks", ".rocks", "luatest/luaunit.lua", "build"}
4+
new_read_globals = {
5+
'box',
6+
'_TARANTOOL',
7+
'tonumber64',
8+
os = {
9+
fields = {
10+
'environ',
11+
}
12+
},
13+
string = {
14+
fields = {
15+
'split',
16+
'startswith',
17+
},
18+
},
19+
table = {
20+
fields = {
21+
'maxn',
22+
'copy',
23+
'new',
24+
'clear',
25+
'move',
26+
'foreach',
27+
'sort',
28+
'remove',
29+
'foreachi',
30+
'deepcopy',
31+
'getn',
32+
'concat',
33+
'insert',
34+
},
35+
},
36+
}

.travis.yml

Lines changed: 76 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -2,146 +2,92 @@ sudo: false
22
language: C
33
services:
44
- docker
5+
dist: xenial
56

67
cache:
7-
directories:
8-
- $HOME/.cache
8+
directories:
9+
- $HOME/.cache
910

1011
git:
11-
depth: 100500
12+
depth: 100500
1213

1314
env:
14-
global:
15-
- PRODUCT=tarantool-http
15+
global:
16+
- PRODUCT=tarantool-http
1617

17-
matrix:
18-
- OS=el DIST=6
19-
- OS=el DIST=7
20-
- OS=fedora DIST=26
21-
- OS=fedora DIST=27
22-
- OS=fedora DIST=28
23-
- OS=fedora DIST=29
24-
- OS=ubuntu DIST=trusty
25-
- OS=ubuntu DIST=xenial
26-
- OS=ubuntu DIST=bionic
27-
- OS=ubuntu DIST=cosmic
28-
- OS=debian DIST=jessie
29-
- OS=debian DIST=stretch
18+
_test: &test
19+
before_install:
20+
- curl http://download.tarantool.org/tarantool/$TARANTOOL_VERSION/gpgkey | sudo apt-key add -
21+
- echo "deb http://download.tarantool.org/tarantool/$TARANTOOL_VERSION/ubuntu/ xenial main" |
22+
sudo tee /etc/apt/sources.list.d/tarantool.list
23+
- sudo apt-get -y update
24+
- sudo apt-get install -y tarantool tarantool-dev
25+
- tarantoolctl rocks make
26+
- tarantoolctl rocks install luatest 0.2.2
27+
script: .rocks/bin/luatest
3028

31-
script:
32-
- git describe --long
33-
- git clone https://github.com/packpack/packpack.git packpack
34-
- packpack/packpack
29+
_deploy: &deploy
30+
provider: packagecloud
31+
username: tarantool
32+
token: ${PACKAGECLOUD_TOKEN}
33+
dist: ${OS}/${DIST}
34+
package_glob: build/*.{deb,rpm}
35+
skip_cleanup: true
36+
on:
37+
branch: master
38+
condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
3539

36-
before_deploy:
37-
- ls -l build/
40+
_packpack: &packpack
41+
stage: deploy
42+
script:
43+
- git describe --long
44+
- git clone https://github.com/packpack/packpack.git packpack
45+
- packpack/packpack
46+
- ls -l build/
47+
deploy:
48+
# Deploy packages to PackageCloud
49+
- <<: *deploy
50+
repository: "1_7"
51+
- <<: *deploy
52+
repository: "1_9"
53+
- <<: *deploy
54+
repository: "1_10"
55+
- <<: *deploy
56+
repository: "2x"
57+
- <<: *deploy
58+
repository: "2_2"
3859

39-
deploy:
40-
# Deploy packages to PackageCloud from master branch
41-
- provider: packagecloud
42-
username: tarantool
43-
repository: "1_7"
44-
token: ${PACKAGECLOUD_TOKEN}
45-
dist: ${OS}/${DIST}
46-
package_glob: build/*.{deb,rpm}
47-
skip_cleanup: true
48-
on:
49-
branch: master
50-
condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
51-
- provider: packagecloud
52-
username: tarantool
53-
repository: "1_9"
54-
token: ${PACKAGECLOUD_TOKEN}
55-
dist: ${OS}/${DIST}
56-
package_glob: build/*.{deb,rpm}
57-
skip_cleanup: true
58-
on:
59-
branch: master
60-
condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
61-
- provider: packagecloud
62-
username: tarantool
63-
repository: "1_10"
64-
token: ${PACKAGECLOUD_TOKEN}
65-
dist: ${OS}/${DIST}
66-
package_glob: build/*.{deb,rpm}
67-
skip_cleanup: true
68-
on:
69-
branch: master
70-
condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
71-
- provider: packagecloud
72-
username: tarantool
73-
repository: "2x"
74-
token: ${PACKAGECLOUD_TOKEN}
75-
dist: ${OS}/${DIST}
76-
package_glob: build/*.{deb,rpm}
77-
skip_cleanup: true
78-
on:
79-
branch: master
80-
condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
81-
- provider: packagecloud
82-
username: tarantool
83-
repository: "2_2"
84-
token: ${PACKAGECLOUD_TOKEN}
85-
dist: ${OS}/${DIST}
86-
package_glob: build/*.{deb,rpm}
87-
skip_cleanup: true
88-
on:
89-
branch: master
90-
condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
91-
# Deploy packages to PackageCloud from tags
92-
# see:
93-
# * https://github.com/tarantool/tarantool/issues/3745
94-
# * https://github.com/travis-ci/travis-ci/issues/7780#issuecomment-302389370
95-
- provider: packagecloud
96-
username: tarantool
97-
repository: "1_7"
98-
token: ${PACKAGECLOUD_TOKEN}
99-
dist: ${OS}/${DIST}
100-
package_glob: build/*.{deb,rpm}
101-
skip_cleanup: true
102-
on:
103-
tags: true
104-
condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
105-
- provider: packagecloud
106-
username: tarantool
107-
repository: "1_9"
108-
token: ${PACKAGECLOUD_TOKEN}
109-
dist: ${OS}/${DIST}
110-
package_glob: build/*.{deb,rpm}
111-
skip_cleanup: true
112-
on:
113-
tags: true
114-
condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
115-
- provider: packagecloud
116-
username: tarantool
117-
repository: "1_10"
118-
token: ${PACKAGECLOUD_TOKEN}
119-
dist: ${OS}/${DIST}
120-
package_glob: build/*.{deb,rpm}
121-
skip_cleanup: true
122-
on:
123-
tags: true
124-
condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
125-
- provider: packagecloud
126-
username: tarantool
127-
repository: "2x"
128-
token: ${PACKAGECLOUD_TOKEN}
129-
dist: ${OS}/${DIST}
130-
package_glob: build/*.{deb,rpm}
131-
skip_cleanup: true
132-
on:
133-
tags: true
134-
condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
135-
- provider: packagecloud
136-
username: tarantool
137-
repository: "2_2"
138-
token: ${PACKAGECLOUD_TOKEN}
139-
dist: ${OS}/${DIST}
140-
package_glob: build/*.{deb,rpm}
141-
skip_cleanup: true
142-
on:
143-
tags: true
144-
condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
60+
jobs:
61+
include:
62+
- <<: *test
63+
env: TARANTOOL_VERSION=1.10
64+
- <<: *test
65+
env: TARANTOOL_VERSION=2x
66+
67+
- <<: *packpack
68+
env: OS=el DIST=6
69+
- <<: *packpack
70+
env: OS=el DIST=7
71+
- <<: *packpack
72+
env: OS=fedora DIST=26
73+
- <<: *packpack
74+
env: OS=fedora DIST=27
75+
- <<: *packpack
76+
env: OS=fedora DIST=28
77+
- <<: *packpack
78+
env: OS=fedora DIST=29
79+
- <<: *packpack
80+
env: OS=ubuntu DIST=trusty
81+
- <<: *packpack
82+
env: OS=ubuntu DIST=xenial
83+
- <<: *packpack
84+
env: OS=ubuntu DIST=bionic
85+
- <<: *packpack
86+
env: OS=ubuntu DIST=cosmic
87+
- <<: *packpack
88+
env: OS=debian DIST=jessie
89+
- <<: *packpack
90+
env: OS=debian DIST=stretch
14591

14692
notifications:
14793
email:

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8-
- Added options `log_requests` and `log_errors` to `route()` method for customizing request log output and error log output respectively.
8+
### Added
9+
- Major rewrite since version 1.x
10+
- Ability to be used with internal http server and an nginx upstream module
11+
(without modifying the backend code)
12+
- Standardized request object (similar to WSGI)
13+
- A new router with route priorities inspired by Mojolicious
14+
- Middleware support (for e.g. for centrally handling authorization)
915

1016
## [1.0.3] - 2018-06-29
1117
### Added

CMakeLists.txt

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,40 @@ enable_testing()
2121
set (LUA_PATH "LUA_PATH=${PROJECT_SOURCE_DIR}/?.lua\\;${PROJECT_SOURCE_DIR}/?/init.lua\\;\\;")
2222
set (LUA_SOURCE_DIR "LUA_SOURCE_DIR=${PROJECT_SOURCE_DIR}")
2323

24-
add_test(http ${CMAKE_SOURCE_DIR}/test/http.test.lua)
24+
add_test(http ${CMAKE_SOURCE_DIR}/.rocks/bin/luatest)
2525

2626
set_tests_properties(http PROPERTIES ENVIRONMENT "${LUA_PATH};${LUA_SOURCE_DIR}")
2727

2828
# Add `make check`
2929
add_custom_target(check
3030
WORKING_DIRECTORY ${PROJECT_BUILD_DIR}
3131
COMMAND ctest -V)
32+
33+
## VERSION ####################################################################
34+
###############################################################################
35+
36+
execute_process(
37+
COMMAND git describe --tags --always
38+
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
39+
OUTPUT_STRIP_TRAILING_WHITESPACE
40+
OUTPUT_VARIABLE GIT_DESCRIBE
41+
ERROR_QUIET
42+
)
43+
44+
if (NOT GIT_DESCRIBE)
45+
set(GIT_DESCRIBE "unknown")
46+
endif()
47+
48+
configure_file (
49+
"${PROJECT_SOURCE_DIR}/http/VERSION.lua.in"
50+
"${CMAKE_CURRENT_BINARY_DIR}/VERSION.lua"
51+
)
52+
53+
54+
## Install ####################################################################
55+
###############################################################################
56+
57+
install(
58+
FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION.lua
59+
DESTINATION ${TARANTOOL_INSTALL_LUADIR}/${PROJECT_NAME}/
60+
)

0 commit comments

Comments
 (0)