Update README + remove Vagrantfile.

This commit is contained in:
Orne Brocaar 2023-05-31 12:11:48 +01:00
parent 3f77203516
commit 0e91779f30
3 changed files with 28 additions and 52 deletions

View File

@ -42,7 +42,11 @@ api: version
build-ui:
docker-compose run --rm --no-deps chirpstack-ui make build
# Enters the devshell for ChirpStack development.
# Enter the devshell.
devshell:
nix-shell
# Enters the Docker devshell for ChirpStack development.
docker-devshell:
docker-compose run --rm --service-ports --name chirpstack chirpstack

View File

@ -25,18 +25,25 @@ Building ChirpStack requires:
#### Nix
Nix is used for defining the development environment which is used for local
development and for creating the final binaries.
Nix is used for setting up the development environment which is used for local
development and for creating the binaries.
If you do not have Nix installed and do not want to, then you could also look at
the dependencies specified in the `shell.nix` file and install these manually.
Alternatively use [Vagrant](https://www.vagrantup.com/) to setup a VM with Nix and Docker
installed. See also the provided `Vagrantfile`.
If you do not have Nix installed and do not wish to install it, then you can
use the provided Docker Compose based Nix environment. To start this environment
execute the following command:
```bash
make docker-devshell
```
**Note:** You will be able to run the test commands and run `cargo build`, but
cross-compiling will not work within this environment (because it would try start
Docker within Docker).
#### Docker
Docker is used by [cross-rs](https://github.com/cross-rs/cross) for cross-compiling,
as well as some of the `make` commands you will find in the ChirpStack project.
as well as some of the `make` commands.
### Starting the development shell
@ -46,6 +53,12 @@ Run the following command to start the development shell:
nix-shell
```
Or if you do not have Nix installed, execute the following command:
```bash
make docker-devshell
```
### Building the UI
To build the ChirpStack UI, execute the following command:
@ -54,16 +67,13 @@ To build the ChirpStack UI, execute the following command:
make build-ui
```
Note that the ChirpStack UI is built using
### Running ChirpStack tests
#### Start required services
ChirpStack requires several services like PostgresQL, Redis, Mosquitto, ...
to be running before you can run the tests.
Execute the following command to start these:
to be running before you can run the tests. You need to start these services
manually if you started the development shell using `nix-shell`:
```bash
docker-compose up -d
@ -77,7 +87,7 @@ Run the following command to run the ChirpStack tests:
make test
```
### Building ChirpStack
### Building ChirpStack binaries
Before compiling the binaries, you need to install some additional development
tools (for cross-compiling, packaging, e.d.). Execute the following command:

38
Vagrantfile vendored
View File

@ -1,38 +0,0 @@
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/jammy64"
config.vm.network "forwarded_port", guest: 8080, host: 8080
# Modify this to your needs
v.memory = 8192
v.cpus = 4
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y \
ca-certificates \
curl \
gnupg
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install -y \
docker-ce \
docker-ce-cli \
containerd.io \
docker-buildx-plugin \
docker-compose-plugin
usermod -aG docker vagrant
sh <(curl -L https://nixos.org/nix/install) --daemon
SHELL
end