~vonfry/awesome

9a12e50d234591fd9e00baf041bf644bed7c6dfb — Vonfry 5 months ago 0797a14
ci: remove gitlab-ci, which is useless
2 files changed, 0 insertions(+), 92 deletions(-)

D .gitlab-ci.yml
D .gitlab/build.el
D .gitlab-ci.yml => .gitlab-ci.yml +0 -35
@@ 1,35 0,0 @@
stages:
  - build
  - deploy

default:
  image: ubuntu:rolling
  cache:
    paths:
      - .build/
      - .cache/

build:
  before_script:
    - apt update
    - apt install -y ca-cacert emacs graphviz sqlite3 gcc
    - mkdir -p .build
    - mkdir -p .cache
    - mv .cache ~/.cache
  script:
    - emacs --batch -l .gitlab/build.el
  after_script:
    - mv ~/.cache .cache
  stage: build

pages:
  script:
    - mkdir public
    - cp .build/roam.svg public/roam.svg
    - echo "<img src=roam.svg>" > public/index.html
  stage: deploy
  only:
    - master
  artifacts:
    paths:
      - public

D .gitlab/build.el => .gitlab/build.el +0 -57
@@ 1,57 0,0 @@
(require 'xdg)
(setq ci-dir (getenv "CI_PROJECT_DIR")
      build-dir (expand-file-name ".build" ci-dir)
      output-file (expand-file-name "roam.svg" build-dir)
      cache-dir (xdg-cache-home))
(message (concat "ci dir: " ci-dir))
(message (concat "build dir: " build-dir))
(message (concat "cache dir: " cache-dir))
(message (concat "output file: " output-file))

(when (file-exists-p output-file)
  (delete-file output-file))

(setq-default package-user-dir (expand-file-name "emacs/packages" cache-dir)
              org-id-locations-file (expand-file-name "emacs/id" cache-dir))

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(package-refresh-contents)

(package-install 'org)
(package-install 'org-roam)

(require 'org)
(require 'org-id)
(org-id-update-id-locations (directory-files-recursively ci-dir "\\.org$" t))

(setq-default org-roam-graph-viewer
  (lambda (file)
    (message "graph file: %s" file)
    (copy-file file output-file t)))
(setq-default org-roam-directory ci-dir
              org-roam-graph-extra-config '(("rankdir" . "LR")))

(require 'org-roam)

(message "org version: %s" (org-version))
(message "org-roam version: %s" (org-roam-version))

(find-file (expand-file-name "readme.org" ci-dir))

(org-roam-setup)
(setq graph-process (org-roam-graph))

(while (process-live-p graph-process))

(if (file-exists-p output-file)
    (message "output: %s" output-file)
  (progn
    (message "no output file from org-roam-graph. ")
    (message "process exit status: %d"
             (process-exit-status graph-process))
    (let ((tmp-file (car (directory-files temporary-file-directory t
                                          "\\.svg$"))))
      (copy-file tmp-file output-file t)
      (message "output: %s" output-file))))