-
Notifications
You must be signed in to change notification settings - Fork 3
Create RPM spec #152
Create RPM spec #152
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,75 @@ | ||
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 | ||
|
||
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` | ||
cache: | ||
directories: | ||
- $HOME/.cache | ||
|
||
# install https download transport for APT | ||
- sudo apt-get -y install apt-transport-https | ||
git: | ||
depth: 100500 | ||
|
||
# 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 | ||
|
||
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 | ||
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 | ||
|
||
script: | ||
- make apidoc-lint | ||
- make test | ||
- git describe --long | ||
- | | ||
if [ -n "${OS}" ]; then | ||
git clone https://github.com/packpack/packpack.git | ||
packpack/packpack | ||
else | ||
./tools/ubuntu.trusty.test.sh | ||
fi; | ||
before_deploy: | ||
- ls -l build/ | ||
|
||
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/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 | ||
sudo yum -y install python27-devel |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
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: tarantool >= 1.9.0.0 | ||
BuildRequires: tarantool-avro-schema >= 2.2.2.4 | ||
BuildRequires: tarantool-shard >= 2.1.0 | ||
BuildRequires: tarantool-http | ||
BuildRequires: python-virtualenv | ||
BuildRequires: tarantool-luacheck | ||
BuildRequires: tarantool-lulpeg | ||
BuildRequires: tarantool-lrexlib-pcre2 | ||
|
||
# Dependencies for a user | ||
Requires: tarantool >= 1.9.0.0 | ||
Requires: tarantool-avro-schema >= 2.0.71 | ||
Requires: tarantool-lulpeg | ||
# Dependencies below are not mandatory, they extend tarantool-graphql | ||
# functionality. Currently we build packages for distros which do not have | ||
# package manager versions which supports Suggests tag. We left section | ||
# below commented till all actual distros will have necessary package manager | ||
# versions. | ||
#Suggests: tarantool-lrexlib-pcre2 | ||
#Suggests: tarantool-shard >= 2.1.0 | ||
#Suggests: tarantool-http | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we need shard, http, lrexlib in Requires? We need them not only for tests There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are optional. Are there recommended packages or like so? If so, we can add they to recommended. Otherwise, I think, we shouldn’t. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great! |
||
%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} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we delete previous installation before installing the new one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess preparing of sandboxed build / install directories (it is not ones where a package will be installed finally, but they has the same directory structure) is rpmbuild task. |
||
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail # Strict shell | ||
|
||
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 | ||
git submodule update --recursive --init | ||
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 apt-get install luarocks | ||
sudo luarocks install luacheck | ||
sudo pip install virtualenv | ||
make test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don’t place anything into .cache explicitly or implicitly, so why? Or docker stores something here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t strongly against, but prefer to understand what and why we have.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Packpack uses it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarification.