1
Fork 0

Start removing Makefile

This commit is contained in:
Jake Howard 2017-01-09 22:14:38 +00:00
parent ccb0627ae7
commit 40653e5c18
7 changed files with 17 additions and 82 deletions

1
.gitignore vendored
View file

@ -60,7 +60,6 @@ target/
# Pelican stuff
output/
theme/static/build/
pelican_plugins/
theme/static/src/scss/pygment.css
deploy/

7
.gitmodules vendored Normal file
View file

@ -0,0 +1,7 @@
[submodule "plugins/pelican-jinja2content"]
path = plugins/pelican-jinja2content
url = https://github.com/RealOrangeOne/pelican-jinja2content
[submodule "pelican_plugins"]
path = pelican_plugins
url = https://github.com/getpelican/pelican-plugins

View file

@ -6,75 +6,15 @@ PELICAN=$(ENV)/pelican
OUTPUTDIR=$(BASEDIR)/output
PLUGINS_DIR=$(BASEDIR)/pelican_plugins
DEPLOY_DIR=$(BASEDIR)/deploy
CONFIG_FILE=$(BASEDIR)/config/pelicanconf.py
FLAKE8_IGNORE=--ignore=E128,E501,E401,E402
CONFIG_FILE=$(BASEDIR)/pelicanconf.py
build: install
rm -rf $(OUTPUTDIR)/*
@echo ">> Building static data..."
mkdir -p theme/static/build/js/lib theme/static/build/fonts theme/static/build/css theme/static/build/img
cp -R node_modules/font-awesome/fonts theme/static/build/
npm run build-js
npm run build-scss
@echo ">> Building pelican..."
$(PELICAN) -o $(OUTPUTDIR) -vs $(CONFIG_FILE)
mv $(OUTPUTDIR)/assets/robots.txt $(OUTPUTDIR)
cp -R $(OUTPUTDIR)/assets/* $(OUTPUTDIR)/static
rm -rf $(OUTPUTDIR)/assets
clean:
rm -rf $(OUTPUTDIR)/*
rm -rf $(BASEDIR)/env/
rm -rf $(BASEDIR)/node_modules/
rm -rf $(PLUGINS_DIR)/*
install: env node_modules pelican_plugins
pelican_plugins: env
rm -rf $(PLUGINS_DIR) || "No existing extensions"
git clone --recursive https://github.com/getpelican/pelican-plugins $(PLUGINS_DIR) || "Git Fail"
@echo ">> Hotfixing..."
rm -rf $(PLUGINS_DIR)/pelican-jinja2content
git clone https://github.com/RealOrangeOne/pelican-jinja2content -b patch-1 --depth=1 $(PLUGINS_DIR)/pelican-jinja2content
env:
pyvenv env
$(ENV)/pip install -r requirements.txt --upgrade
node_modules:
npm install
test: unittest lint spellcheck securitycheck
unittest:
$(ENV)/nose2 --verbose
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)/config/ $(FLAKE8_IGNORE)
$(ENV)/flake8 $(BASEDIR)/tests/ $(FLAKE8_IGNORE)
$(ENV)/yamllint config/config.yml
spellcheck:
$(NODE_BIN)/mdspell --en-gb -ranx theme/templates/**/*.* theme/templates/*.*
$(NODE_BIN)/mdspell --en-gb -ranx content/**/*.md content/*.md content/**/*.html content/*.html
securitycheck:
$(NODE_BIN)/nsp check
$(ENV)/bandit -r plugins/ config/ tests/
upload:
git clone https://github.com/RealOrangeOne/host-container.git $(DEPLOY_DIR)
cp -rf $(OUTPUTDIR)/. $(DEPLOY_DIR)/site/
@cd $(DEPLOY_DIR) && git remote add dokku $(DEPLOY_URL) && git add . && git commit -m "add files" && git push -f dokku master --quiet
rm -rf $(DEPLOY_DIR)
.PHONY: build clean test lint install upload
install: env node_modules

View file

@ -7,19 +7,3 @@ machine:
BUILD_PRODUCTION: true
NODE_ENV: production
NPM_CONFIG_PRODUCTION: false
dependencies:
pre:
- make -B
test:
override:
- make test
deployment:
production:
branch: master
commands:
- git config --global user.email "git@theorangeone.net"
- git config --global user.name "TheOrangeOne"
- make upload

View file

@ -3,6 +3,10 @@
"version": "4.0.0",
"description": " Source code for TheOrangeOne.net",
"scripts": {
"postinstall": "npm run create-build-dirs && npm run copy-fonts && npm run build",
"create-build-dirs": "mkdir -p theme/static/build/js/lib theme/static/build/fonts theme/static/build/css theme/static/build/img",
"copy-fonts": "cp -R node_modules/font-awesome/fonts theme/static/build/",
"build": "npm run build-scss && npm run build-js",
"build-js": "./scripts/build-js.sh",
"build-scss": "./scripts/build-scss.sh"
},

1
pelican_plugins Submodule

@ -0,0 +1 @@
Subproject commit 6cd5a608b45fdc21bb11ed1f72a151cdb71c1169

View file

@ -10,11 +10,11 @@ from config import settings
AUTHOR = settings.author
SITENAME = settings.site_name
SITEURL = settings.url
PATH = '../content'
PATH = 'content'
TIMEZONE = settings.timezone
DEFAULT_LANG = settings.language
PAGE_PATHS = ["pages"]
THEME = "../theme"
THEME = "theme"
THEME_STATIC_DIR = "static"
THEME_STATIC_PATHS = ["static/build"]
STATIC_PATHS = ["assets"]
@ -61,7 +61,7 @@ FEED_ATOM = 'feed.atom'
FEED_DOMAIN = SITEURL
# Setup plugins
PLUGIN_PATHS = ["../pelican_plugins", "../plugins"]
PLUGIN_PATHS = ["plugins", "pelican_plugins"]
PLUGINS = settings.pelican_plugins
if BUILD_PRODUCTION: