Crates.io | rush-cli |
lib.rs | rush-cli |
version | |
source | src |
created_at | 2024-09-15 06:52:15.738534 |
updated_at | 2024-12-09 15:01:01.96035 |
description | Rush Deployment: A tool to bring the development experience as close to the production experience as possible. |
homepage | https://github.com/wonop-io/rush |
repository | https://github.com/wonop-io/rush |
max_upload_size | |
id | 1375294 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Rush
(Rush Deployment) is a Rust-based deployment tool that aims to bridge the gap between development and production environments by allowing cross-compilation of x86
Docker images on arm64
platforms, such as Apple Silicon. This ensures developers can build and deploy x86
images from Apple Silicon without the need for separate environments. It also simplifies managing multiple products in a single repository and running multiple containers locally for development with ingress routing traffic.
x86
on Apple Silicon).local
, dev
, staging
and prod
) with separate configurations and secrets.Before installing rush
, ensure that you have the following prerequisites installed:
Rust via rustup
:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Trunk (for frontend builds):
rustup target add wasm32-unknown-unknown
trunk
:
cargo install trunk
trunk
to avoid conflicts with other CI tools:
pushd $HOME/.cargo/bin
mv trunk wasm-trunk
popd
Docker and buildx: Ensure that Docker and Docker Buildx are installed for cross-compilation.
Toolchains (Apple Silicon): For Apple Silicon users, cross-compilation requires installing the x86_64
toolchain and Rust targets:
arch -arm64 brew install SergioBenitez/osxct/x86_64-unknown-linux-gnu
rustup target add x86_64-unknown-linux-gnu
rush
To install rush
, run the following command:
cargo install rush-cli
Make sure that the cargo binary directory is in your PATH
:
source $HOME/.cargo/env
If you have already installed rush
, you can update it by running the installation command again.
Once you’ve followed the installation steps, you can test rush
with one of its examples. From anywhere within the cloned repository, run:
rush helloworld.wonop.io dev
This will start the development server for the helloworld.wonop.io
example.
Initialize Secrets: Initialize the required secrets for your local environment:
rush helloworld.wonop.io secrets init
This will generate .env
files containing environment variables and secrets necessary for running your platform locally. For PostgreSQL and Redis, use the following connection strings:
postgres://admin:admin@localhost:5433/backend
redis://localhost:6379
Start the Development Server: Once the secrets and environment variables are set, start the development server:
rush helloworld.wonop.io dev
The application will be available at http://localhost:9000
.
For deploying to a Kubernetes cluster, rush
provides seamless integration. Follow these steps for configuring secrets and setting up the environment:
Initialize Secrets for Staging: Run the following command to configure secrets for the staging environment:
rush --env staging helloworld.wonop.io secrets init
Enter Database and Redis URLs: During the initialization, you’ll be prompted to enter the database and Redis URLs:
Example database URL: postgres://[user]:[password]@[host]:[port]/[database_name]
Example Redis URL: rediss://[user]:[password]@[host]:[port]
Deploying to Kubernetes:
Assuming you have a Kubernetes cluster and kubectl
configured, along with contexts and Docker registry configured in rushd.yaml
, you can deploy the application with:
rush --env staging helloworld.wonop.io deploy
For Apple Silicon users, rush
cross-compiles x86
images for deployment onto x86
Kubernetes clusters. Ensure that you have the x86_64
toolchain and Docker Buildx configured. Follow these steps:
Install the necessary toolchain:
arch -arm64 brew install SergioBenitez/osxct/x86_64-unknown-linux-gnu
Add the x86_64
target for Rust:
rustup target add x86_64-unknown-linux-gnu
rush
will automatically handle cross-compiling Docker images into x86
format, making them compatible with your production environment.
rush
is designed to handle multiple products within a single repository. You can create a new product by simply structuring your directory as follows:
/products
/io.wonop.helloworld
/io.wonop.app
/io.wonop.api
Running rush
from the repository root will manage all products simultaneously. This simplifies development workflows when working with large, multi-product projects.