mirror of
https://github.com/khuedoan/homelab.git
synced 2025-07-14 17:59:24 +07:00
build: optimize dev environment build targets
This commit is contained in:
4
Makefile
4
Makefile
@ -21,3 +21,7 @@ docs:
|
|||||||
lint:
|
lint:
|
||||||
# TODO (feature) Add lint checks for everything
|
# TODO (feature) Add lint checks for everything
|
||||||
make -C metal lint
|
make -C metal lint
|
||||||
|
|
||||||
|
dev:
|
||||||
|
make -C metal cluster env=dev
|
||||||
|
make -C bootstrap
|
||||||
|
@ -4,8 +4,10 @@
|
|||||||
|
|
||||||
Install the following packages:
|
Install the following packages:
|
||||||
|
|
||||||
- `virtualbox`
|
- `docker`
|
||||||
|
- `make`
|
||||||
- `vagrant`
|
- `vagrant`
|
||||||
|
- `virtualbox`
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
@ -16,11 +18,24 @@ Change the IP prefix in the Vagrant config to match your LAN setup, for example
|
|||||||
{{#include ../../metal/Vagrantfile:4}}
|
{{#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
|
```sh
|
||||||
make -C metal dev
|
cd metal
|
||||||
make bootstrap
|
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)
|
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:
|
.POSIX:
|
||||||
|
|
||||||
|
env ?= "prod"
|
||||||
|
|
||||||
default: boot cluster
|
default: boot cluster
|
||||||
|
|
||||||
boot:
|
boot:
|
||||||
ansible-playbook \
|
ansible-playbook \
|
||||||
--inventory inventories/prod.ini \
|
--inventory inventories/${env}.ini \
|
||||||
boot.yml
|
boot.yml
|
||||||
|
|
||||||
cluster:
|
cluster:
|
||||||
ansible-playbook \
|
ansible-playbook \
|
||||||
--inventory inventories/prod.ini \
|
--inventory inventories/${env}.ini \
|
||||||
cluster.yml
|
cluster.yml
|
||||||
|
|
||||||
shutdown:
|
shutdown:
|
||||||
ansible-playbook \
|
ansible-playbook \
|
||||||
--inventory inventories/prod.ini \
|
--inventory inventories/${env}.ini \
|
||||||
shutdown.yml
|
shutdown.yml
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
ansible-lint --project-dir .
|
ansible-lint --project-dir .
|
||||||
|
|
||||||
dev:
|
vagrant:
|
||||||
vagrant up
|
vagrant up
|
||||||
ansible-playbook \
|
|
||||||
--inventory inventories/dev.ini \
|
|
||||||
cluster.yml
|
|
||||||
|
Reference in New Issue
Block a user