-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Update Rust version to 1.77 and refactor server startup * Remove empty lines in metrics route file * Fix CI * Commented out dead code for now * Fixed converstion to make vs cargo-make
- Loading branch information
Showing
14 changed files
with
435 additions
and
488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,41 @@ | ||
# Contributing | ||
|
||
## Cargo Make | ||
## Using Make | ||
|
||
This package includes a make file for easy development. | ||
You can get use the make file by installing cargo make via `cargo install cargo-make` | ||
This package includes a `Makefile` for easy development setup and operations. Ensure you have `make` installed on your system, which is generally available by default on Unix-like operating systems (Linux, macOS). For Windows, you might need to install a tool like `GNU Make`. | ||
|
||
### Commands | ||
|
||
| Command | What it does | | ||
| ------------------- | ------------------------------------------------------------------------------ | | ||
| makers format | Formats the `http-server` and `odin` | | ||
| makers clippy | Builds and runs clippy on `http-server` and `odin` | | ||
| makers build | Builds the two projects | | ||
| makers start:dev | Formats, Clippy, docker-compose build, and docker-compose up | | ||
| makers docker:build | Runs docker-compose build for the file `docker-compose.dev.yml` | | ||
| makers docker:up | Runs docker-compose up for `docker-compose.dev.yml` | | ||
| makers access | Runs `docker-compose -f docker-compose.dev.yml exec --user steam valheim bash` | | ||
| makers access:admin | Runs `docker-compose -f docker-compose.dev.yml exec valheim bash` | | ||
| makers release | Builds a release binary for `odin` and `http-server` | | ||
Below is a list of available `make` commands and their descriptions: | ||
|
||
| Command | What it does | | ||
| -------------------- | ---------------------------------------------------------------------------------------------------------- | | ||
| `make setup` | Prepares the development environment by creating `docker-compose.dev.yml` if it doesn't exist. | | ||
| `make member_format` | Formats the code using `cargo fmt`. | | ||
| `make member_clippy` | Runs clippy to check the Rust code. | | ||
| `make docker-build` | Builds the Docker images using the development compose file. | | ||
| `make docker-up` | Starts the Docker containers as defined in `docker-compose.dev.yml`. | | ||
| `make docker-down` | Stops the Docker containers and removes them. | | ||
| `make docker-push` | Pushes the Docker images to a Docker registry. | | ||
| `make start` | Starts the development environment, including formatting, clippy checks, and Docker containers. | | ||
| `make start-dev` | Stops any running containers, rebuilds them, and starts them up for development. | | ||
| `make build-dev` | Formats code, runs clippy, and builds Docker images. | | ||
| `make access` | Provides shell access to the `valheim` container as the `steam` user. | | ||
| `make access-admin` | Provides shell access to the `valheim` container as the `root` user. | | ||
| `make release` | Builds release binaries for the projects, intended for production environments (set `PROFILE=production`). | | ||
|
||
### Development Workflow | ||
|
||
To start working on the project, you can run the following command to set up your environment and bring up the development services: | ||
|
||
```bash | ||
make start-dev | ||
``` | ||
|
||
This command will ensure all code is formatted, clippy checks are passed, Docker images are built, and containers are running. If you want to build the project for production, remember to set the `PROFILE` environment variable: | ||
|
||
```bash | ||
make release PROFILE=production | ||
``` | ||
|
||
This ensures that the release binaries are built according to the production profile settings. |
Oops, something went wrong.