mirror of
https://github.com/khuedoan/homelab.git
synced 2024-12-23 01:04:32 +07:00
build: optimize dev environment build targets
This commit is contained in:
parent
b3949a42da
commit
738236c7d2
4
Makefile
4
Makefile
@ -21,3 +21,7 @@ docs:
|
||||
lint:
|
||||
# TODO (feature) Add lint checks for everything
|
||||
make -C metal lint
|
||||
|
||||
dev:
|
||||
make -C metal cluster env=dev
|
||||
make -C bootstrap
|
||||
|
@ -4,8 +4,10 @@
|
||||
|
||||
Install the following packages:
|
||||
|
||||
- `virtualbox`
|
||||
- `docker`
|
||||
- `make`
|
||||
- `vagrant`
|
||||
- `virtualbox`
|
||||
|
||||
## Build
|
||||
|
||||
@ -16,11 +18,24 @@ Change the IP prefix in the Vagrant config to match your LAN setup, for example
|
||||
{{#include ../../metal/Vagrantfile:4}}
|
||||
```
|
||||
|
||||
Follow the remaining steps in the [configuration guide](./deployment/configuration.md), then build the cluster and bootstrap it:
|
||||
Follow the **remaining steps in the [configuration guide](./deployment/configuration.md)**, then create a test VM:
|
||||
|
||||
```sh
|
||||
make -C metal dev
|
||||
make bootstrap
|
||||
cd metal
|
||||
vagrant up
|
||||
cd ..
|
||||
```
|
||||
|
||||
Open the tools container:
|
||||
|
||||
```sh
|
||||
make tools
|
||||
```
|
||||
|
||||
Build a cluster on the test VM and bootstrap it:
|
||||
|
||||
```
|
||||
make dev
|
||||
```
|
||||
|
||||
Finally follow the [DNS guide](./deployment/dns.md) to update your DNS setup (the easiest one is the `/etc/hosts` option)
|
||||
|
@ -1,27 +1,26 @@
|
||||
.POSIX:
|
||||
|
||||
env ?= "prod"
|
||||
|
||||
default: boot cluster
|
||||
|
||||
boot:
|
||||
ansible-playbook \
|
||||
--inventory inventories/prod.ini \
|
||||
--inventory inventories/${env}.ini \
|
||||
boot.yml
|
||||
|
||||
cluster:
|
||||
ansible-playbook \
|
||||
--inventory inventories/prod.ini \
|
||||
--inventory inventories/${env}.ini \
|
||||
cluster.yml
|
||||
|
||||
shutdown:
|
||||
ansible-playbook \
|
||||
--inventory inventories/prod.ini \
|
||||
--inventory inventories/${env}.ini \
|
||||
shutdown.yml
|
||||
|
||||
lint:
|
||||
ansible-lint --project-dir .
|
||||
|
||||
dev:
|
||||
vagrant:
|
||||
vagrant up
|
||||
ansible-playbook \
|
||||
--inventory inventories/dev.ini \
|
||||
cluster.yml
|
||||
|
Loading…
Reference in New Issue
Block a user