build: optimize dev environment build targets

This commit is contained in:
Khue Doan 2021-12-01 22:44:10 +07:00
parent b3949a42da
commit 738236c7d2
3 changed files with 29 additions and 11 deletions

View File

@ -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

View File

@ -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)

View File

@ -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