Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Commit a2e0cae

Browse files
committed
Fixed .spec to use rpms instead of prebuildes
dependencies, added deploy to travis.
1 parent 5cea913 commit a2e0cae

File tree

7 files changed

+160
-115
lines changed

7 files changed

+160
-115
lines changed

.travis.yml

+69-57
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,77 @@
11
language: c
22

3-
sudo: true
3+
sudo: required
44

5-
dist: trusty
5+
services:
6+
- docker
67

7-
env:
8-
- SHARD_VERSION=1.2 AVRO_SCHEMA=2.3.2
9-
- SHARD_VERSION=2.1 AVRO_SCHEMA=2.3.2
10-
- SHARD_VERSION=1.2 AVRO_SCHEMA=3.0.0
11-
- SHARD_VERSION=2.1 AVRO_SCHEMA=3.0.0
12-
13-
branches:
14-
only:
15-
- master
16-
17-
before_install:
18-
- sudo apt-get -qq update
19-
- curl http://download.tarantool.org/tarantool/1.9/gpgkey |
20-
sudo apt-key add -release=`lsb_release -c -s`
8+
cache:
9+
directories:
10+
- $HOME/.cache
2111

22-
# install https download transport for APT
23-
- sudo apt-get -y install apt-transport-https
12+
git:
13+
depth: 100500
2414

25-
# append two lines to a list of source repositories
26-
- sudo rm -f /etc/apt/sources.list.d/*tarantool*.list
27-
- echo "deb http://download.tarantool.org/tarantool/1.9/ubuntu/ trusty main" |
28-
sudo tee /etc/apt/sources.list.d/tarantool_1_9.list
29-
- echo "deb-src http://download.tarantool.org/tarantool/1.9/ubuntu/ trusty main" |
30-
sudo tee -a /etc/apt/sources.list.d/tarantool_1_9.list
31-
32-
install:
33-
- sudo apt-get update
34-
- sudo apt-get -y install tarantool tarantool-dev
35-
- cd ..
36-
- git clone https://github.com/rtsisyk/msgpuck
37-
- cd msgpuck
38-
- cmake .
39-
- sudo make install
40-
- cd ..
41-
- tarantoolctl rocks install shard "${SHARD_VERSION}"
42-
- tarantoolctl rocks install avro-schema "${AVRO_SCHEMA}"
43-
- cd graphql
44-
- git submodule update --recursive --init
45-
- tarantoolctl rocks install lulpeg
46-
- tarantoolctl rocks install lrexlib-pcre
47-
- tarantoolctl rocks install http
48-
- cd ..
49-
# lua (with dev headers) is necessary for luacheck
50-
- sudo apt-get install lua5.1
51-
- sudo apt-get install liblua5.1-0-dev
52-
- wget "http://luarocks.github.io/luarocks/releases/luarocks-2.4.4.tar.gz"
53-
- tar xf luarocks-2.4.4.tar.gz
54-
- cd luarocks-2.4.4
55-
- ./configure
56-
- make build
57-
- sudo make install
58-
- cd ../graphql
59-
- sudo luarocks install luacheck
60-
- sudo pip install virtualenv
61-
- sudo luarocks install ldoc
15+
env:
16+
global:
17+
- PRODUCT=tarantool-graphql
18+
matrix:
19+
- OS=el DIST=6
20+
- OS=el DIST=7
21+
- OS=fedora DIST=26
22+
- OS=fedora DIST=27
23+
- SHARD_VERSION=1.2 AVRO_SCHEMA=2.3.2
24+
- SHARD_VERSION=2.1 AVRO_SCHEMA=2.3.2
25+
- SHARD_VERSION=1.2 AVRO_SCHEMA=3.0.0
26+
- SHARD_VERSION=2.1 AVRO_SCHEMA=3.0.0
6227

6328
script:
64-
- make apidoc-lint
65-
- make test
29+
- git describe --long
30+
- |
31+
if [ -n "${OS}" ]; then
32+
git clone https://github.com/packpack/packpack.git
33+
packpack/packpack
34+
else
35+
./tools/ubuntu.trusty.test.sh
36+
fi;
37+
before_deploy:
38+
- ls -l build/
39+
40+
deploy:
41+
# Deploy packages to PackageCloud
42+
- provider: packagecloud
43+
username: ${PACKAGECLOUD_USER}
44+
repository: "1_9"
45+
token: ${PACKAGECLOUD_TOKEN}
46+
dist: ${OS}/${DIST}
47+
package_glob: build/*.{rpm,deb}
48+
skip_cleanup: true
49+
on:
50+
branch: master
51+
condition: -n "${OS}"
52+
- provider: packagecloud
53+
username: ${PACKAGECLOUD_USER}
54+
repository: "1_10"
55+
token: ${PACKAGECLOUD_TOKEN}
56+
dist: ${OS}/${DIST}
57+
package_glob: build/*.{rpm,deb}
58+
skip_cleanup: true
59+
on:
60+
branch: master
61+
condition: -n "${OS}"
62+
- provider: packagecloud
63+
username: ${PACKAGECLOUD_USER}
64+
repository: "2_0"
65+
token: ${PACKAGECLOUD_TOKEN}
66+
dist: ${OS}/${DIST}
67+
package_glob: build/*.{rpm,deb}
68+
skip_cleanup: true
69+
on:
70+
branch: master
71+
condition: -n "${OS}"
72+
notifications:
73+
email:
74+
recipients:
75+
76+
on_success: change
77+
on_failure: always

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ lint:
2424

2525
.PHONY: test
2626
test: lint
27-
virtualenv -p python2.7 ./.env-2.7
28-
. ./.env-2.7/bin/activate && \
27+
virtualenv -p python2 ./.env-2
28+
. ./.env-2/bin/activate && \
2929
pip install -r ./test-run/requirements.txt && \
3030
pip install tarantool && \
3131
cd test && ./test-run.py

graphql/accessor_general.lua

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
---
44
--- It provides basic logic for such space-like data storages and abstracted
55
--- away from details from where tuples are arrived into the application.
6+
package.cpath = package.cpath .. ";/usr/share/tarantool/pcre2/?.so"
67

78
local ffi = require('ffi')
89
local json = require('json')

graphql/core/parse.lua

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
package.path = package.path .. ";/usr/share/tarantool/lulpeg/?.lua"
12
local lpeg = require 'lulpeg'
23
local P, R, S, V = lpeg.P, lpeg.R, lpeg.S, lpeg.V
34
local C, Ct, Cmt, Cg, Cc, Cf, Cmt = lpeg.C, lpeg.Ct, lpeg.Cmt, lpeg.Cg, lpeg.Cc, lpeg.Cf, lpeg.Cmt

rpm/prebuild-el-7.sh

-42
This file was deleted.

rpm/tarantool-graphql.spec

+27-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Name: tarantool-graphql
2-
Version: 0.0.0
2+
# During package building {version} is overwritten by Packpack with
3+
# VERSION. It is set to major.minor.patch.number_of_commits_above_last_tag.
4+
# major.minor.patch tag and number of commits above are taken from the
5+
# github repository: https://github.com/tarantool/graphql
6+
Version: 0.0.1
37
Release: 1%{?dist}
48
Summary: Set of adapters for GraphQL query language to the Tarantool data model
59
Group: Applications/Databases
@@ -10,21 +14,22 @@ BuildArch: noarch
1014

1115
# Dependencies for `make test`
1216
BuildRequires: tarantool >= 1.9.0.0
13-
#BuildRequires: tarantool-avro-schema >= 2.2.2.4, tarantool-avro-schema < 3.0.0.0
14-
#BuildRequires: tarantool-shard >= 2.1.0
17+
BuildRequires: tarantool-avro-schema >= 2.2.2.4
18+
BuildRequires: tarantool-shard >= 2.1.0
19+
BuildRequires: tarantool-http
1520
BuildRequires: python-virtualenv
16-
# Dependencies were installed in rpm/prebuild-el-7.sh:
17-
# * luacheck
18-
# * lulpeg
19-
# * lrexlib-pcre2
20-
# * avro-schema
21-
# * shard
22-
# * http
21+
BuildRequires: tarantool-luacheck
22+
BuildRequires: tarantool-lulpeg
23+
BuildRequires: tarantool-lrexlib-pcre2
2324

2425
# Dependencies for a user
2526
Requires: tarantool >= 1.9.0.0
26-
#Requires: tarantool-avro-schema >= 2.0.71, tarantool-avro-schema < 3.0.0.0
27-
#Requires: lulpeg
27+
Requires: tarantool-avro-schema >= 2.0.0
28+
Requires: tarantool-lulpeg
29+
#Suggests: tarantool-lrexlib-pcre2
30+
#Suggests: tarantool-shard
31+
#Suggests: tarantool-http
32+
#Suggests: tarantool-avro-schema
2833

2934
%description
3035
Set of adapters for GraphQL query language to the Tarantool data model
@@ -37,6 +42,12 @@ Set of adapters for GraphQL query language to the Tarantool data model
3742
%setup -q -n %{name}-%{version}
3843

3944
%check
45+
# Originally 'check' section is executed in
46+
# /build/usr/src/degub/tarantool-graphql directory.
47+
# It makes names of unix sockets too long and therefore tests fail.
48+
# To avoid it we copy sources to /build/graphql and run tests there.
49+
cp -R . /build/graphql
50+
cd /build/graphql
4051
make test
4152

4253
%install
@@ -47,6 +58,8 @@ cp -r graphql %{br_module_dir}
4758
%{module_dir}/graphql
4859

4960
%changelog
61+
* Thu Jul 12 2018 Ivan Koptelov <[email protected]> 0.0.1-1
62+
- Initial release 0.0.1
5063

51-
* Sun May 20 2018 Alexander Turenko <[email protected]>
52-
- create pseudo-release 0.0.0 for testing deployment
64+
* Sun May 20 2018 Alexander Turenko <[email protected]> 0.0.0-1
65+
- Create pseudo-release 0.0.0 for testing deployment

tools/ubuntu.trusty.test.sh

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env bash
2+
3+
set -euxo pipefail # Strict shell
4+
5+
#sudo apt-get -qq update
6+
#curl http://download.tarantool.org/tarantool/1.9/gpgkey |
7+
#sudo apt-key add -release=`lsb_release -c -s`
8+
9+
# install https download transport for APT
10+
#sudo apt-get -y install apt-transport-https
11+
12+
#curl -s https://packagecloud.io/install/repositories/tarantool/1_7/script.deb.sh | sudo bash
13+
#sudo apt-get update > /dev/null
14+
#sudo apt-get -q -y install tarantool tarantool-dev
15+
16+
sudo apt-get -qq update
17+
curl http://download.tarantool.org/tarantool/1.9/gpgkey |
18+
sudo apt-key add -release=`lsb_release -c -s`
19+
20+
# install https download transport for APT
21+
sudo apt-get -y install apt-transport-https
22+
23+
# append two lines to a list of source repositories
24+
sudo rm -f /etc/apt/sources.list.d/*tarantool*.list
25+
echo "deb http://download.tarantool.org/tarantool/1.9/ubuntu/ trusty main" |
26+
sudo tee /etc/apt/sources.list.d/tarantool_1_9.list
27+
echo "deb-src http://download.tarantool.org/tarantool/1.9/ubuntu/ trusty main" |
28+
sudo tee -a /etc/apt/sources.list.d/tarantool_1_9.list
29+
30+
sudo apt-get update > /dev/null
31+
sudo apt-get -q -y install tarantool tarantool-dev
32+
33+
cd ..
34+
git clone https://github.com/rtsisyk/msgpuck
35+
cd msgpuck
36+
cmake .
37+
sudo make install
38+
cd ..
39+
cd graphql
40+
git submodule update --recursive --init
41+
tarantoolctl rocks install lulpeg
42+
tarantoolctl rocks install lrexlib-pcre
43+
tarantoolctl rocks install http
44+
tarantoolctl rocks install shard "${SHARD_VERSION}"
45+
tarantoolctl rocks install avro-schema "${AVRO_SCHEMA}"
46+
cd ..
47+
# lua (with dev headers) is necessary for luacheck
48+
# maybe we can use tarantool headers?
49+
sudo apt-get install lua5.1
50+
sudo apt-get install liblua5.1-0-dev
51+
wget "http://luarocks.github.io/luarocks/releases/luarocks-2.4.4.tar.gz"
52+
tar xf luarocks-2.4.4.tar.gz
53+
cd luarocks-2.4.4
54+
./configure
55+
make build
56+
sudo make install
57+
cd ../graphql
58+
sudo luarocks install luacheck
59+
sudo pip install virtualenv
60+
make test

0 commit comments

Comments
 (0)