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

Create RPM spec #152

Merged
merged 4 commits into from
Jul 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ doc/apidoc
# benchmarks results
bench.*.result.txt

# packpack build directory
/build

# temporary directory for make apidoc-lint
doc/apidoc-lint-tmp
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "test-run"]
path = test-run
url = https://github.com/tarantool/test-run.git
[submodule "3rd_party/packpack"]
path = 3rd_party/packpack
url = https://github.com/packpack/packpack.git
123 changes: 67 additions & 56 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,76 @@
language: c

sudo: true
sudo: required

dist: trusty
services:
- docker

env:
- SHARD_VERSION=1.2 AVRO_SCHEMA=2.3.2
- SHARD_VERSION=2.1 AVRO_SCHEMA=2.3.2
- SHARD_VERSION=1.2 AVRO_SCHEMA=3.0.0
- SHARD_VERSION=2.1 AVRO_SCHEMA=3.0.0

branches:
only:
- master
cache:
directories:
- $HOME/.cache

before_install:
- sudo apt-get -qq update
- curl http://download.tarantool.org/tarantool/1.9/gpgkey |
sudo apt-key add -release=`lsb_release -c -s`
git:
depth: 100500

# install https download transport for APT
- sudo apt-get -y install apt-transport-https
env:
matrix:
- OS=el DIST=6
- OS=el DIST=7
- OS=fedora DIST=26
- OS=fedora DIST=27
- SHARD_VERSION=1.2 AVRO_SCHEMA=2.3.2
- SHARD_VERSION=2.1 AVRO_SCHEMA=2.3.2
- SHARD_VERSION=1.2 AVRO_SCHEMA=3.0.0
- SHARD_VERSION=2.1 AVRO_SCHEMA=3.0.0

# append two lines to a list of source repositories
- sudo rm -f /etc/apt/sources.list.d/*tarantool*.list
- echo "deb http://download.tarantool.org/tarantool/1.9/ubuntu/ trusty main" |
sudo tee /etc/apt/sources.list.d/tarantool_1_9.list
- echo "deb-src http://download.tarantool.org/tarantool/1.9/ubuntu/ trusty main" |
sudo tee -a /etc/apt/sources.list.d/tarantool_1_9.list
script:
- git describe --long
- |
if [ -n "${OS}" ]; then
git submodule update --recursive --init
./3rd_party/packpack/packpack
else
./tools/ubuntu.trusty.test.sh
fi

install:
- sudo apt-get update
- sudo apt-get -y install tarantool tarantool-dev
- cd ..
- git clone https://github.com/rtsisyk/msgpuck
- cd msgpuck
- cmake .
- sudo make install
- cd ..
- tarantoolctl rocks install shard "${SHARD_VERSION}"
- tarantoolctl rocks install avro-schema "${AVRO_SCHEMA}"
- cd graphql
- git submodule update --recursive --init
- tarantoolctl rocks install lulpeg
- tarantoolctl rocks install lrexlib-pcre
- tarantoolctl rocks install http
- cd ..
# lua (with dev headers) is necessary for luacheck
- sudo apt-get install lua5.1
- sudo apt-get install liblua5.1-0-dev
- wget "http://luarocks.github.io/luarocks/releases/luarocks-2.4.4.tar.gz"
- tar xf luarocks-2.4.4.tar.gz
- cd luarocks-2.4.4
- ./configure
- make build
- sudo make install
- cd ../graphql
- sudo luarocks install luacheck
- sudo pip install virtualenv
- sudo luarocks install ldoc
before_deploy:
- ls -l build/

script:
- make apidoc-lint
- make test
deploy:
# Deploy packages to PackageCloud
- provider: packagecloud
username: ${PACKAGECLOUD_USER}
repository: "1_9"
token: ${PACKAGECLOUD_TOKEN}
dist: ${OS}/${DIST}
package_glob: build/*.{rpm,deb}
skip_cleanup: true
on:
branch: master
condition: -n "${OS}"
- provider: packagecloud
username: ${PACKAGECLOUD_USER}
repository: "1_10"
token: ${PACKAGECLOUD_TOKEN}
dist: ${OS}/${DIST}
package_glob: build/*.{rpm,deb}
skip_cleanup: true
on:
branch: master
condition: -n "${OS}"
- provider: packagecloud
username: ${PACKAGECLOUD_USER}
repository: "2_0"
token: ${PACKAGECLOUD_TOKEN}
dist: ${OS}/${DIST}
package_glob: build/*.{rpm,deb}
skip_cleanup: true
on:
branch: master
condition: -n "${OS}"
notifications:
email:
recipients:
- [email protected]
on_success: change
on_failure: always
1 change: 1 addition & 0 deletions 3rd_party/packpack
Submodule packpack added at 30ff7b
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,7 @@ serve-apidoc: apidoc
.PHONY: demo
demo:
./demo/demo.lua $(TESTDATA)

.PHONY: rpm
rpm:
OS=el DIST=7 ./3rd_party/packpack/packpack
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,18 +374,19 @@ make test
* For use:
* tarantool,
* lulpeg,
* >=tarantool/avro-schema-2.0-71-gfea0ead,
* >=tarantool/shard-1.1-91-gfa88bf8 (but < 2.0) or
>=tarantool/shard-2.1-0-g0a7d98f (optional),
* \>=tarantool/avro-schema-2.0-71-gfea0ead,
* \>=tarantool/shard-1.1-91-gfa88bf8 (but < 2.0) or
\>=tarantool/shard-2.1-0-g0a7d98f (optional),
* lrexlib-pcre2 or lrexlib-pcre (optional),
* tarantool/http (optional, for GraphiQL).
* For test (additionally to 'for use'):
* python 2.7,
* virtualenv,
* luacheck,
* >=tarantool/avro-schema-2.2.2-4-g1145e3e,
* >=tarantool/shard-1.1-92-gec1a27e (but < 2.0) or
>=tarantool/shard-2.1-0-g0a7d98f,
* \>=tarantool/avro-schema-2.2.2-4-g1145e3e,
* \>=tarantool/shard-1.1-92-gec1a27e (but < 2.0) or
\>=tarantool/shard-2.1-0-g0a7d98f,
* lrexlib-pcre2 or lrexlib-pcre,
* tarantool/http.
* For building apidoc (additionally to 'for use'):
* ldoc.
Expand Down
6 changes: 6 additions & 0 deletions rpm/prebuild-el-6.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

set -exu # Strict shell (w/o -o pipefail)

sudo yum -y install https://centos6.iuscommunity.org/ius-release.rpm
sudo yum -y install python27 python27-devel
70 changes: 70 additions & 0 deletions rpm/tarantool-graphql.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Name: tarantool-graphql
# During package building {version} is overwritten by Packpack with
# VERSION. It is set to major.minor.patch.number_of_commits_above_last_tag.
# major.minor.patch tag and number of commits above are taken from the
# github repository: https://github.com/tarantool/graphql
Version: 0.0.1
Release: 1%{?dist}
Summary: Set of adapters for GraphQL query language to the Tarantool data model
Group: Applications/Databases
License: BSD
URL: https://github.com/tarantool/graphql
Source0: https://github.com/tarantool/graphql/archive/%{version}/graphql-%{version}.tar.gz
BuildArch: noarch

# Dependencies for `make test`
BuildRequires: python-virtualenv
BuildRequires: tarantool-luacheck
BuildRequires: tarantool >= 1.9.0.0
BuildRequires: tarantool-lulpeg
BuildRequires: tarantool-avro-schema >= 2.2.2.4
BuildRequires: tarantool-shard >= 1.1.92
BuildRequires: tarantool-lrexlib-pcre2
BuildRequires: tarantool-http

# Weak references are not supported in RHEL / CentOS.
#
# https://fedoraproject.org/wiki/Packaging:WeakDependencies
# https://bugzilla.redhat.com/show_bug.cgi?id=91458
# https://bugzilla.redhat.com/show_bug.cgi?id=1427674

# Dependencies for a user
Requires: tarantool >= 1.9.0.0
Requires: tarantool-lulpeg
Requires: tarantool-avro-schema >= 2.0.71
#Suggests: tarantool-shard >= 1.1.91
#Suggests: tarantool-lrexlib-pcre2
#Suggests: tarantool-http

%description
Set of adapters for GraphQL query language to the Tarantool data model

# /usr/share/tarantool
%define module_dir %{_datadir}/tarantool
%define br_module_dir %{buildroot}%{module_dir}

%prep
%setup -q -n %{name}-%{version}

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

%install
mkdir -p %{br_module_dir}
cp -r graphql %{br_module_dir}

%files
%{module_dir}/graphql

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

* Sun May 20 2018 Alexander Turenko <[email protected]> 0.0.0-1
- Create pseudo-release 0.0.0 for testing deployment
33 changes: 33 additions & 0 deletions tools/ubuntu.trusty.test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh

set -exu # Strict shell (w/o -o pipefail)

sudo apt-get -qq update
curl http://download.tarantool.org/tarantool/1.9/gpgkey | \
sudo apt-key add -
release=`lsb_release -c -s`

# install https download transport for APT
sudo apt-get -y install apt-transport-https

# append two lines to a list of source repositories
sudo rm -f /etc/apt/sources.list.d/*tarantool*.list
echo "deb http://download.tarantool.org/tarantool/1.9/ubuntu/ ${release} main" | \
sudo tee /etc/apt/sources.list.d/tarantool_1_9.list
echo "deb-src http://download.tarantool.org/tarantool/1.9/ubuntu/ ${release} main" | \
sudo tee -a /etc/apt/sources.list.d/tarantool_1_9.list

sudo apt-get update
sudo apt-get -y install tarantool tarantool-dev libmsgpuck-dev luarocks

tarantoolctl rocks install lulpeg
tarantoolctl rocks install lrexlib-pcre
tarantoolctl rocks install http
tarantoolctl rocks install shard "${SHARD_VERSION}"
tarantoolctl rocks install avro-schema "${AVRO_SCHEMA}"

sudo luarocks install luacheck
sudo pip install virtualenv

git submodule update --recursive --init
make test