Midstream
This commit is contained in:
23
Makefile
23
Makefile
@@ -49,7 +49,7 @@ dist: $(PYTHON_SDIST) puppet
|
|||||||
sdist: $(PYTHON_SDIST)
|
sdist: $(PYTHON_SDIST)
|
||||||
|
|
||||||
mercy/version.py: version.sh
|
mercy/version.py: version.sh
|
||||||
source version.sh && echo "VERSION=\"$${MAJOR}-$${BUILD}\"" > $@
|
bash -c 'source version.sh && echo "VERSION=\"$${MAJOR}-$${BUILD}\"" > $@'
|
||||||
|
|
||||||
$(PYTHON_SDIST): $(PYTHON_FILES)
|
$(PYTHON_SDIST): $(PYTHON_FILES)
|
||||||
$(PYTHON) setup.py sdist --formats=gztar
|
$(PYTHON) setup.py sdist --formats=gztar
|
||||||
@@ -67,3 +67,24 @@ virtualenv:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
################## /python app
|
################## /python app
|
||||||
|
|
||||||
|
################## Targets for supporting development work
|
||||||
|
|
||||||
|
databases: databases/fda_ndc.zip databases/drugbank.xml.zip
|
||||||
|
|
||||||
|
.PHONY: databases/fda_ndc.zip
|
||||||
|
databases/fda_ndc.zip:
|
||||||
|
rm -fr databases/fda_ndc*
|
||||||
|
mkdir -p databases/fda_ndc
|
||||||
|
rm -f fda_ndc.zip
|
||||||
|
DBPAGE=$$(wget -O - http://www.fda.gov/Drugs/InformationOnDrugs/default.htm --quiet | grep -Eo 'National Drug Code Directory Search(</strong>)*(</a>)*(<br />)*<a href="[a-zA-Z0-9\:/\.]+">More information about the database</a>' | cut -d \" -f 2); \
|
||||||
|
LINK=$$(wget -O - http://www.fda.gov/$${DBPAGE} --quiet | grep ">NDC Database File" | cut -d \" -f 2) ; \
|
||||||
|
wget -O $@ http://www.fda.gov/$${LINK}
|
||||||
|
cd databases/fda_ndc && unzip -e ../fda_ndc.zip
|
||||||
|
|
||||||
|
.PHONY: databases/drugbank.xml.zip
|
||||||
|
databases/drugbank.xml.zip:
|
||||||
|
rm -fr databases/drugbank*
|
||||||
|
mkdir -p databases/drugbank
|
||||||
|
wget -O $@ http://www.drugbank.ca/system/downloads/current/drugbank.xml.zip
|
||||||
|
cd databases/drugbank && unzip -e ../drugbank.xml.zip
|
||||||
@@ -9,7 +9,7 @@ Requirements
|
|||||||
This puppet module assumes that you have:
|
This puppet module assumes that you have:
|
||||||
|
|
||||||
* A RabbitMQ broker that we can use for Celery tasks
|
* A RabbitMQ broker that we can use for Celery tasks
|
||||||
* Working apache on localhost with a puppet service we can notify
|
* Working apache on localhost, with mod_wsgi enabled and with a puppet service we can notify
|
||||||
* Working python 2.7 and pip on localhost
|
* Working python 2.7 and pip on localhost
|
||||||
* Working postgres with a username, password, and database for mercy to use
|
* Working postgres with a username, password, and database for mercy to use
|
||||||
|
|
||||||
@@ -20,20 +20,25 @@ Usage
|
|||||||
|
|
||||||
class { 'mercy':
|
class { 'mercy':
|
||||||
# ---- These are required, they have no defaults
|
# ---- These are required, they have no defaults
|
||||||
environment => 'dev|production',
|
environment => 'dev|production',
|
||||||
version => 'absent|latest|MAJOR-MINOR',
|
version => 'absent|latest|MAJOR-MINOR',
|
||||||
ensure => 'running|stopped'.
|
ensure => 'running|stopped'.
|
||||||
rabbitmq_uri => 'RABBITMQ_BROKER_URI',
|
rabbitmq_uri => 'RABBITMQ_BROKER_URI',
|
||||||
# ---- Everything below is optional
|
# ---- Everything below is optional
|
||||||
rabbitmq_user => 'mercy',
|
process_user => 'mercy',
|
||||||
rabbitmq_pw => 'mercy',
|
process_group => 'mercy',
|
||||||
rabbitmq_vhost => 'mercy',
|
process_threads => 5,
|
||||||
vhost_dir => '/etc/apache/httpd/conf.d',
|
servername => $::fqdn,
|
||||||
apache_service => 'httpd',
|
rabbitmq_user => 'mercy',
|
||||||
postgres_uri => 'localhost',
|
rabbitmq_pw => 'mercy',
|
||||||
postgres_user => 'mercy',
|
rabbitmq_vhost => 'mercy',
|
||||||
postgres_pw => 'mercy',
|
vhost_dir => '/etc/apache/httpd/conf.d',
|
||||||
postgres_db => 'mercy'
|
apache_service => 'httpd',
|
||||||
|
port => 443,
|
||||||
|
postgres_uri => 'localhost',
|
||||||
|
postgres_user => 'mercy',
|
||||||
|
postgres_pw => 'mercy',
|
||||||
|
postgres_db => 'mercy'
|
||||||
}
|
}
|
||||||
|
|
||||||
If 'environment' is dev, then the mercy application will be installed via a tarball located in ./mercy/files/mercy-${ensure}.tar.gz. If 'environment' is production, then mercy will be installed via pip and ensured at the given version.
|
If 'environment' is dev, then the mercy application will be installed via a tarball located in ./mercy/files/mercy-${ensure}.tar.gz. If 'environment' is production, then mercy will be installed via pip and ensured at the given version.
|
||||||
|
|||||||
5
setup.py
5
setup.py
@@ -13,7 +13,10 @@ if __name__ == "__main__":
|
|||||||
author=("Andrew Kesterson"),
|
author=("Andrew Kesterson"),
|
||||||
author_email="andrew@aklabs.net",
|
author_email="andrew@aklabs.net",
|
||||||
license="MIT",
|
license="MIT",
|
||||||
install_requires=["flask", "sqlalchemy"],
|
install_requires=["flask",
|
||||||
|
"sqlalchemy",
|
||||||
|
"alembic",
|
||||||
|
"psycopg2"],
|
||||||
scripts=[],
|
scripts=[],
|
||||||
packages=["mercy"],
|
packages=["mercy"],
|
||||||
data_files=[],
|
data_files=[],
|
||||||
|
|||||||
Reference in New Issue
Block a user