Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Moving doc elsewhere #3163

Closed
wants to merge 3 commits into from
Closed
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
22 changes: 9 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ LAST_WSGI_USER := $(call lastvalue,wsgi-user)
LAST_WSGI_PROCESSES := $(call lastvalue,wsgi-processes)
LAST_WSGI_THREADS := $(call lastvalue,wsgi-threads)
LAST_WSGI_APP := $(call lastvalue,wsgi-app)
LAST_WEBSITE_URL := $(call lastvalue,doc-website-url)
LAST_KML_TEMP_DIR := $(call lastvalue,kml-temp-dir)

PYTHON_FILES := $(shell find chsdi/* tests/* -path chsdi/static -prune -o -type f -name "*.py" -print)
Expand Down Expand Up @@ -130,7 +131,6 @@ help:
@echo "- autolint Run the autolinter"
@echo "- translate Generate the translation files"
@echo "- legends Downloads and optimizes all WMS legend images (make legends BODID=ch.foo WMSSCALELEGEND=)"
@echo "- doc Generate the doc for api3.geo.admin.ch"
@echo "- deploybranch Deploy current branch to dev (must be pushed before hand)"
@echo "- deploybranchint Deploy current branch to dev and int (must be pushed before hand)"
@echo "- deletebranch List deployed branches or delete a deployed branch on dev and int (BRANCH_TO_DELETE=...)"
Expand All @@ -154,6 +154,7 @@ help:
@echo "GIT_BRANCH: ${GIT_BRANCH}"
@echo "SERVER_PORT: ${SERVER_PORT}"
@echo "OPENTRANS_API_KEY: ${OPENTRANS_API_KEY}"
@echo "DOC_WEBSITE_URL: ${DOC_WEBSITE_URL}"
@echo


Expand All @@ -162,7 +163,7 @@ user:
source $(USER_SOURCE) && make all

.PHONY: all
all: setup chsdi/static/css/extended.min.css templates potomo rss lint fixrights
all: setup chsdi/static/css/extended.min.css templates potomo lint fixrights

setup: .venv node_modules .venv/hooks

Expand Down Expand Up @@ -206,16 +207,6 @@ autolint:
@echo "${GREEN}Auto correction of python files...${RESET}";
${AUTOPEP8_CMD} --in-place --aggressive --aggressive --verbose --ignore=${PEP8_IGNORE} $(PYTHON_FILES)

.PHONY: doc
doc: chsdi/static/css/extended.min.css
@echo "${GREEN}Building the documentation...${RESET}";
cd chsdi/static/doc && ../../../${SPHINX_CMD} -W -b html source build || exit 1 ;

.PHONY:
rss: doc chsdi/static/doc/build/releasenotes/index.html
@echo "${GREEN}Creating the rss feed from releasenotes${RESET}";
${PYTHON_CMD} scripts/rssFeedGen.py "https://api3.geo.admin.ch"

.PHONY: translate
translate:
@echo "${GREEN}Updating translations...${RESET}";
Expand Down Expand Up @@ -337,6 +328,7 @@ apache/wsgi.conf: apache/wsgi.conf.in \
.venv/last-modwsgi-user \
.venv/last-wsgi-processes \
.venv/last-wsgi-threads \
.venv/last-doc-website-url \
.venv/last-wsgi-app \
.venv/last-kml-temp-dir
@echo "${GREEN}Creating apache/wsgi.conf...${RESET}";
Expand All @@ -353,6 +345,7 @@ apache/wsgi.conf: apache/wsgi.conf.in \
--var "wsgi_processes=$(WSGI_PROCESSES)" \
--var "wsgi_threads=$(WSGI_THREADS)" \
--var "wsgi_app=$(WSGI_APP)" \
--var "doc_website_url=$(DOC_WEBSITE_URL)" \
--var "kml_temp_dir=$(KML_TEMP_DIR)" $< > $@

development.ini.in:
Expand Down Expand Up @@ -442,7 +435,7 @@ requirements.txt:
virtualenv $(INSTALL_DIRECTORY); \
${PIP_CMD} install --upgrade pip==9.0.1 setuptools --index-url ${PYPI_URL} ; \
fi
${PIP_CMD} install --index-url ${PYPI_URL} --find-links local_eggs/ -e .
${PIP_CMD} install --index-url ${PYPI_URL} -e .

.venv/bin/git-secrets: .venv
@echo "${GREEN}Installing git secrets${RESET}";
Expand Down Expand Up @@ -595,6 +588,9 @@ chsdi/static/css/extended.min.css: chsdi/static/less/extended.less
.venv/last-wsgi-app::
$(call cachelastvariable,$@,$(WSGI_APP),$(LAST_WSGI_APP),wsgi-app)

.venv/last-doc-website-url::
$(call cachelastvariable,$@,$(SITE_URL),$(DOC_WEBSITE_URL),doc-website-url)

fixrights:
@echo "${GREEN}Fixing rights...${RESET}";
chgrp -f -R geodata . || :
Expand Down
5 changes: 5 additions & 0 deletions apache/wsgi.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ RewriteRule ^${apache_entry_path}/1.0.0/WMTSCapabilities.xml ${apache_entry_path
RewriteRule ^${apache_entry_path}/EPSG/(\d+)/1.0.0/WMTSCapabilities.xml ${apache_entry_path}/rest/services/api/1.0.0/WMTSCapabilities.xml?epsg=$1 [L,QSA,PT]
RewriteRule ^${apache_entry_path}/EPSG/(\d+)/(de|fr|it|rm|en)/1.0.0/WMTSCapabilities.xml ${apache_entry_path}/rest/services/api/1.0.0/WMTSCapabilities.xml?epsg=$1&lang=$2 [L,PT]

# Doc in S3
RewriteCond %{REQUEST_URI} ^${apache_entry_path}/$
RewriteRule ^${apache_entry_path}/$ ${doc_website_url}/index.html [R=302,L]
RewriteRule ^${apache_entry_path}/(api|releasenotes|services)/(.*) ${doc_website_url}/$1/$2 [R=302,L]

# Shorten service
RewriteCond %{HTTP_HOST} ^s.geo.admin.ch$
RewriteRule ^${apache_entry_path}/(.*)$ ${apache_entry_path}/shorten/$1 [PT]
Expand Down
Binary file removed local_eggs/sphinx_rtd_theme-0.1.6-ga3.tar.gz
Binary file not shown.
1 change: 1 addition & 0 deletions rc_dev
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ export WSGI_THREADS=15
export CMSGEOADMINHOST=https://cms.geo.admin.ch
export LINKEDDATAHOST=https://ld.geo.admin.ch
export CACHE_CONTROL=no-cache
export DOC_WEBSITE_URL=https://terraform-doc-chsdi3-website.s3-eu-west-1.amazonaws.com
1 change: 1 addition & 0 deletions rc_int
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ export WSGI_THREADS=15
export CMSGEOADMINHOST=https://cms.geo.admin.ch
export LINKEDDATAHOST=https://ld.geo.admin.ch
export CACHE_CONTROL="max-age=1800, public"
export DOC_WEBSITE_INT=https://terraform-doc-chsdi3-website.s3-eu-west-1.amazonaws.com
1 change: 1 addition & 0 deletions rc_prod
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ export WSGI_THREADS=30
export CMSGEOADMINHOST=https://cms.geo.admin.ch
export LINKEDDATAHOST=https://ld.geo.admin.ch
export CACHE_CONTROL="max-age=1800, public"
export DOC_WEBSITE_URL=https://terraform-doc-chsdi3-website.s3-eu-west-1.amazonaws.com
3 changes: 0 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ pyramid==1.10.1
pyramid-debugtoolbar==3.0.2
pyramid-mako==1.0.2
pyramid-tm==0.7
PyRSS2Gen==1.1
pystache==0.5.3
python-dateutil==2.7.5
pytz==2018.7
Expand All @@ -47,8 +46,6 @@ requests==2.20.1
Shapely==1.6.4.post2
simplejson==3.16.0
six==1.11.0
Sphinx==1.2.3
sphinx-rtd-theme===0.1.6-ga3
SQLAlchemy==1.0.14
toml==0.10.0
transaction==2.0.2
Expand Down