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

View File

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

View File

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