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

Data produced by crawler are statically served #406 #441

Merged
merged 3 commits into from
Oct 15, 2019
Merged
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
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
VENDOR_DIR = assets/vendor/

.PHONY: deploy
.PHONY: build deploy
download-data:
wget https://developers.italia.it/crawler/softwares.yml -O _data/crawler/softwares.yml
wget https://developers.italia.it/crawler/amministrazioni.yml -O _data/crawler/amministrazioni.yml
wget https://developers.italia.it/crawler/software_categories.yml -O _data/crawler/software_categories.yml
wget https://developers.italia.it/crawler/software-open-source.yml -O _data/crawler/software-open-source.yml
wget https://developers.italia.it/crawler/software-riuso.yml -O _data/crawler/software-riuso.yml
wget https://developers.italia.it/crawler/software_scopes.yml -O _data/crawler/software_scopes.yml
wget https://developers.italia.it/crawler/software_tags.yml -O _data/crawler/software_tags.yml
build-swagger:
./_buildscripts/build-swagger.sh
test:
JEKYLL_NO_GITHUB=true bundle exec htmlproofer ./_site --assume-extension --check-html --allow-hash-href --empty-alt-ignore --only-4xx --disable-external
local:
JEKYLL_NO_GITHUB=true bundle exec jekyll serve
deploy:
jekyll-build:
JEKYLL_ENV=production bundle exec jekyll build
deploy:
rsync -avP --rsync-path="sudo -u www-data rsync" _site/ developers.italia.it:/data/www/developers.italia.it/web/
include-npm-deps:
mkdir -p $(VENDOR_DIR)
npm install
cp node_modules/jquery/dist/jquery.min.js $(VENDOR_DIR)

build: | include-npm-deps download-data build-swagger jekyll-build
build-test: | build test
17 changes: 15 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ jobs:
- run: npm install .
- run: gem install bundler
- run: bundle install
- run: which rsync || sudo apt-get install rsync
- run: which rsync || sudo apt-get install rsync # rsync is needed for swagger build, keep it
- run: make include-npm-deps
- run: ./_buildscripts/build-swagger.sh
- run: wget https://developers.italia.it/crawler/softwares.yml -O _data/crawler/softwares.yml
- run: wget https://developers.italia.it/crawler/amministrazioni.yml -O _data/crawler/amministrazioni.yml
- run: wget https://developers.italia.it/crawler/software_categories.yml -O _data/crawler/software_categories.yml
- run: wget https://developers.italia.it/crawler/software-open-source.yml -O _data/crawler/software-open-source.yml
- run: wget https://developers.italia.it/crawler/software-riuso.yml -O _data/crawler/software-riuso.yml
- run: wget https://developers.italia.it/crawler/software_scopes.yml -O _data/crawler/software_scopes.yml
- run: wget https://developers.italia.it/crawler/software_tags.yml -O _data/crawler/software_tags.yml
- run: bundle exec jekyll build
- run: bundle exec htmlproofer ./_site --assume-extension --check-html --allow-hash-href --empty-alt-ignore --only-4xx --disable-external --url_ignore "/esQuery\.config\.js/"

Expand All @@ -42,7 +49,13 @@ jobs:
- run: mkdir -p ~/.ssh
- run: echo $SSH_KNOWN_HOSTS | base64 -d >> ~/.ssh/known_hosts
- run: which rsync || sudo apt-get install rsync
- run: rsync --delete -avP --rsync-path="sudo -u www-data rsync" circleci@developers.italia.it:/data/crawler/output/ ./_data/crawler/
- run: wget https://developers.italia.it/crawler/softwares.yml -O _data/crawler/softwares.yml
- run: wget https://developers.italia.it/crawler/amministrazioni.yml -O _data/crawler/amministrazioni.yml
- run: wget https://developers.italia.it/crawler/software_categories.yml -O _data/crawler/software_categories.yml
- run: wget https://developers.italia.it/crawler/software-open-source.yml -O _data/crawler/software-open-source.yml
- run: wget https://developers.italia.it/crawler/software-riuso.yml -O _data/crawler/software-riuso.yml
- run: wget https://developers.italia.it/crawler/software_scopes.yml -O _data/crawler/software_scopes.yml
- run: wget https://developers.italia.it/crawler/software_tags.yml -O _data/crawler/software_tags.yml
- run: ./_buildscripts/build-swagger.sh
- run: bundle exec jekyll build
- run: cp -r ./github ./_site/
Expand Down