-
Notifications
You must be signed in to change notification settings - Fork 0
/
dagger.cue
126 lines (117 loc) · 2.57 KB
/
dagger.cue
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
120
121
122
123
124
125
126
package main
import (
"dagger.io/dagger"
"universe.dagger.io/docker"
)
dagger.#Plan & {
client: {
filesystem: {
"./": read: {
contents: dagger.#FS
exclude: [
".github",
"cue.mod",
"dist",
".git",
"*.cue",
"*.pdf",
]
}
"./dist/site": write: contents: actions.site.generatePage.export.directories."docs"
"./dist/pdf": write: contents: actions.pdf.printPDF.export.directories."dist"
}
}
actions: {
site: {
// Pull build context
pandoc: docker.#Pull & {
source: "portown/alpine-pandoc"
}
// Prepare environment
_addSource: docker.#Copy & {
input: pandoc.output
contents: client.filesystem."./".read.contents
dest: "/data"
}
_prepare: docker.#Run & {
input: _addSource.output
workdir: "/data"
command: {
name: "ash"
args: ["-c", "./build.sh bump-date"]
}
}
// Generate page
generatePage: docker.#Run & {
input: _prepare.output
workdir: "/data"
command: {
name: "pandoc"
args: ["./RESUME.md", "docs/configuration.yaml"]
flags: {
"--verbose": true,
"--fail-if-warnings": true,
"--standalone": true,
"--section-divs": true,
"--no-highlight": true,
"--wrap": "none",
"--columns": "1000",
"--from": "markdown_github+yaml_metadata_block+auto_identifiers+smart-hard_line_breaks+pipe_tables",
"--to": "html5",
"--template": "docs/resume.template",
"--output": "docs/index.html"
}
}
export: {
directories: "docs": _
}
}
}
pdf: {
// Pull build context
printer: docker.#Pull & {
source: "madnight/docker-alpine-wkhtmltopdf"
}
// Prepare environment
_addPage: docker.#Copy & {
input: printer.output
contents: site.generatePage.export.directories."docs"
dest: "/data"
}
_prepare: docker.#Run & {
input: _addPage.output
workdir: "/data"
entrypoint: []
command: {
name: "ash"
args: ["-c", "mkdir -p dist"]
}
}
// Print PDF
printPDF: docker.#Run & {
input: _prepare.output
entrypoint: []
workdir: "/data"
command: {
name: "wkhtmltopdf"
args: ["index.html", "dist/jossemargt-resume.pdf"]
flags: {
"--no-background": true,
"--print-media-type": true,
"--enable-local-file-access": true,
"--disable-javascript": true,
"--page-size": "Letter",
"-T": "15",
"-R": "13",
"-B": "13",
"-L": "13",
"--user-style-sheet": "stylesheets/wkhtmltopdf.css"
}
}
export: {
directories: "dist": _
}
}
}
}
}