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

64 lines
1.6 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-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-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/
rm -rf $(BASEDIR)/pelican_plugins/
install: env node_modules pelican_plugins
2016-06-05 22:03:21 +01:00
pelican_plugins: env
2016-06-05 19:47:14 +01:00
git clone --recursive https://github.com/getpelican/pelican-plugins --depth=1 pelican_plugins/
@echo ">> Hotfixing..."
rm -rf pelican_plugins/pelican-jinja2content
git clone https://github.com/RealOrangeOne/pelican-jinja2content -b patch-1 --depth=1 pelican_plugins/pelican-jinja2content
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
test: lint
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-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