-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathskelfile
More file actions
119 lines (119 loc) · 4.63 KB
/
Copy pathskelfile
File metadata and controls
119 lines (119 loc) · 4.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
;;; skelfile --- CC/org skelfile -*- mode: skel; -*-
:name org
:author ("Richard Westhaver" . "ellis@rwest.io")
:version "0.1.0"
:license "MPL"
:description "CC Org Files"
:tags (org docs notes meta plan archive graph)
:vc (:hg "https://vc.compiler.company/org"
(cb (:git "ssh://git@codeberg.org/c-c/org"))
(gh (:git "ssh://git@github.com/richardwesthaver/org")))
:components
((:el "init"))
:bind
((www-home :env "/opt/stash/data/web/www")
(cdn-home :env "/opt/stash/data/web/cdn")
(packy-home :env "/opt/store/packy")
(org-deploy-ssh-key :env "~/.ssh/ellis_aws.pem")
(org-deploy-user :env "fedora")
(org-deploy-host :env "compiler.company")
(org-deploy-path :env "ssh://rurik:/srv/www")
(submods (list "graph" "meta" "plan" "docs" "notes" "archive")))
:rules
((default (init build publish deploy dist-html dist-source dist-repos))
(build (build-css build-docs build-agenda build-graph)
(init :xdg)
(init :org-graph)
(organ/graph:org-graph-json :path ".stash/org-graph.json")
(organ/graph:org-graph-minisearch-json :path ".stash/org-graph-index.json")
(organ/graph:org-graph-tinysearch-json :path ".stash/org-graph-search.json"))
(init ()
(with-emacs (e)
(load-file "init.el")
(cc-org--slime-setup)))
(graph ()
(:build ()
(with-emacs (e)
(org-graph-init)
(org-graph-save))))
(agenda ()
(:build ()
(with-emacs (e) (org-store-agenda-views))))
(docs ()
(:build ()
(with-emacs (e)
(mapc
(lambda (f)
(message "updating org file: %s" f)
(org-with-file-buffer
f
(org-babel-execute-buffer)
(save-buffer)))
(flatten
(mapcar
(lambda (x) (directory-files-recursively x "\\(readme\\|index\\|info\\)[.]org$"))
(list "graph" "meta" "plan" "docs" "notes")))))))
(clean ()
(probe-delete-directory ".stash" :recursive t)
(mapc 'delete-file (directory "**/*.html")))
(css ()
(:build () (css:compile-css-file "clean.css.lisp" ".stash/clean.css"))
(:deploy () #$cp .stash/clean.css $CDN_HOME/css/$#))
(browse ()
(tools:browse-url (or (probe-directory ".stash/www") #+nil www-home
"/opt/stash/data/web/www/")))
(publish ()
(ensure-directories-exist ".stash/www/")
(with-emacs (e)
(publish t t)))
(deploy-ssh () #$scp -i $ORG_DEPLOY_SSH_KEY -r .stash/www/* "$ORG_DEPLOY_USER@$ORG_DEPLOY_HOST:$ORG_DEPLOY_PATH"$#)
(deploy-cloudflare () (nyi!))
(deploy (deploy-css)
#$cp -rf .stash/www/* $WWW_HOME
cp -rf .stash/*.json $CDN_HOME/data/$#)
(upstream ()
(labels ((remotes (name)
(vector
(make-vc-remote :type :hg :name "cb" :url (format nil "ssh://git@codeberg.org/c-c/~A" name))
(make-vc-remote :type :hg :name "gh" :url (format nil "ssh://git@github.com/richardwesthaver/~A" name))))
(bump (name)
(let ((repo (make-repo (probe-directory name) :type :hg)))
(update-repo repo :push t)
(setf (vc-remotes repo) (remotes name))
(vc-export repo :upstream '("gh" "cb") :delete t :force t :branch "default")))
(bump* (&rest subrepos)
(dolist (s subrepos)
(bump s))))
(bump* "graph" "meta" "plan" "docs" "notes")
(vc-export (vc *project*) :upstream nil)
(with-repo (r :path "/tmp/org" :type :git :delete t)
(setf (vc-remotes r) (remotes "org"))
(loop for remote across (setf (vc-remotes r) (remotes "org"))
do (vc-remote r :add :name (name remote) :url (uri remote)))
(vc-update r)
(vc-submodule r :add :url "https://github.com/richardwesthaver/graph")
(vc-submodule r :add :url "https://github.com/richardwesthaver/notes")
(vc-submodule r :add :url "https://github.com/richardwesthaver/meta")
(vc-submodule r :add :url "https://github.com/richardwesthaver/plan")
(vc-submodule r :add :url "https://github.com/richardwesthaver/docs")
(vc-add r ".gitmodules")
(vc-commit r "gitmodules")
(vc-push r :set-upstream t :remote "gh" :branch "default" :force t)
(vc-push r :remote "cb" :branch "default" :force t))))
(dist-repos ()
(vc-bundle (vc *project*) "/opt/store/packy/vc/org.hg")
(mapc
(lambda (x)
(vc-bundle
(make-repo (probe-file (directory-path x)))
(merge-pathnames (format nil "vc/~A.hg" x) "/opt/store/packy/")))
'("graph" "plan" "docs" "meta" "notes" "archive")))
(dist-source (clean)
(with-directory ".."
#$tar --exclude='*/.hg' --exclude='#*#' -I 'zstd' -cf $PACKY_HOME/src/org.tar.zst org/*$#))
(push ()
(vc:update-repos "." :pull nil :push t))
(dist-html ()
(with-directory ".stash"
#$tar -I 'zstd' -cf compiler.company.tar.zst www/*
cp -f compiler.company.tar.zst $PACKY_HOME/doc/html/compiler.company.tar.zst$#)))