Files
cellxgene/server/eb/Makefile
bmccandless f69d141336 refactor config to support different config options for datasets in different dataroots. (#1596)
This will give us the ability to specify different config options for
different dataroots.

the key of the dataroot dictionary is no longer the same as the dataroot_url.
Previously key==dataroot_url, and now those are separated.

Added an "is_multi_dataset" function to simplify logic where it branched on single vs multi.

Simplified the rest.py interface by no longer passing in the user annotations object, since
that can be retrieved from the dataset.
2020-07-10 16:21:40 -07:00

57 lines
2.1 KiB
Makefile

include ../../common.mk
.PHONY: clean
clean:
rm -f artifact.zip
rm -rf artifact.dir
# Build the ElasticBeanstalk configuration and deployment bundle,
# such that deployment can be done with a simple `eb deploy`.
# Presumes that a top-level `make build-client` has been done to
# create the client static assets.
cwd := $(shell pwd)
.PHONY: build
build: clean
mkdir artifact.dir; \
(cd ../.. ; \
git ls-files server/ | cpio -pdm $(cwd)/artifact.dir ; ); \
$(call copy_client_assets,../../client/build,artifact.dir/server) ; \
set -e ; \
cp app.py artifact.dir/application.py; \
cp ../requirements.txt artifact.dir; \
cp -r .ebextensions artifact.dir; \
if [ -d customize ] ; then \
if [ -f customize/config.yaml ] ; then \
cp customize/config.yaml artifact.dir; \
fi ; \
if [ -f customize/requirements.txt ] ; then \
pip install requirements-parser ; \
pip install packaging ; \
python3 check_requirements.py ../requirements.txt customize/requirements.txt; \
cp customize/requirements.txt artifact.dir; \
fi ; \
if [ -d customize/deploy ] ; then \
cp -r customize/deploy artifact.dir/server/common/web/static; \
fi; \
if [ -d customize/inline_scripts ] ; then \
cp -r customize/inline_scripts/* artifact.dir/server/common/web/templates; \
find artifact.dir/server/common/web/templates/ -type f -exec sed -i$(if $(IS_DARWIN), '',) 's/__CELLXGENE_COMMIT__/$(CELLXGENE_COMMIT)/g' {} \;; \
fi; \
if [ -d customize/ebextensions ] ; then \
cp -r customize/ebextensions/* artifact.dir/.ebextensions; \
fi; \
fi; \
if [ -d customize/plugins ] ; then \
cp -r customize/plugins artifact.dir/server/; \
find artifact.dir/server/plugins/ -type f -exec sed -i$(if $(IS_DARWIN), '',) 's/__CELLXGENE_COMMIT__/$(CELLXGENE_COMMIT)/g' {} \;; \
fi; \
(cd artifact.dir; \
cp -r server/common/web/static static; \
zip -r ../artifact.zip . --exclude server/test/\* server/eb/\* ; ); \
if ! grep artifact.zip .elasticbeanstalk/config.yml ; then \
mkdir -p .elasticbeanstalk ; cat config_deploy.yaml >> .elasticbeanstalk/config.yml ; fi