1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
theorangeone.net-legacy/Makefile

71 lines
1.9 KiB
Makefile
Raw Normal View History

2016-06-05 19:47:14 +01:00
ENV=env/bin
NODE_BIN=node_modules/.bin
PELICAN=$(ENV)/pelican
BASEDIR=$(PWD)
OUTPUTDIR=$(BASEDIR)/output
2016-06-25 18:10:58 +01:00
PLUGINS_DIR=$(BASEDIR)/pelican_plugins
2016-06-05 19:47:14 +01:00
2016-06-12 22:04:30 +01:00
SSH_USER=web
SSH_HOST=theorangeone.net
SSH_TARGET_DIR=/home/web/v4-theorangeone.net/site # Dev path only!
2016-06-05 19:47:14 +01:00
FLAKE8_IGNORE=--ignore=E128,E501,E401,E402
build: install
2016-06-07 18:39:17 +01:00
rm -rf $(OUTPUTDIR)/*
2016-06-05 19:47:14 +01:00
@echo ">> Building static data..."
mkdir -p theme/static/build/js/lib theme/static/build/fonts theme/static/build/css
cp -R node_modules/font-awesome/fonts theme/static/build/
npm run build-js
npm run build-scss
@echo ">> Building pelican..."
$(PELICAN) -o $(OUTPUTDIR) -v
2016-06-13 09:04:21 +01:00
mv $(OUTPUTDIR)/assets/robots.txt $(OUTPUTDIR)
2016-06-11 12:53:23 +01:00
cp -R $(OUTPUTDIR)/assets/* $(OUTPUTDIR)/static
rm -rf $(OUTPUTDIR)/assets
2016-06-05 19:47:14 +01:00
clean:
rm -rf $(OUTPUTDIR)/*
rm -rf $(BASEDIR)/env/
rm -rf $(BASEDIR)/node_modules/
2016-06-25 18:10:58 +01:00
rm -rf $(PLUGINS_DIR)/*
2016-06-05 19:47:14 +01:00
install: env node_modules pelican_plugins
2016-06-05 22:03:21 +01:00
pelican_plugins: env
2016-06-25 18:10:58 +01:00
rm -rf $(PLUGINS_DIR) || "No existing extensions"
2016-06-29 22:36:40 +01:00
git clone --recursive https://github.com/getpelican/pelican-plugins $(PLUGINS_DIR) || "Git Fail"
2016-06-05 19:47:14 +01:00
@echo ">> Hotfixing..."
2016-06-25 18:10:58 +01:00
rm -rf $(PLUGINS_DIR)/pelican-jinja2content
git clone https://github.com/RealOrangeOne/pelican-jinja2content -b patch-1 --depth=1 $(PLUGINS_DIR)/pelican-jinja2content
2016-06-05 19:47:14 +01:00
env:
pyvenv env
$(ENV)/pip install -r requirements.txt
2016-06-05 22:03:21 +01:00
node_modules: env
2016-06-05 19:47:14 +01:00
npm install
2016-07-29 12:00:28 +01:00
test: lint spellcheck
2016-06-05 19:47:14 +01:00
lint:
$(NODE_BIN)/eslint 'theme/static/src/js/'
$(NODE_BIN)/sass-lint -vqc .sass-lint.yml
$(ENV)/flake8 $(BASEDIR)/plugins/ $(FLAKE8_IGNORE)
$(ENV)/flake8 $(BASEDIR)/scripts/ $(FLAKE8_IGNORE)
$(ENV)/flake8 $(BASEDIR)/pelicanconf.py $(FLAKE8_IGNORE)
2016-07-29 12:00:28 +01:00
spellcheck:
2016-07-29 13:57:02 +01:00
$(NODE_BIN)/mdspell --en-gb -ranx theme/templates/**/*.* theme/templates/*.*
$(NODE_BIN)/mdspell --en-gb -ranx content/**/*.* content/*.*
2016-07-29 12:00:28 +01:00
2016-06-05 19:47:14 +01:00
2016-06-12 22:04:30 +01:00
upload: build
rsync -e "/usr/bin/ssh" -rvz --delete $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)
.PHONY: build clean test lint install upload