From 40653e5c18fd442b82d94efe6071419830f781b1 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 9 Jan 2017 22:14:38 +0000 Subject: [PATCH] Start removing Makefile --- .gitignore | 1 - .gitmodules | 7 +++ Makefile | 64 +------------------------ circle.yml | 16 ------- package.json | 4 ++ pelican_plugins | 1 + config/pelicanconf.py => pelicanconf.py | 6 +-- 7 files changed, 17 insertions(+), 82 deletions(-) create mode 100644 .gitmodules create mode 160000 pelican_plugins rename config/pelicanconf.py => pelicanconf.py (96%) diff --git a/.gitignore b/.gitignore index 0e1697c..198208d 100644 --- a/.gitignore +++ b/.gitignore @@ -60,7 +60,6 @@ target/ # Pelican stuff output/ theme/static/build/ -pelican_plugins/ theme/static/src/scss/pygment.css deploy/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..9f659f8 --- /dev/null +++ b/.gitmodules @@ -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 diff --git a/Makefile b/Makefile index cad9b58..bbe9683 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/circle.yml b/circle.yml index 1db10c7..07aa909 100644 --- a/circle.yml +++ b/circle.yml @@ -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 diff --git a/package.json b/package.json index c55595a..1ce2a79 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/pelican_plugins b/pelican_plugins new file mode 160000 index 0000000..6cd5a60 --- /dev/null +++ b/pelican_plugins @@ -0,0 +1 @@ +Subproject commit 6cd5a608b45fdc21bb11ed1f72a151cdb71c1169 diff --git a/config/pelicanconf.py b/pelicanconf.py similarity index 96% rename from config/pelicanconf.py rename to pelicanconf.py index 41c225a..431a585 100644 --- a/config/pelicanconf.py +++ b/pelicanconf.py @@ -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: