Skip to content

Commit

Permalink
Merge pull request #1630 from scpwiki/features
Browse files Browse the repository at this point in the history
Remove local / deploy features from deepwell
  • Loading branch information
emmiegit authored Sep 30, 2023
2 parents 0ae0452 + a8bfd62 commit 530e608
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 23 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deepwell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ jobs:
- name: System Dependencies
run: sudo apt update && sudo apt install libmagic-dev

- name: Build (local)
run: cd deepwell && cargo build --features local
- name: Build (no features)
run: cd deepwell && cargo build --no-default-features

- name: Build (deploy)
run: cd deepwell && cargo build --features deploy
- name: Build (all features)
run: cd deepwell && cargo build --all-features

- name: Check Configuration
run: cd deepwell && cargo run -- config.example.toml ../install/files/local/deepwell.toml
Expand Down
2 changes: 0 additions & 2 deletions deepwell/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ authors = ["Emmie Maeda <[email protected]>"]
edition = "2021" # this is *not* the same as the current year

[features]
local = ["watch"]
deploy = []
watch = ["notify"]

[dependencies]
Expand Down
17 changes: 3 additions & 14 deletions deepwell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,11 @@ The routes are defined in `api/`, with their implementations in `methods/`, and

This executable targets the latest stable Rust. At time of writing, that is `1.72.0`.

There are two features supported by DEEPWELL, along with what they add:

* `local` &mdash; Intended for local development, where frequent compilation is likely.
* Tracks the locale directory and configuration file, reloading them if they are modified.
* `deploy` &mdash; Intended for "deployed" environments, i.e. `dev` and `prod`.

Thus for a _release build_ (being deployed somewhere) you would want to run:

```sh
$ cargo build --release --features deploy
```

And for a _local build_ you would want:
At present the crate has one feature:
* `notify` &mdash; Enables a feature to track the locale directory and configuration file, reloading the server if they are modified. This should be used in local builds only, not in production.

```sh
$ cargo build --features local
$ cargo build [--features ...] [--release]
```

### Execution
Expand Down
2 changes: 1 addition & 1 deletion install/aws/dev/docker/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ WORKDIR /src/deepwell
RUN cargo vendor

# Build deepwell server
RUN cargo build --release --features deploy
RUN cargo build --release

#
# Final image
Expand Down
2 changes: 1 addition & 1 deletion install/aws/prod/docker/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ WORKDIR /src/deepwell
RUN cargo vendor

# Build deepwell server
RUN cargo build --release --features deploy
RUN cargo build --release

#
# Final image
Expand Down
2 changes: 1 addition & 1 deletion install/local/dev/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ RUN mkdir /src
COPY ./deepwell /src/deepwell
WORKDIR /src/deepwell

CMD ["/usr/local/cargo/bin/cargo", "watch", "-w", "/src/deepwell", "-w", "/opt/locales", "-w", "/etc/deepwell.toml", "--why", "-x", "run --features local -- /etc/deepwell.toml"]
CMD ["/usr/local/cargo/bin/cargo", "watch", "-w", "/src/deepwell", "-w", "/opt/locales", "-w", "/etc/deepwell.toml", "--why", "-x", "run -- /etc/deepwell.toml"]

0 comments on commit 530e608

Please sign in to comment.