Skip to content

Commit

Permalink
Merge 2504c64 into 20cc67b
Browse files Browse the repository at this point in the history
  • Loading branch information
slint committed May 16, 2018
2 parents 20cc67b + 2504c64 commit d4bf34d
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 13 deletions.
34 changes: 30 additions & 4 deletions .travis.yml
Expand Up @@ -19,14 +19,40 @@ matrix:
cache:
- pip

services:
- mysql
- postgresql
- redis
- rabbitmq

addons:
postgresql: "9.6"

env:
global:
- E2E="no"
matrix:
- COOKIECUTTER_DATABASE=postgresql COOKIECUTTER_ELASTICSEARCH=elasticsearch5 ES_VERSION=5.6.4
- COOKIECUTTER_DATABASE=mysql COOKIECUTTER_ELASTICSEARCH=elasticsearch5 ES_VERSION=5.6.4
- COOKIECUTTER_DATABASE=postgresql COOKIECUTTER_ELASTICSEARCH=elasticsearch6 ES_VERSION=6.2.2
- COOKIECUTTER_DATABASE=mysql COOKIECUTTER_ELASTICSEARCH=elasticsearch6 ES_VERSION=6.2.2

python:
- "2.7"
- "3.5"

before_install:
- "travis_retry pip install --upgrade pip"
- "travis_retry pip install cookiecutter"
- "travis_retry pip install Sphinx>=1.4.2"
- mkdir /tmp/elasticsearch
- "wget -O - https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz | tar xz --directory=/tmp/elasticsearch --strip-components=1"
- "/tmp/elasticsearch/bin/elasticsearch > /tmp/local-es.log &"
- "nvm install 6; nvm use 6"
- "travis_retry pip install --upgrade pip setuptools py"
- "travis_retry pip install cookiecutter twine wheel coveralls requirements-builder sphinx"

before_script:
# Allow ES to start
- sleep 10
- wget -q --waitretry=1 --retry-connrefused -T 10 -O - http://127.0.0.1:9200 && echo "Elasticsearch is up!" || cat /tmp/local-es.log


script:
- "./run-tests.sh"
8 changes: 4 additions & 4 deletions run-tests.sh
Expand Up @@ -13,6 +13,7 @@ set -o errexit
# quit on unbound symbols:
set -o nounset


WORKDIR=$(mktemp -d)

function finish {
Expand All @@ -26,16 +27,15 @@ trap finish EXIT
sphinx-build -qnN docs docs/_build/html
cookiecutter --no-input -o "$WORKDIR" . \
project_name=Generated-Fun \
database=postgresql \
elasticsearch=elasticsearch6
database=${COOKIECUTTER_DATABASE:-postgresql} \
elasticsearch=${COOKIECUTTER_ELASTICSEARCH:-elasticsearch6}

cd "${WORKDIR}/generated-fun"

git init
git add -A

pip install -e .\[all\] --quiet
./scripts/bootstrap

check-manifest -u || true

./run-tests.sh
4 changes: 2 additions & 2 deletions {{cookiecutter.project_shortname}}/Dockerfile
Expand Up @@ -3,7 +3,7 @@ FROM python:3.5

RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install -y git curl vim
RUN pip install --upgrade setuptools wheel pip uwsgi
RUN pip install --upgrade setuptools wheel pip uwsgi uwsgitop uwsgi-tools

# Install Node
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
Expand All @@ -29,7 +29,7 @@ RUN if [ "$ENVIRONMENT" = "PROD" ]; then pip install -r requirements-pinned.txt;

# Install/create static files
RUN mkdir -p ${INVENIO_INSTANCE_PATH}
RUN ./scripts/boostrap
RUN ./scripts/boostrap ${WORKING_DIR}

# copy uwsgi config files
COPY ./docker/uwsgi/ ${INVENIO_INSTANCE_PATH}
Expand Down
5 changes: 3 additions & 2 deletions {{cookiecutter.project_shortname}}/scripts/bootstrap
Expand Up @@ -3,13 +3,14 @@
set -e

pip install -r requirements.txt
pip install -e .
pip install -e .[all]

npm update && npm install --silent -g node-sass@3.8.0 clean-css@3.4.19 uglify-js@2.7.3 requirejs@2.2.0

CWD=`pwd`
invenio npm
cd ${VIRTUAL_ENV}/var/instance/static
python_prefix=$(python -c "import sys; print(sys.prefix)")
cd ${1-$python_prefix}/var/instance/static
npm install
cd ${CWD}
invenio collect -v
Expand Down
1 change: 0 additions & 1 deletion {{cookiecutter.project_shortname}}/setup.py
Expand Up @@ -51,7 +51,6 @@
'Flask-Debugtoolbar>=0.10.1',
'invenio[{db},{es},base,auth,metadata]~={version}'.format(
db=DATABASE, es=ELASTICSEARCH, version=INVENIO_VERSION),
'uwsgi>=2.0.15',
]

packages = find_packages()
Expand Down

0 comments on commit d4bf34d

Please sign in to comment.