fix CI
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
6db6d5edba
commit
0738a7b7cd
24
.drone.yml
24
.drone.yml
|
@ -4,31 +4,23 @@ workspace:
|
||||||
base: /lewa
|
base: /lewa
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build ebook files
|
- name: build book docker image
|
||||||
image: xena/pandoc
|
image: "monacoremo/nix:2020-04-05-05f09348-circleci"
|
||||||
pull: always
|
|
||||||
commands:
|
commands:
|
||||||
- cd book/src && ./build.sh
|
- cd book && nix-build
|
||||||
|
- cp $(readlink result) /lewa/result/docker.tgz
|
||||||
volumes:
|
volumes:
|
||||||
- name: book
|
- name: book
|
||||||
path: /lewa/book/book
|
path: /lewa/result
|
||||||
- name: build mdbook
|
- name: push image
|
||||||
image: xena/mdbook
|
|
||||||
pull: always
|
|
||||||
commands:
|
|
||||||
- cd book && mdbook build
|
|
||||||
volumes:
|
|
||||||
- name: book
|
|
||||||
path: /lewa/book/book
|
|
||||||
- name: build image
|
|
||||||
image: docker:dind
|
image: docker:dind
|
||||||
volumes:
|
volumes:
|
||||||
- name: book
|
- name: book
|
||||||
path: /lewa/book/book
|
path: /lewa/result
|
||||||
- name: dockersock
|
- name: dockersock
|
||||||
path: /var/run/docker.sock
|
path: /var/run/docker.sock
|
||||||
commands:
|
commands:
|
||||||
- cd book && sh -c 'docker build -t xena/lewa:$DRONE_COMMIT .'
|
- docker import -f /lewa/result/docker.tgz
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: book
|
- name: book
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
let
|
||||||
|
sources = import ../nix/sources.nix;
|
||||||
|
pkgs = import sources.nixpkgs { };
|
||||||
|
nur = import (builtins.fetchTarball
|
||||||
|
"https://github.com/nix-community/NUR/archive/master.tar.gz") {
|
||||||
|
inherit pkgs;
|
||||||
|
};
|
||||||
|
tex = pkgs.callPackage ../nix/texlive.nix { };
|
||||||
|
book = pkgs.stdenv.mkDerivation {
|
||||||
|
pname = "lewa-book";
|
||||||
|
version = "devel";
|
||||||
|
src = ./.;
|
||||||
|
phases = "buildPhase installPhase";
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
kindlegen
|
||||||
|
mdbook
|
||||||
|
nur.repos.mic92.pandoc-bin
|
||||||
|
tex
|
||||||
|
];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
cp -vrf $src/src .
|
||||||
|
cp -vrf $src/book.toml .
|
||||||
|
mkdir book
|
||||||
|
mdbook build
|
||||||
|
ls -la ./book
|
||||||
|
cd ./src && ./build.sh && cd ..
|
||||||
|
cd ./book && kindlegen lewa.epub ||: && cd ..
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp -vrf book $out/book
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in pkgs.dockerTools.buildLayeredImage {
|
||||||
|
name = "xena/lewa-book";
|
||||||
|
contents = [ book nur.repos.xe.quickserv ];
|
||||||
|
config.Cmd = [ "/bin/quickserv" "-port=9001" "-dir=/book" ];
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
/nix/store/gy2ifmas4zw9i1l9i2m2411fqhbrmyf6-docker-image-lewa-book.tar.gz
|
|
@ -1,18 +1,14 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
FILES='
|
FILES='
|
||||||
intro/index.md
|
intro/index.md
|
||||||
intro/diary_language.md
|
intro/diary_language.md
|
||||||
intro/CHANGELOG.md
|
intro/CHANGELOG.md
|
||||||
'
|
'
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
pandoc -o lewa.epub --epub-chapter-level=2 --resource-path=. title.md $FILES
|
pandoc -o ../book/lewa.epub --epub-chapter-level=2 --resource-path=. title.md $FILES
|
||||||
pandoc -o test.tex -s --include-in-header sectionpagebreak.tex --variable=subparagraph --toc --toc-depth=2 --resource-path=. title.md $FILES
|
pandoc -o ../book/lewa.pdf --include-in-header sectionpagebreak.tex --variable=subparagraph --toc --toc-depth=2 --pdf-engine xelatex --resource-path=. title.md $FILES
|
||||||
pandoc -o lewa.pdf --include-in-header sectionpagebreak.tex --variable=subparagraph --toc --toc-depth=2 --pdf-engine xelatex --resource-path=. title.md $FILES || exit
|
|
||||||
kindlegen lewa.epub
|
|
||||||
mkdir -p ../book
|
|
||||||
cp -vrf lewa.mobi ../book/
|
|
||||||
cp -vrf lewa.epub ../book/
|
|
||||||
cp -vrf lewa.pdf ../book/
|
|
||||||
|
|
||||||
|
|
|
@ -12,15 +12,15 @@
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"branch": "nixos-19.09",
|
"branch": "nixpkgs-unstable",
|
||||||
"description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
|
"description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
|
||||||
"homepage": "https://github.com/NixOS/nixpkgs",
|
"homepage": "https://github.com/NixOS/nixpkgs",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs-channels",
|
"repo": "nixpkgs-channels",
|
||||||
"rev": "a7ceb2536ab11973c59750c4c48994e3064a75fa",
|
"rev": "e23f530858308b9248cfaffb4b99966c0545d4f2",
|
||||||
"sha256": "0hka65f31njqpq7i07l22z5rs7lkdfcl4pbqlmlsvnysb74ynyg1",
|
"sha256": "02hjg0zgy0wc6bczsqnqhs4d0gh1idhgdgv114nfkfwlfyx2a2r1",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/NixOS/nixpkgs-channels/archive/a7ceb2536ab11973c59750c4c48994e3064a75fa.tar.gz",
|
"url": "https://github.com/NixOS/nixpkgs-channels/archive/e23f530858308b9248cfaffb4b99966c0545d4f2.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
{ texlive }:
|
||||||
|
texlive.combine { inherit (texlive) scheme-medium noto titlesec; }
|
|
@ -1,12 +1,12 @@
|
||||||
let
|
let
|
||||||
pkgs = import <nixpkgs> { };
|
sources = import ./nix/sources.nix;
|
||||||
|
pkgs = import sources.nixpkgs { };
|
||||||
nur = import (builtins.fetchTarball
|
nur = import (builtins.fetchTarball
|
||||||
"https://github.com/nix-community/NUR/archive/master.tar.gz") {
|
"https://github.com/nix-community/NUR/archive/master.tar.gz") {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
};
|
};
|
||||||
dyson = pkgs.callPackage ./nix/dyson.nix { };
|
dyson = pkgs.callPackage ./nix/dyson.nix { };
|
||||||
tex = with pkgs;
|
tex = pkgs.callPackage ./nix/texlive.nix { };
|
||||||
texlive.combine { inherit (texlive) scheme-medium noto titlesec; };
|
|
||||||
in pkgs.mkShell {
|
in pkgs.mkShell {
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
dyson
|
dyson
|
||||||
|
|
Loading…
Reference in New Issue