Browse Source

Remove invoke stuff we're not using

master
decentral1se 9 months ago
parent
commit
78a237ae21
Signed by: Luke Murphy <lukewm@riseup.net> GPG Key ID: 5E2EF5A63E3718CC
2 changed files with 0 additions and 78 deletions
  1. 0
    1
      requirements.txt
  2. 0
    77
      tasks.py

+ 0
- 1
requirements.txt View File

@@ -1,4 +1,3 @@
1 1
 Markdown==3.1.1
2 2
 beautifulsoup4==4.7.1
3
-invoke==1.2.0
4 3
 pelican==4.0.1

+ 0
- 77
tasks.py View File

@@ -1,77 +0,0 @@
1
-# -*- coding: utf-8 -*-
2
-
3
-import os
4
-import shutil
5
-import sys
6
-
7
-from invoke import task
8
-from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer
9
-
10
-CONFIG = {
11
-    'content_path': 'content',
12
-    'deploy_path': 'output',
13
-    'dest_path': '/var/www/homebrewserver.club',
14
-    'port': 8000,
15
-}
16
-
17
-
18
-@task
19
-def clean(c):
20
-    """Remove generated files"""
21
-    if os.path.isdir(CONFIG['deploy_path']):
22
-        shutil.rmtree(CONFIG['deploy_path'])
23
-        os.makedirs(CONFIG['deploy_path'])
24
-
25
-
26
-@task
27
-def build(c):
28
-    """Build local version of site"""
29
-    c.run('pelican -s pelicanconf.py')
30
-
31
-
32
-@task
33
-def rebuild(c):
34
-    """`build` with the delete switch"""
35
-    c.run('pelican -d -s pelicanconf.py')
36
-
37
-
38
-@task
39
-def regenerate(c):
40
-    """Automatically regenerate site upon file modification"""
41
-    c.run('pelican -r -s pelicanconf.py')
42
-
43
-
44
-@task
45
-def serve(c):
46
-    """Serve site at http://localhost:8000/"""
47
-
48
-    class AddressReuseTCPServer(RootedHTTPServer):
49
-        allow_reuse_address = True
50
-
51
-    server = AddressReuseTCPServer(
52
-        CONFIG['deploy_path'], ('', CONFIG['port']), ComplexHTTPRequestHandler
53
-    )
54
-
55
-    sys.stderr.write('Serving on port {port} ...\n'.format(**CONFIG))
56
-    server.serve_forever()
57
-
58
-
59
-@task
60
-def reserve(c):
61
-    """`build`, then `serve`"""
62
-    build(c)
63
-    serve(c)
64
-
65
-
66
-@task
67
-def preview(c):
68
-    """Build production version of site"""
69
-    c.run('pelican -s publishconf.py')
70
-
71
-
72
-@task
73
-def publish(c):
74
-    """Publish to production via Git hook"""
75
-    # TODO: use generation and rsync here for publishing
76
-    #       also update README.md "Deploying the site" instructions
77
-    c.run('git push origin master')

Loading…
Cancel
Save