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

68 lines
1.9 KiB
Makefile
Raw Normal View History

2016-08-13 20:08:43 +01:00
BASEDIR=$(PWD)
ENV=$(BASEDIR)/env/bin
2016-06-05 19:47:14 +01:00
NODE_BIN=node_modules/.bin
2016-08-13 20:08:43 +01:00
PELICAN=$(ENV)/pelican
2016-06-05 19:47:14 +01:00
OUTPUTDIR=$(BASEDIR)/output
2016-06-25 18:10:58 +01:00
PLUGINS_DIR=$(BASEDIR)/pelican_plugins
2016-08-13 20:08:43 +01:00
DEPLOY_DIR=$(BASEDIR)/deploy
2016-06-12 22:04:30 +01:00
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..."
2016-08-26 11:49:13 +01:00
mkdir -p theme/static/build/js/lib theme/static/build/fonts theme/static/build/css theme/static/build/img
2016-06-05 19:47:14 +01:00
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
2016-08-16 21:45:40 +01:00
install: env node_modules pelican_plugins
2016-06-05 19:47:14 +01:00
2016-08-16 21:45:40 +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
env:
pyvenv env
2016-08-13 20:08:43 +01:00
$(ENV)/pip install -r requirements.txt
2016-06-05 19:47:14 +01:00
2016-08-06 20:31:04 +01:00
node_modules:
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
2016-08-13 20:08:43 +01:00
$(ENV)/flake8 $(BASEDIR)/plugins/ $(FLAKE8_IGNORE)
$(ENV)/flake8 $(BASEDIR)/scripts/ $(FLAKE8_IGNORE)
$(ENV)/flake8 $(BASEDIR)/pelicanconf.py $(FLAKE8_IGNORE)
2016-06-05 19:47:14 +01:00
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/*.*
2016-08-28 10:38:14 +01:00
$(NODE_BIN)/mdspell --en-gb -ranx content/**/*.md content/*.md content/**/*.html content/*.html
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
2016-08-13 20:08:43 +01:00
git clone https://github.com/RealOrangeOne/host-container.git $(DEPLOY_DIR)
2016-08-24 10:31:04 +01:00
cp -rf $(OUTPUTDIR)/. $(DEPLOY_DIR)/site/
2016-08-16 22:00:44 +01:00
@cd $(DEPLOY_DIR) && git remote add dokku $(DEPLOY_URL) && git add . && git commit -m "add files" && git push -f dokku master --quiet
2016-08-13 20:08:43 +01:00
rm -rf $(DEPLOY_DIR)
2016-06-12 22:04:30 +01:00
.PHONY: build clean test lint install upload