-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspin
94 lines (78 loc) · 2.4 KB
/
spin
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
(name spin-sihl)
(description "Sihl application")
(config project_name
(input (prompt "Project name"))
(default "app"))
(config project_slug
(input (prompt "Project slug"))
(default (slugify :project_name))
(rules
("The project slug must be lowercase and contain ASCII characters and '-' only."
(eq :project_slug (slugify :project_slug)))))
(config project_snake
(default (snake_case :project_slug)))
(config create_switch
(select
(prompt "Do you want to create a local switch? (Do you want to install OPAM packages locally?")
(values Yes No))
(default false))
(config project_description
(input (prompt "Description"))
(default "A short, but powerful statement about your project")
(rules
("The last character of the description cannot be a \".\" to comply with Opam"
(neq . (last_char :project_description)))))
(config username
(input (prompt "Name of the author")))
(config github_username
(input (prompt "Github username"))
(default :username))
(config database
(select
(prompt "Which database do yo use?")
(values PostgreSql MariaDb))
(default PostgreSql))
(config ci_cd
(select
(prompt "Which CI/CD do you use?")
(values Github None))
(default Github))
(config docker
(select
(prompt "Do you use Docker?")
(values Yes No))
(default Yes))
(ignore
(files docker/*)
(enabled_if (neq :docker Yes)))
(ignore
(files github/*)
(enabled_if (neq :ci_cd Github)))
; We need to do this because Dune won't copy .github during build
(post_gen
(actions
(run mv github .github))
(enabled_if (eq :ci_cd Github)))
(post_gen
(actions
(run make switch)
(run make build)
(run make lock))
(message "🎁 Installing packages in a switch. This might take a couple minutes.")
(enabled_if (eq :create_switch Yes)))
(post_gen
(actions
(run make deps)
(run make build)
(run make lock))
(message "🎁 Installing packages globally. This might take a couple minutes.")
(enabled_if (eq :create_switch No)))
(example_commands
(commands
("make deps" "Download runtime and development dependencies.")
("make build" "Build the dependencies and the project.")
("make test" "Starts the test runner.")
("make sihl" "Runs the app executable and lists available sub-commands.")
("make sihl migrate" "Executes database migrations.")
("make dev" "Starts the Sihl app in watch mode"))
(enabled_if true))