aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bash/fake-symlinks.sh8
-rw-r--r--git/default.nix27
-rw-r--r--git/gitlab-ci.yml37
-rw-r--r--gitlab-ci.yml28
4 files changed, 70 insertions, 30 deletions
diff --git a/bash/fake-symlinks.sh b/bash/fake-symlinks.sh
index 8acef12..b61e798 100644
--- a/bash/fake-symlinks.sh
+++ b/bash/fake-symlinks.sh
@@ -4,5 +4,9 @@ if [[ -n "$GITHUB_TOKEN" ]]; then
cat $DOTFILES/git/gitconfig.ini | envsubst > ~/.gitconfig
fi
-cp $DOTFILES/gitlab-ci.yml $DOTFILES/../org.euandreh.misc/.gitlab-ci.yml
-cp $DOTFILES/gitlab-ci.yml $DOTFILES/../org.euandreh.http/.gitlab-ci.yml
+repos=("org.euandreh.misc" "org.euandreh.http")
+
+for repo in ${repos[@]}; do
+ cp "$DOTFILES/git/gitlab-ci.yml" "$DOTFILES/../$repo/.gitlab-ci.yml"
+ cp "$DOTFILES/git/default.nix" "$DOTFILES/../$repo/default.nix"
+done
diff --git a/git/default.nix b/git/default.nix
new file mode 100644
index 0000000..e406e9f
--- /dev/null
+++ b/git/default.nix
@@ -0,0 +1,27 @@
+let
+ pkgsOriginal = import <nixpkgs> {};
+ pkgsSrc = pkgsOriginal.fetchzip {
+ url = "https://github.com/NixOS/nixpkgs/archive/18.03.zip";
+ sha256 = "0hk4y2vkgm1qadpsm4b0q1vxq889jhxzjx3ragybrlwwg54mzp4f";
+ };
+ pkgs = import (pkgsSrc) {};
+
+in {
+ proseDocs = with pkgs; stdenv.mkDerivation rec {
+ name = "proseDocs";
+ src = ./.;
+ buildInputs = [ emacs ];
+ builder = builtins.toFile "builder.sh" ''
+ source $stdenv/setup
+ mkdir $out
+ cp $src/DOCUMENTATION.org $out/DOCUMENTATION.org
+ ls -lahp $out
+
+ pushd $out
+ emacs DOCUMENTATION.org --eval '(setq org-export-allow-bind-keywords t org-html-postamble t)' --batch -f org-html-export-to-html --kill
+ rm DOCUMENTATION.org
+ mv DOCUMENTATION.html index.html
+ popd
+ '';
+ };
+}
diff --git a/git/gitlab-ci.yml b/git/gitlab-ci.yml
new file mode 100644
index 0000000..91d7b1c
--- /dev/null
+++ b/git/gitlab-ci.yml
@@ -0,0 +1,37 @@
+image: clojure:lein-2.7.0
+stages:
+ - test
+ - pages
+
+lint:
+ stage: test
+ before_script:
+ - lein deps
+ script:
+ - lein lint
+
+test:
+ stage: test
+ before_script:
+ - lein deps
+ script:
+ - lein test
+
+pages:
+ stage: pages
+ image: nixos/nix:2.0.4
+ coverage: '/ALL FILES.*?(\d+\.\d+)/'
+ script:
+ - nix-shell -p leiningen --run "lein docs"
+ - nix-build -A proseDocs
+ - cp result/index.html public/
+ artifacts:
+ paths:
+ - public
+ only:
+ - master
+ cache:
+ key: global-shared-cache
+ paths:
+ - $HOME/.m2
+ - /nix/store/
diff --git a/gitlab-ci.yml b/gitlab-ci.yml
deleted file mode 100644
index 859af7c..0000000
--- a/gitlab-ci.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-image: clojure:lein-2.7.0
-stages:
- - test
- - pages
-
-before_script:
- - lein deps
-
-lint:
- stage: test
- script:
- - lein lint
-
-test:
- stage: test
- script:
- - lein test
-
-pages:
- stage: pages
- coverage: '/ALL FILES.*?(\d+\.\d+)/'
- script:
- - lein docs
- artifacts:
- paths:
- - public
- only:
- - master