59 changed files with 2207 additions and 968 deletions
@ -0,0 +1,21 @@ |
|||||
|
FROM ubuntu:latest |
||||
|
MAINTAINER wes kerfoot "wjak56@gmail.com" |
||||
|
RUN apt-get update -y |
||||
|
RUN apt-get install -y python3-pip python3-dev build-essential |
||||
|
RUN apt-get install -y curl |
||||
|
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash |
||||
|
RUN apt-get install -y sassc nodejs |
||||
|
RUN npm install -g uglifycss uglifyjs |
||||
|
COPY . ./src |
||||
|
WORKDIR /src |
||||
|
RUN npm install |
||||
|
RUN pip3 install -r /src/requirements.txt |
||||
|
RUN mkdir -p ./build/styles ./build/scripts |
||||
|
RUN npm run-script build_riotblog |
||||
|
RUN npm run-script build_editor |
||||
|
RUN sassc ./styles/riotblog.scss > ./styles/riotblog.intermediate.min.css |
||||
|
RUN uglifycss ./styles/*.css > ./build/styles/riotblog.min.css |
||||
|
ENTRYPOINT ["python3"] |
||||
|
ENV RIOTBLOG_SETTINGS "/src/riotblog_local.cfg" |
||||
|
CMD ["/src/website.py"] |
||||
|
EXPOSE 80 |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
File diff suppressed because it is too large
@ -0,0 +1,36 @@ |
|||||
|
appconfig==0.1 |
||||
|
appdirs==1.4.3 |
||||
|
asn1crypto==0.24.0 |
||||
|
certifi==2018.11.29 |
||||
|
cffi==1.11.5 |
||||
|
chardet==3.0.4 |
||||
|
Click==7.0 |
||||
|
CouchDB==1.2 |
||||
|
cryptography==2.4.2 |
||||
|
dominate==2.3.5 |
||||
|
Flask==0.12.4 |
||||
|
flask-appconfig==0.11.1 |
||||
|
Flask-Bootstrap==3.3.7.1 |
||||
|
Flask-Cache==0.13.1 |
||||
|
Flask-Login==0.4.1 |
||||
|
flask-marshmallow==0.9.0 |
||||
|
Flask-WTF==0.14.2 |
||||
|
greenlet==0.4.15 |
||||
|
idna==2.8 |
||||
|
itsdangerous==1.1.0 |
||||
|
Jinja2==2.10 |
||||
|
lxml==4.2.5 |
||||
|
MarkupSafe==1.1.0 |
||||
|
marshmallow==2.17.0 |
||||
|
mistune==0.8.4 |
||||
|
packaging==18.0 |
||||
|
pycparser==2.19 |
||||
|
pyparsing==2.3.0 |
||||
|
python-memcached==1.59 |
||||
|
requests==2.21.0 |
||||
|
six==1.12.0 |
||||
|
urllib3==1.24.1 |
||||
|
uWSGI==2.0.17.1 |
||||
|
visitor==0.1.3 |
||||
|
Werkzeug==0.14.1 |
||||
|
WTForms==2.2.1 |
@ -0,0 +1,25 @@ |
|||||
|
import riot from 'rollup-plugin-riot' |
||||
|
import nodeResolve from 'rollup-plugin-node-resolve' |
||||
|
import commonjs from 'rollup-plugin-commonjs' |
||||
|
import buble from 'rollup-plugin-buble' |
||||
|
import uglify from 'rollup-plugin-uglify'; |
||||
|
|
||||
|
function makeBundle(item) { |
||||
|
console.log(item); |
||||
|
var entry = item[0]; |
||||
|
var dest = item[1]; |
||||
|
return { |
||||
|
entry: entry, |
||||
|
dest: dest, |
||||
|
plugins: [ |
||||
|
riot(), |
||||
|
nodeResolve({ jsnext: true, preferBuiltins: false}), |
||||
|
commonjs(), |
||||
|
buble(), |
||||
|
uglify() |
||||
|
], |
||||
|
format: 'iife' |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
export default makeBundle(["./scripts/riotblog.js", "./build/scripts/riotblog.min.js"]); |
File diff suppressed because it is too large
@ -1,13 +0,0 @@ |
|||||
[Unit] |
|
||||
Description=My Blargh |
|
||||
After=network.target |
|
||||
|
|
||||
[Service] |
|
||||
User=http |
|
||||
Group=http |
|
||||
WorkingDirectory=/srv/http/riotblog |
|
||||
ExecStart=/usr/bin/uwsgi --single-interpreter --ini /srv/http/riotblog/blog.ini |
|
||||
Environment="RIOTBLOG_SETTINGS=/srv/http/riotblog/riotblog_prod.cfg" |
|
||||
|
|
||||
[Install] |
|
||||
WantedBy=multi.user.target |
|
@ -1,13 +0,0 @@ |
|||||
[Unit] |
|
||||
Description=My Blargh |
|
||||
After=network.target |
|
||||
|
|
||||
[Service] |
|
||||
User=http |
|
||||
Group=http |
|
||||
WorkingDirectory=/srv/http/riotblog |
|
||||
ExecStart=/usr/bin/uwsgi --single-interpreter --ini /srv/http/riotblog/blog.ini |
|
||||
Environment="RIOTBLOG_SETTINGS=/srv/http/riotblog/riotblog_local.cfg" |
|
||||
|
|
||||
[Install] |
|
||||
WantedBy=multi.user.target |
|
@ -0,0 +1,26 @@ |
|||||
|
{ |
||||
|
"_id": "_design/blogPosts", |
||||
|
"_rev": "128-d6bf6a41f78d140bdbb71a8bed3c2554", |
||||
|
"views": { |
||||
|
"blog-posts": { |
||||
|
"map": "function (doc) {\n if (doc.type == \"post\" && !doc.draft) {\n emit(doc._id.slice(-8), 1);\n }\n}\n\n\n\n\n" |
||||
|
}, |
||||
|
"links": { |
||||
|
"map": "function (doc) {\n if (doc.type == \"links\") { emit(doc._id, 1); }\n}" |
||||
|
}, |
||||
|
"categories": { |
||||
|
"map": "function (doc) {\n if (doc.categories !== undefined && !doc.draft) {\n emit([\"categories\", doc.categories], 1);\n }\n}", |
||||
|
"reduce": "function (keys, values, rereduce) {\n return null;\n}" |
||||
|
}, |
||||
|
"format": { |
||||
|
"map": "function (doc) {\n if (doc.categories !== undefined && !doc.draft) {\n emit(doc._id.slice(-8),\n {\n \"categories\" : doc.categories,\n \"author\" : doc.author,\n \"title\" : doc.title,\n \"id\" : doc._id.slice(-8),\n \"content\" : doc.content.slice(0, 250)\n });\n }\n}" |
||||
|
}, |
||||
|
"unpublished": { |
||||
|
"map": "function (doc) {\n if (doc.type == \"post\") {\n emit(doc._id.slice(-8), 1);\n }\n}" |
||||
|
} |
||||
|
}, |
||||
|
"lists": { |
||||
|
"categories": "function(head, req) { var row, results; var results = []; var categories = (req.query.categories !== undefined ? JSON.parse(req.query.categories) : []); var num = parseInt(req.query.num, 10); var getlast = req.query.getlast; var full_results; if (getlast == undefined) { while (results.length < num && (row = getRow())) { if (categories.length == 0 || categories.some(function(c) { return row.value.categories.indexOf(c) !== -1; })) { results.push([row.value.categories, row.value]); } } full_results = results; } else { while (row = getRow()) { if (categories.length == 0 || categories.some(function(c) { return row.value.categories.indexOf(c) !== -1; })) { results.push([row.value.categories, row.value]); } } full_results = results.slice(results.length-(num+1), results.length-1); } return JSON.stringify({q : req.query.categories, results : full_results});}" |
||||
|
}, |
||||
|
"language": "javascript" |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
version: '3' |
||||
|
services: |
||||
|
web: |
||||
|
build: app |
||||
|
ports: |
||||
|
- "80" |
||||
|
environment: |
||||
|
SECRET_KEY: "asdsdgfdgsdfdsf" |
||||
|
ADMIN_PASSWORD: "***REMOVED***" |
||||
|
JSONIFY_PRETTYPRINT_REGULAR: "False" |
||||
|
network_mode: host |
||||
|
couch: |
||||
|
image: couchdb |
||||
|
ports: |
||||
|
- "127.0.0.1:5984:5984" |
@ -1,98 +0,0 @@ |
|||||
from __future__ import with_statement |
|
||||
from fabric.api import * |
|
||||
from fabric.contrib.console import confirm |
|
||||
from fabric.contrib.project import rsync_project |
|
||||
import fabric.operations as op |
|
||||
|
|
||||
env.hosts = ["wes@mgoal.ca:444"] |
|
||||
|
|
||||
@task |
|
||||
def buildScss(): |
|
||||
with lcd("./build"): |
|
||||
local("sassc ../src/styles/riotblog.scss > styles/riotblog.min.css") |
|
||||
local("sassc ../src/styles/projects.scss > styles/projects.min.css") |
|
||||
|
|
||||
@task |
|
||||
def buildJS(): |
|
||||
local("rollup -c rollup.config.js") |
|
||||
local("uglifyjs build/bundle.js -c > build/scripts/primop.min.js") |
|
||||
local("uglifyjs build/editor.bundle.js -c > build/scripts/editor.min.js") |
|
||||
|
|
||||
@task |
|
||||
def buildVenv(): |
|
||||
with cd("~/build"): |
|
||||
run("virtualenv -p $(which python3) ~/build/venv") |
|
||||
with prefix("source ~/build/venv/bin/activate"): |
|
||||
run("pip3 install -r requirements.txt") |
|
||||
|
|
||||
@task |
|
||||
def buildLocalVenv(): |
|
||||
with lcd("~/primop.me/build"): |
|
||||
local("virtualenv -p $(which python3) ~/primop.me/build/venv") |
|
||||
with prefix("source ~/primop.me/build/venv/bin/activate"): |
|
||||
local("pip3 install -r requirements.txt") |
|
||||
|
|
||||
@task |
|
||||
def copyFiles(): |
|
||||
local("cp ./{blog.ini,blog.service,requirements.txt} ./build/") |
|
||||
local("cp ./src/*py ./build/") |
|
||||
local("cp *.cfg ./build/") |
|
||||
local("cp ./src/styles/*.css ./build/styles/") |
|
||||
local("cp ./src/images/*png ./build/images/") |
|
||||
local("uglifycss ./build/styles/*css > ./build/styles/primop.min.css") |
|
||||
local("cp -r ./src/templates ./build/templates") |
|
||||
|
|
||||
@task |
|
||||
def upload(): |
|
||||
run("mkdir -p ~/build") |
|
||||
rsync_project(local_dir="./build/", remote_dir="~/build/", delete=False, exclude=[".git"]) |
|
||||
|
|
||||
@task |
|
||||
def serveUp(): |
|
||||
sudo("rm -rf /srv/http/riotblog_static") |
|
||||
sudo("rm -fr /srv/http/riotblog") |
|
||||
sudo("mkdir -p /srv/http/riotblog_static") |
|
||||
sudo("cp -r /home/wes/build/ /srv/http/riotblog/") |
|
||||
sudo("cp -r /home/wes/build/{styles,scripts,images} /srv/http/riotblog_static") |
|
||||
sudo("cp /home/wes/build/blog.service /etc/systemd/system/blog.service") |
|
||||
sudo("systemctl daemon-reload") |
|
||||
sudo("systemctl enable blog.service") |
|
||||
sudo("systemctl restart blog.service") |
|
||||
sudo("systemctl restart memcached") |
|
||||
|
|
||||
@task(default=True) |
|
||||
def build(): |
|
||||
local("rm -rf ./build") |
|
||||
local("mkdir -p build/{scripts,styles,images}") |
|
||||
buildScss() |
|
||||
buildJS() |
|
||||
copyFiles() |
|
||||
upload() |
|
||||
buildVenv() |
|
||||
serveUp() |
|
||||
|
|
||||
@task |
|
||||
def update(): |
|
||||
local("mkdir -p build/{scripts,styles,images}") |
|
||||
buildScss() |
|
||||
buildJS() |
|
||||
copyFiles() |
|
||||
upload() |
|
||||
serveUp() |
|
||||
|
|
||||
@task |
|
||||
def locbuild(): |
|
||||
local("rm -rf ./build") |
|
||||
local("mkdir -p build/{scripts,styles,images}") |
|
||||
local("cp requirements.txt ./build/requirements.txt") |
|
||||
buildLocalVenv() |
|
||||
buildScss() |
|
||||
buildJS() |
|
||||
copyFiles() |
|
||||
local("sudo rm -fr /srv/http/riotblog") |
|
||||
local("sudo mkdir -p /srv/http/riotblog") |
|
||||
local("sudo cp -r ./build/* /srv/http/riotblog/") |
|
||||
local("sudo cp /home/wes/primop.me/blog_test.service /etc/systemd/system/blog.service") |
|
||||
local("sudo systemctl daemon-reload") |
|
||||
local("sudo systemctl enable blog.service") |
|
||||
local("sudo systemctl restart blog.service") |
|
@ -1,49 +0,0 @@ |
|||||
appdirs==1.4.3 |
|
||||
certifi==2017.7.27.1 |
|
||||
cffi==1.9.1 |
|
||||
chardet==3.0.4 |
|
||||
click==6.7 |
|
||||
CouchDB==1.1 |
|
||||
cryptography==1.7.2 |
|
||||
dominate==2.3.1 |
|
||||
elasticsearch==5.1.0 |
|
||||
elasticsearch-dsl==5.1.0 |
|
||||
Fabric==1.13.1 |
|
||||
Flask==0.12 |
|
||||
flask-appconfig==0.11.1 |
|
||||
Flask-Bootstrap==3.3.7.1 |
|
||||
Flask-Cache==0.13.1 |
|
||||
Flask-Login==0.4.0 |
|
||||
flask-marshmallow==0.7.0 |
|
||||
Flask-WTF==0.14.2 |
|
||||
greenlet==0.4.12 |
|
||||
idna==2.5 |
|
||||
itsdangerous==0.24 |
|
||||
Jinja2==2.9.4 |
|
||||
lxml==3.7.2 |
|
||||
MarkupSafe==0.23 |
|
||||
marshmallow==2.13.5 |
|
||||
mistune==0.7.4 |
|
||||
packaging==16.8 |
|
||||
paramiko==2.1.1 |
|
||||
pbr==1.10.0 |
|
||||
pyasn1==0.2.1 |
|
||||
pycparser==2.17 |
|
||||
pyparsing==2.2.0 |
|
||||
PySocks==1.6.6 |
|
||||
python-dateutil==2.6.0 |
|
||||
python-memcached==1.58 |
|
||||
pyxdg==0.25 |
|
||||
requests==2.18.3 |
|
||||
simplejson==3.11.1 |
|
||||
six==1.10.0 |
|
||||
stevedore==1.20.0 |
|
||||
urllib3==1.22 |
|
||||
uWSGI==2.0.14 |
|
||||
virtualenv==15.1.0 |
|
||||
virtualenv-clone==0.2.6 |
|
||||
virtualenvwrapper==4.7.2 |
|
||||
visitor==0.1.3 |
|
||||
Werkzeug==0.11.15 |
|
||||
WTForms==2.1 |
|
||||
youtube-dl==2017.1.28 |
|
@ -1,5 +0,0 @@ |
|||||
#! /usr/bin/bash |
|
||||
|
|
||||
while inotifywait -qqre modify "./src"; do |
|
||||
fab locbuild |
|
||||
done |
|
Loading…
Reference in new issue