@@ -5,6 +5,118 @@ developing `mgmt`. Useful tools, conventions, etc.
55
66Be sure to read [ quick start guide] ( quick-start-guide.md ) first.
77
8+ ## Vagrant
9+
10+ If you would like to avoid doing the above steps manually, we have prepared a
11+ [ Vagrant] ( https://www.vagrantup.com/ ) environment for your convenience. From the
12+ project directory, run a ` vagrant up ` , and then a ` vagrant status ` . From there,
13+ you can ` vagrant ssh ` into the ` mgmt ` machine. The ` MOTD ` will explain the rest.
14+ This environment isn't commonly used by the ` mgmt ` developers, so it might not
15+ be working properly.
16+
17+ ## Using Docker
18+
19+ Alternatively, you can check out the [ docker-guide] ( docker-guide.md ) in order to
20+ develop or deploy using docker. This method is not endorsed or supported, so use
21+ at your own risk, as it might not be working properly.
22+
23+ ## Information about dependencies
24+
25+ Software projects have a few different kinds of dependencies. There are _ build_
26+ dependencies, _ runtime_ dependencies, and additionally, a few extra dependencies
27+ required for running the _ test_ suite.
28+
29+ ### Build
30+
31+ * ` golang ` 1.11 or higher (required, available in some distros and distributed
32+ as a binary officially by [ golang.org] ( https://golang.org/dl/ ) )
33+
34+ ### Runtime
35+
36+ A relatively modern GNU/Linux system should be able to run ` mgmt ` without any
37+ problems. Since ` mgmt ` runs as a single statically compiled binary, all of the
38+ library dependencies are included. It is expected, that certain advanced
39+ resources require host specific facilities to work. These requirements are
40+ listed below:
41+
42+ | Resource | Dependency | Version | Check version with |
43+ | ----------| -------------------| -----------------------------| -----------------------------------------------------------|
44+ | augeas | augeas-devel | ` augeas 1.6 ` or greater | ` dnf info augeas-devel ` or ` apt-cache show libaugeas-dev ` |
45+ | file | inotify | ` Linux 2.6.27 ` or greater | ` uname -a ` |
46+ | hostname | systemd-hostnamed | ` systemd 25 ` or greater | ` systemctl --version ` |
47+ | nspawn | systemd-nspawn | ` systemd ??? ` or greater | ` systemctl --version ` |
48+ | pkg | packagekitd | ` packagekit 1.x ` or greater | ` pkcon --version ` |
49+ | svc | systemd | ` systemd ??? ` or greater | ` systemctl --version ` |
50+ | virt | libvirt-devel | ` libvirt 1.2.0 ` or greater | ` dnf info libvirt-devel ` or ` apt-cache show libvirt-dev ` |
51+ | virt | libvirtd | ` libvirt 1.2.0 ` or greater | ` libvirtd --version ` |
52+
53+ For building a visual representation of the graph, ` graphviz ` is required.
54+
55+ To build ` mgmt ` without augeas support please run:
56+ ` GOTAGS='noaugeas' make build `
57+
58+ To build ` mgmt ` without libvirt support please run:
59+ ` GOTAGS='novirt' make build `
60+
61+ To build ` mgmt ` without docker support please run:
62+ ` GOTAGS='nodocker' make build `
63+
64+ To build ` mgmt ` without augeas, libvirt or docker support please run:
65+ ` GOTAGS='noaugeas novirt nodocker' make build `
66+
67+ ## OSX/macOS/Darwin development
68+
69+ Developing and running ` mgmt ` on macOS is currently not supported (but not
70+ discouraged either). Meaning it might work but in the case it doesn't you would
71+ have to provide your own patches to fix problems (the project maintainer and
72+ community are glad to assist where needed).
73+
74+ There are currently some issues that make ` mgmt ` less suitable to run for
75+ provisioning macOS. But as a client to provision remote servers it should run
76+ fine.
77+
78+ Since the primary supported systems are Linux and these are the environments
79+ tested, it is wise to run these suites during macOS development as well. To ease
80+ this, Docker can be leveraged ([ Docker for Mac] ( https://docs.docker.com/docker-for-mac/ ) ).
81+
82+ Before running any of the commands below create the development Docker image:
83+
84+ ```
85+ docker/scripts/build-development
86+ ```
87+
88+ This image requires updating every time dependencies (` make-deps.sh ` ) changes.
89+
90+ Then to run the test suite:
91+
92+ ```
93+ docker run --rm -ti \
94+ -v $PWD:/go/src/github.com/purpleidea/mgmt/ \
95+ -w /go/src/github.com/purpleidea/mgmt/ \
96+ purpleidea/mgmt:development \
97+ make test
98+ ```
99+
100+ For convenience this command is wrapped in ` docker/scripts/exec-development ` .
101+
102+ Basically any command can be executed this way. Because the repository source is
103+ mounted into the Docker container invocation will be quick and allow rapid
104+ testing, for example:
105+
106+ ```
107+ docker/scripts/exec-development test/test-shell.sh load0.sh
108+ ```
109+
110+ Other examples:
111+
112+ ```
113+ docker/scripts/exec-development make build
114+ docker/scripts/exec-development ./mgmt run --tmp-prefix lang examples/lang/load0.mcl
115+ ```
116+
117+ Be advised that this method is not supported and it might not be working
118+ properly.
119+
8120## Testing
9121
10122This project has both unit tests in the form of golang tests and integration
@@ -45,5 +157,6 @@ individual tests to run.
45157
46158### IDE/Editor support
47159
48- - Emacs: see ` misc/emacs/ `
49- - [ Textmate] ( https://github.com/aequitas/mgmt.tmbundle )
160+ * Emacs: see ` misc/emacs/ `
161+ * [ Textmate] ( https://github.com/aequitas/mgmt.tmbundle )
162+ * [ VSCode] ( https://github.com/aequitas/mgmt.vscode )
0 commit comments