From f07c31d0465e63334d0954e13ea4ee53237b3504 Mon Sep 17 00:00:00 2001 From: jonaro00 <54029719+jonaro00@users.noreply.github.com> Date: Wed, 1 Mar 2023 21:30:53 +0100 Subject: [PATCH 1/3] Fix markdown files --- CONTRIBUTING.md | 17 +++-- README.md | 19 +++-- admin/README.md | 8 +- cargo-shuttle/README.md | 121 ++++++++++++++++-------------- e2e/README.md | 6 +- gateway/README.md | 3 +- resources/README.md | 10 ++- resources/aws-rds/README.md | 4 + resources/persist/README.md | 3 +- resources/secrets/README.md | 2 + resources/shared-db/README.md | 5 +- resources/static-folder/README.md | 4 + 12 files changed, 125 insertions(+), 77 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8aab90e89..4e0df5c89 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,22 +3,23 @@ ## Raise an Issue Raising [issues](https://github.com/shuttle-hq/shuttle/issues) is encouraged. + ## Docs If you found an error in our docs, or you simply want to make them better, contributions to our [docs](https://github.com/shuttle-hq/shuttle-docs) are always appreciated! ## Running Locally + You can use Docker and docker-compose to test shuttle locally during development. See the [Docker install](https://docs.docker.com/get-docker/) and [docker-compose install](https://docs.docker.com/compose/install/) instructions if you do not have them installed already. > Note for Windows: The current [Makefile](https://github.com/shuttle-hq/shuttle/blob/main/Makefile) does not work on Windows systems by itself - if you want to build the local environment on Windows you could use [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/install). Additional Windows considerations are listed at the bottom of this page. - > Note for Linux: When building on Linux systems, if the error unknown flag: --build-arg is received, install the docker-buildx package using the package management tool for your particular system. Clone the shuttle repository (or your fork): -``` +```bash git clone git@github.com:shuttle-hq/shuttle.git cd shuttle ``` @@ -45,7 +46,7 @@ The API is now accessible on `localhost:8000` (for app proxies) and `localhost:8 In order to test local changes to the library crates, you may want to add the below to a `.cargo/config.toml` file. (See [Overriding Dependencies](https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html) for more) -``` toml +```toml [patch.crates-io] shuttle-service = { path = "[base]/shuttle/service" } shuttle-common = { path = "[base]/shuttle/common" } @@ -182,6 +183,7 @@ We will squash commits before merging to main. If you do want to squash commits, after the review process has started, the commit history can be useful for reviewers. Before committing: + - Make sure your commits don't trigger any warnings from Clippy by running: `cargo clippy --tests --all-targets`. If you have a good reason to contradict Clippy, insert an `#[allow(clippy::)]` macro, so that it won't complain. - Make sure your code is correctly formatted: `cargo fmt --all --check`. - Make sure your `Cargo.toml`'s are sorted: `cargo +nightly sort --workspace`. This command uses the [cargo-sort crate](https://crates.io/crates/cargo-sort) to sort the `Cargo.toml` dependencies alphabetically. @@ -227,6 +229,7 @@ graph BT First, `provisioner`, `gateway`, `deployer`, and `cargo-shuttle` are binary crates with `provisioner`, `gateway` and `deployer` being backend services. The `cargo-shuttle` binary is the `cargo shuttle` command used by users. The rest are the following libraries: + - `common` contains shared models and functions used by the other libraries and binaries. - `codegen` contains our proc-macro code which gets exposed to user services from `service` by the `codegen` feature flag. The redirect through `service` is to make it available under the prettier name of `shuttle_service::main`. - `service` is where our special `Service` trait is defined. Anything implementing this `Service` can be loaded by the `deployer` and the local runner in `cargo-shuttle`. @@ -238,20 +241,22 @@ Lastly, the `user service` is not a folder in this repository, but is the user s ## Windows Considerations -Currently, if you try to use 'make images' on Windows, you may find that the shell files cannot be read by Bash/WSL. This is due to the fact that Windows may have pulled the files in CRLF format rather than LF[^1], which causes problems with Bash as to run the commands, Linux needs the file in LF format. +Currently, if you try to use 'make images' on Windows, you may find that the shell files cannot be read by Bash/WSL. This is due to the fact that Windows may have pulled the files in CRLF format rather than LF[^1], which causes problems with Bash as to run the commands, Linux needs the file in LF format. Thankfully, we can fix this problem by simply using the `git config core.autocrlf` command to change how Git handles line endings. It takes a single argument: -``` +```bash git config --global core.autocrlf input ``` This should allow you to run `make images` and other Make commands with no issues. If you need to change it back for whatever reason, you can just change the last argument from 'input' to 'true' like so: -``` + +```bash git config --global core.autocrlf true ``` + After you run this command, you should be able to checkout projects that are maintained using CRLF (Windows) again. [^1]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_core_autocrlf diff --git a/README.md b/README.md index 2035ef09b..03b30c12b 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ +


- docs + docs language @@ -16,6 +17,7 @@ discord

+ --- @@ -24,9 +26,10 @@ [Shuttle](https://www.shuttle.rs/) is a Rust-native cloud development platform that lets you deploy your Rust apps for free. Shuttle is built for productivity, reliability and performance: + - Zero-Configuration support for Rust using annotations - Automatic resource provisioning (databases, caches, subdomains, etc.) via [Infrastructure-From-Code](https://www.shuttle.rs/blog/2022/05/09/ifc) -- First-class support for popular Rust frameworks ([Actix](https://docs.shuttle.rs/examples/actix), [Rocket](https://docs.shuttle.rs/examples/rocket), [Axum](https://docs.shuttle.rs/examples/axum), +- First-class support for popular Rust frameworks ([Actix](https://docs.shuttle.rs/examples/actix), [Rocket](https://docs.shuttle.rs/examples/rocket), [Axum](https://docs.shuttle.rs/examples/axum), [Tide](https://docs.shuttle.rs/examples/tide), [Poem](https://docs.shuttle.rs/examples/poem) and [Tower](https://docs.shuttle.rs/examples/tower)) - Support for deploying Discord bots using [Serenity](https://docs.shuttle.rs/examples/serenity) - Scalable hosting (with optional self-hosting) @@ -52,10 +55,13 @@ cargo shuttle login ``` To initialize your project, simply write: + ```bash cargo shuttle init --axum hello-world ``` + And to deploy it, write: + ```bash cargo shuttle project new cargo shuttle project status // until the project is "ready" @@ -75,14 +81,15 @@ $ cargo shuttle deploy Created At: 2022-04-01 08:32:34.412602556 UTC ``` -Feel free to build on-top of the generated `hello-world` boilerplate or take a stab at one of our [examples](https://docs.shuttle.rs/guide/axum-examples.html#hello-world). +Feel free to build on-top of the generated `hello-world` boilerplate or take a stab at one of our [examples](https://docs.shuttle.rs/examples/axum). For the full documentation, visit [our docs](https://docs.shuttle.rs). + ## Contributing to shuttle Contributing to shuttle is highly encouraged! -If you want to setup a local environment to test code changes to core `shuttle` packages, or want to contribute to the project check out [our docs](https://docs.shuttle.rs/community/contribute). +If you want to setup a local environment to test code changes to core `shuttle` packages, or want to contribute to the project check out [our docs](https://docs.shuttle.rs/community/contribute). Even if you are not planning to submit any code; joining our [Discord server](https://discord.gg/shuttle) and providing feedback helps us a lot! @@ -102,12 +109,12 @@ If you have any requests or suggestions feel free to open an issue. ## Status - [x] Alpha: We are testing Shuttle, API and deployments may be unstable -- [x] Public Alpha: Anyone can sign up, but go easy on us, +- [x] Public Alpha: Anyone can sign up, but go easy on us, there are a few kinks - [ ] Public Beta: Stable enough for most non-enterprise use-cases - [ ] Public: Production-ready! -We are currently in Public Alpha. Watch "releases" of this repo to get +We are currently in Public Alpha. Watch "releases" of this repo to get notified of major updates! ## Contributors ✨ diff --git a/admin/README.md b/admin/README.md index 6d56d6266..12e6e0ccc 100644 --- a/admin/README.md +++ b/admin/README.md @@ -1,6 +1,10 @@ -_Small utility used by the shuttle admin for common tasks_ +# Admin + + +*Small utility used by the shuttle admin for common tasks* ## How to test custom domain certificates locally + For local testing it is easiest to use the [Pebble](https://github.com/letsencrypt/pebble) server. So install it using whatever method works for your system. It is included in the nix environment if you use it though. @@ -31,4 +35,4 @@ cargo run -p shuttle-admin -- --api-url http://localhost:8001 acme create-accoun Safe the account JSON in a local file and use it to test creating new certificate. However, you'll the FQDN you're using for testnig to resolve to your local machine. So create an `A` record for it on your DNS with the value -`127.0.0.1`. And Bob's your uncle πŸŽ‰ +`127.0.0.1`. And Bob's your uncle πŸŽ‰ diff --git a/cargo-shuttle/README.md b/cargo-shuttle/README.md index afac19853..ae1da5f10 100644 --- a/cargo-shuttle/README.md +++ b/cargo-shuttle/README.md @@ -1,18 +1,24 @@ +
# cargo-shuttle

+ + docs + language - - build status + + build status discord

+ + `cargo-shuttle` is your commandline tool for deploying web apps on [shuttle](https://www.shuttle.rs/), the stateful serverless web platform for Rust. @@ -26,62 +32,65 @@ --- - -

Installation

-
+ +

Installation

`cargo-shuttle` is available for macOS, Linux, and Windows. To install the commandline tool, run: -```sh -$ cargo install cargo-shuttle +```bash +cargo install cargo-shuttle ``` --- - -

Subcommands

-
+ +

Subcommands

`cargo-shuttle`'s subcommands help you build and deploy web apps from start to finish. -Run `cargo-shuttle --help` to see the basic usage: - -``` -USAGE: - cargo-shuttle [OPTIONS] - -OPTIONS: - --api-url run this command against the api at the supplied url (allows targeting a custom deployed instance for this command only) [env: SHUTTLE_API=] - -h, --help Print help information - --name Specify the name of the project (overrides crate name) - -V, --version Print version information - --working-directory Specify the working directory [default: .] - -SUBCOMMANDS: - auth create user credentials for the shuttle platform - delete delete this shuttle service - deploy deploy a shuttle service - deployment manage deployments of a shuttle service - help Print this message or the help of the given subcommand(s) - init create a new shuttle service - login login to the shuttle platform - logs view the logs of a deployment in this shuttle service - run run a shuttle service locally - status view the status of a shuttle service +Run `cargo shuttle help` to see the basic usage: + +```text +Usage: cargo-shuttle [OPTIONS] + +Commands: + deploy deploy a shuttle service + deployment manage deployments of a shuttle service + init create a new shuttle service + generate generate shell completions + status view the status of a shuttle service + logs view the logs of a deployment in this shuttle service + clean remove artifacts that were generated by cargo + stop stop this shuttle service + secrets manage secrets for this shuttle service + login login to the shuttle platform + logout log out of the shuttle platform + run run a shuttle service locally + feedback Open an issue on github and provide feedback + project manage a project on shuttle + help Print this message or the help of the given subcommand(s) + +Options: + --api-url run this command against the api at the supplied url (allows targeting a custom deployed instance for this command only) [env: SHUTTLE_API=] + --working-directory Specify the working directory [default: .] + --name Specify the name of the project (overrides crate name) + -h, --help Print help + -V, --version Print version ``` ### Subcommand: `init` -To initialize a shuttle project with boilerplates, run `cargo shuttle init [OPTIONS] [PATH]`. +To initialize a shuttle project with boilerplates, run `cargo shuttle init [OPTIONS] [PATH]`. Currently, `cargo shuttle init` supports the following frameworks: -- `--axum`: for [axum](https://github.com/tokio-rs/axum) framework - `--actix-web`: for [actix web](https://actix.rs/) framework +- `--axum`: for [axum](https://github.com/tokio-rs/axum) framework - `--poem`: for [poem](https://github.com/poem-web/poem) framework +- `--poise`: for [poise](https://github.com/serenity-rs/poise) discord bot framework - `--rocket`: for [rocket](https://rocket.rs/) framework - `--salvo`: for [salvo](https://salvo.rs/) framework -- `--serenity`: for [serenity](https://serenity.rs/) discord bot framework +- `--serenity`: for [serenity](https://github.com/serenity-rs/serenity) discord bot framework - `--thruster`: for [thruster](https://github.com/thruster-rs/Thruster) framework - `--tide`: for [tide](https://github.com/http-rs/tide) framework - `--tower`: for [tower](https://github.com/tower-rs/tower) library @@ -90,10 +99,11 @@ Currently, `cargo shuttle init` supports the following frameworks: For example, running the following command will initialize a project for [rocket](https://rocket.rs/): ```sh -$ cargo shuttle init --rocket my-rocket-app +cargo shuttle init --rocket my-rocket-app ``` This should generate the following dependency in `Cargo.toml`: + ```toml shuttle-service = { version = "0.11.0", features = ["web-rocket"] } ``` @@ -104,16 +114,14 @@ The following boilerplate code should be generated into `src/lib.rs`: #[macro_use] extern crate rocket; -use shuttle_service::ShuttleRocket; - -#[get("/hello")] -fn hello() -> &'static str { +#[get("/")] +fn index() -> &'static str { "Hello, world!" } #[shuttle_service::main] -async fn init() -> ShuttleRocket { - let rocket = rocket::build().mount("/", routes![hello]); +async fn rocket() -> shuttle_service::ShuttleRocket { + let rocket = rocket::build().mount("/hello", routes![index]); Ok(rocket) } @@ -125,7 +133,7 @@ To run the shuttle project locally, use the following command: ```sh # Inside your shuttle project -$ cargo shuttle run +cargo shuttle run ``` This will compile your shuttle project and start it on the default port `8000`. Test it by: @@ -141,13 +149,13 @@ Use `cargo shuttle login` inside your shuttle project to generate an API key for ```sh # Inside a shuttle project -$ cargo shuttle login +cargo shuttle login ``` This should automatically open a browser window with an auto-generated API key for your project. Simply copy-paste the API key back in your terminal or run the following command to complete login: ```sh -$ cargo shuttle login --api-key your-api-key-from-browser +cargo shuttle login --api-key ``` ### Subcommand: `deploy` @@ -155,8 +163,8 @@ $ cargo shuttle login --api-key your-api-key-from-browser To deploy your shuttle project to the cloud, run: ```sh -$ cargo shuttle project new -$ cargo shuttle deploy +cargo shuttle project new +cargo shuttle deploy ``` Your service will immediately be available at `{crate_name}.shuttleapp.rs`. For instance: @@ -171,7 +179,7 @@ Hello, world! Check the status of your deployed shuttle project with: ```sh -$ cargo shuttle status +cargo shuttle status ``` ### Subcommand: `logs` @@ -179,22 +187,21 @@ $ cargo shuttle status Check the logs of your deployed shuttle project with: ```sh -$ cargo shuttle logs +cargo shuttle logs ``` -### Subcommand: `delete` +### Subcommand: `stop` -Once you are done with a deployment, you can delete it by running: +Once you are done with a deployment, you can stop it by running: ```sh -$ cargo shuttle delete +cargo shuttle stop ``` --- - -

Development

-
+ +

Development

Thanks for using `cargo-shuttle`! We’re very happy to have you with us! diff --git a/e2e/README.md b/e2e/README.md index 7d6caaf99..2da03d7f5 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -1,9 +1,13 @@ -# Overview +# e2e + +## Overview + This crate runs all the end-to-end tests for shuttle. These tests must run against a local dev environment, so you first have to set that up by following [these instructions](../CONTRIBUTING.md). Running all the end-to-end tests may take a long time, so it is recommended to run individual tests shipped as part of each crate in the workspace first. ## Running the tests + In the root of the repository, run: ```bash diff --git a/gateway/README.md b/gateway/README.md index 8450081ab..8797b724b 100644 --- a/gateway/README.md +++ b/gateway/README.md @@ -1,7 +1,8 @@ # shuttle-gateway ## Tests -To run the tests for gateway, follow the steps in [contributing](https://github.com/shuttle-hq/shuttle/blob/main/CONTRIBUTING.md) to set up your local environment. Then, from the root of the repository, run: + +To run the tests for gateway, follow the steps in [contributing](../CONTRIBUTING.md) to set up your local environment. Then, from the root of the repository, run: ```bash SHUTTLE_TESTS_RUNTIME_IMAGE=public.ecr.aws/shuttle-dev/deployer:latest SHUTTLE_TESTS_NETWORK=shuttle-dev_user-net cargo test --package shuttle-gateway --all-features -- --nocapture diff --git a/resources/README.md b/resources/README.md index d6e00cd77..531322c0a 100644 --- a/resources/README.md +++ b/resources/README.md @@ -1,5 +1,11 @@ +# Resources + ## Managed resources -The list of managed resources for shuttle is always growing. If you feel we are missing a resource you would like, then feel to create a feature request for your desired resource. + +The list of managed resources for shuttle is always growing. +If you feel we are missing a resource you would like, then feel to create a feature request for your desired resource. ## Writing your own managed resources -Creating your own resources is actually easy. You only need to implement the [`ResourceBuilder`](https://docs.rs/shuttle-service/latest/shuttle_service/trait.ResourceBuilder.html) trait for your resource. + +Creating your own resources is actually easy. +You only need to implement the [`ResourceBuilder`](https://docs.rs/shuttle-service/latest/shuttle_service/trait.ResourceBuilder.html) trait for your resource. diff --git a/resources/aws-rds/README.md b/resources/aws-rds/README.md index d3f311575..a8bf7099f 100644 --- a/resources/aws-rds/README.md +++ b/resources/aws-rds/README.md @@ -1,10 +1,13 @@ # Shuttle AWS RDS + This plugin provisions databases on AWS RDS using [shuttle](https://www.shuttle.rs). The following three engines are supported: + - Postgres - MySql - MariaDB ## Usage + Add `shuttle-aws-rds` to the dependencies for your service. Every engine is behind the following feature flags and attribute paths: | Engine | Feature flag | Attribute path | @@ -16,6 +19,7 @@ Add `shuttle-aws-rds` to the dependencies for your service. Every engine is behi An example using the Tide framework can be found on [GitHub](https://github.com/shuttle-hq/examples/tree/main/tide/postgres) ### Options + Each engine can take in the following options: | Option | Type | Description | diff --git a/resources/persist/README.md b/resources/persist/README.md index 333bf75ba..c829ee10b 100644 --- a/resources/persist/README.md +++ b/resources/persist/README.md @@ -1,8 +1,9 @@ # Shuttle Persist + This plugin allows persisting struct that implement `serde::Serialize` and loading them again using `serde::Deserialize`. ## Usage + Add `shuttle-persist` to the dependencies for your service. You can get this resource using the `shuttle-persist::Persist` attribute to get a `PersistInstance`. Object can now be saved using `PersistInstance.save()` and loaded again using `PersistInstance.load()`. An example using the Rocket framework can be found on [GitHub](https://github.com/shuttle-hq/examples/tree/main/rocket/persist) - diff --git a/resources/secrets/README.md b/resources/secrets/README.md index 08e7912a5..1d2a5ca84 100644 --- a/resources/secrets/README.md +++ b/resources/secrets/README.md @@ -1,7 +1,9 @@ # Shuttle Secrets + This plugin manages secrets on [shuttle](https://www.shuttle.rs). ## Usage + Add `shuttle-secrets` to the dependencies for your service, and add a `Secrets.toml` to the root of your project with the secrets you'd like to store. Make sure to add `Secrets.toml` to a `.gitignore` to omit your secrets from version control. diff --git a/resources/shared-db/README.md b/resources/shared-db/README.md index 68a36e7b2..fad4bdfa5 100644 --- a/resources/shared-db/README.md +++ b/resources/shared-db/README.md @@ -1,7 +1,9 @@ # Shuttle Shared Databases + This plugin manages databases that are shared with other services on [shuttle](https://www.shuttle.rs). ## Usage + Add `shuttle-shared-db` to the dependencies for your service. Every type of shareable database is behind the following feature flag and attribute path | Engine | Feature flag | Attribute path | @@ -12,6 +14,7 @@ Add `shuttle-shared-db` to the dependencies for your service. Every type of shar An example using the Rocket framework can be found on [GitHub](https://github.com/shuttle-hq/examples/tree/main/rocket/postgres) ### Postgres + This resource has the following options | Option | Type | Description | @@ -19,9 +22,9 @@ This resource has the following options | local_uri | &str | Don't spin a local docker instance of Postgres, but rather connect to this URI instead for `cargo shuttle run` | ### MongoDB + This resource has the following options | Option | Type | Description | |-----------|------|---------------------------------------------------------------------------------------------------------------| | local_uri | &str | Don't spin a local docker instance of MongoDB, but rather connect to this URI instead for `cargo shuttle run` | - diff --git a/resources/static-folder/README.md b/resources/static-folder/README.md index 48e27ba32..272381ed0 100644 --- a/resources/static-folder/README.md +++ b/resources/static-folder/README.md @@ -1,7 +1,9 @@ # Shuttle Static Folder + This plugin allows services to get the path to a static folder at runtime ## Usage + Add `shuttle-static-folder` to the dependencies for your service. This resource can be using by the `shuttle_static_folder::StaticFolder` attribute to get a `PathBuf` with the location of the static folder. An example using the Axum framework can be found on [GitHub](https://github.com/shuttle-hq/examples/tree/main/axum/websocket) @@ -14,11 +16,13 @@ async fn main( ``` ### Parameters + | Parameter | Type | Default | Description | |-----------|------|----------|--------------------------------------------------------------------| | folder | str | `static` | The relative path, from the crate root, to the directory containing static files to deploy | ### Example: Using the public folder instead + Since this plugin defaults to the `static` folder, the arguments can be used to use the `public` folder instead. ``` rust From 109a82ae0826474d1b1fc7cea51bd19363405681 Mon Sep 17 00:00:00 2001 From: jonaro00 <54029719+jonaro00@users.noreply.github.com> Date: Wed, 1 Mar 2023 21:31:03 +0100 Subject: [PATCH 2/3] Fix ordering --- Cargo.toml | 2 +- service/Cargo.toml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 01efa6a18..b5e0a6ce9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,12 +48,12 @@ once_cell = "1.16.0" opentelemetry = { version = "0.18.0", features = ["rt-tokio"] } opentelemetry-http = "0.7.0" pin-project = "1.0.12" +portpicker = "0.1.1" rand = "0.8.5" ring = "0.16.20" serde = "1.0.148" serde_json = "1.0.89" strum = { version = "0.24.1", features = ["derive"] } -portpicker = "0.1.1" thiserror = "1.0.37" tower = "0.4.13" tower-http = { version = "0.3.4", features = ["trace"] } diff --git a/service/Cargo.toml b/service/Cargo.toml index 2513eddcb..8fc56086e 100644 --- a/service/Cargo.toml +++ b/service/Cargo.toml @@ -27,11 +27,11 @@ libloading = { version = "0.7.4", optional = true } num_cpus = { version = "1.14.0", optional = true } pipe = "0.4.0" poem = { version = "1.3.49", optional = true } +poise = { version = "0.5.2", optional = true } rocket = { version = "0.5.0-rc.2", optional = true } salvo = { version = "0.37.5", optional = true } serde_json = { workspace = true } serenity = { version = "0.11.5", default-features = false, features = ["client", "gateway", "rustls_backend", "model"], optional = true } -poise = { version = "0.5.2", optional = true } strfmt = "0.2.2" sync_wrapper = { version = "0.1.1", optional = true } thiserror = { workspace = true } @@ -71,13 +71,13 @@ loader = ["cargo", "libloading"] web-actix-web = ["actix-web", "num_cpus"] web-axum = ["axum", "sync_wrapper"] +web-poem = ["poem"] web-rocket = ["rocket"] +web-salvo = ["salvo"] web-thruster = ["thruster"] web-tide = ["tide", "async-std"] web-tower = ["tower", "hyper"] -web-poem = ["poem"] -web-salvo = ["salvo"] +web-warp = ["warp"] -bot-serenity = ["serenity"] bot-poise = ["poise"] -web-warp = ["warp"] +bot-serenity = ["serenity"] From 62b4f79004937b1515884afae645468c127c029e Mon Sep 17 00:00:00 2001 From: jonaro00 <54029719+jonaro00@users.noreply.github.com> Date: Wed, 1 Mar 2023 21:34:26 +0100 Subject: [PATCH 3/3] Format CI config --- .circleci/config.yml | 166 ++++++++++++++++++++++++------------------- 1 file changed, 94 insertions(+), 72 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 544eea807..967baf82f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,6 @@ version: 2.1 -orbs: +orbs: docker-buildx: sensu/docker-buildx@1.1.1 aws-ecr: circleci/aws-ecr@8.1.2 win: circleci/windows@5.0 @@ -154,7 +154,7 @@ jobs: - install-protoc - run: cargo fmt --all --check - run: cargo install cargo-sort - # TODO: this is incompatible with workspace inheritance, uncomment when + # TODO: this is incompatible with workspace inheritance, uncomment when # https://github.com/DevinR528/cargo-sort/pull/29 is merged # - run: cargo sort --check --workspace - run: cargo check --workspace --all-targets @@ -191,7 +191,7 @@ jobs: - apply-patches - run: cargo fmt --all --check --manifest-path << parameters.path >>/Cargo.toml - run: cargo install cargo-sort - # TODO: this is incompatible with workspace inheritance, uncomment when + # TODO: this is incompatible with workspace inheritance, uncomment when # https://github.com/DevinR528/cargo-sort/pull/29 is merged # - run: cargo sort --check << parameters.path >> - run: | @@ -388,79 +388,101 @@ jobs: workflows: ci: jobs: - - workspace-fmt - - workspace-clippy: - name: workspace-clippy-<< matrix.framework >> - requires: - - workspace-fmt - matrix: - parameters: - framework: ["web-actix-web", "web-axum", "web-rocket", "web-poem", "web-thruster", "web-tide", "web-tower","web-warp", "web-salvo", "bot-serenity", "bot-poise"] - - check-standalone: - matrix: - parameters: - path: - - resources/aws-rds - - resources/persist - - resources/secrets - - resources/shared-db - - resources/static-folder - - service-test: - requires: - - workspace-clippy - - platform-test: - requires: - - workspace-clippy - matrix: - parameters: - crate: ["shuttle-auth", "shuttle-deployer", "cargo-shuttle", "shuttle-codegen", "shuttle-common", "shuttle-proto", "shuttle-provisioner"] - - e2e-test: - requires: - - service-test - - platform-test - - check-standalone - filters: - branches: - only: production - - build-and-push: - requires: - - e2e-test - filters: - branches: - only: production - - build-binaries-linux: - name: build-binaries-x86_64-gnu - image: ubuntu-2204:2022.04.1 - target: x86_64-unknown-linux-gnu - resource_class: medium - filters: - branches: - only: production - - build-binaries-linux: - name: build-binaries-x86_64-musl - image: ubuntu-2204:2022.04.1 - target: x86_64-unknown-linux-musl - resource_class: medium - filters: - branches: - only: production - - build-binaries-linux: - name: build-binaries-aarch64 - image: ubuntu-2004:202101-01 - target: aarch64-unknown-linux-musl - resource_class: arm.medium - filters: - branches: - only: production - - build-binaries-windows: + - workspace-fmt + - workspace-clippy: + name: workspace-clippy-<< matrix.framework >> + requires: + - workspace-fmt + matrix: + parameters: + framework: + [ + "web-actix-web", + "web-axum", + "web-rocket", + "web-poem", + "web-thruster", + "web-tide", + "web-tower", + "web-warp", + "web-salvo", + "bot-serenity", + "bot-poise", + ] + - check-standalone: + matrix: + parameters: + path: + - resources/aws-rds + - resources/persist + - resources/secrets + - resources/shared-db + - resources/static-folder + - service-test: + requires: + - workspace-clippy + - platform-test: + requires: + - workspace-clippy + matrix: + parameters: + crate: + [ + "shuttle-auth", + "shuttle-deployer", + "cargo-shuttle", + "shuttle-codegen", + "shuttle-common", + "shuttle-proto", + "shuttle-provisioner", + ] + - e2e-test: + requires: + - service-test + - platform-test + - check-standalone + filters: + branches: + only: production + - build-and-push: + requires: + - e2e-test + filters: + branches: + only: production + - build-binaries-linux: + name: build-binaries-x86_64-gnu + image: ubuntu-2204:2022.04.1 + target: x86_64-unknown-linux-gnu + resource_class: medium filters: branches: only: production - - build-binaries-mac: + - build-binaries-linux: + name: build-binaries-x86_64-musl + image: ubuntu-2204:2022.04.1 + target: x86_64-unknown-linux-musl + resource_class: medium filters: branches: - only: production - - publish-github-release: + only: production + - build-binaries-linux: + name: build-binaries-aarch64 + image: ubuntu-2004:202101-01 + target: aarch64-unknown-linux-musl + resource_class: arm.medium + filters: + branches: + only: production + - build-binaries-windows: + filters: + branches: + only: production + - build-binaries-mac: + filters: + branches: + only: production + - publish-github-release: requires: - build-binaries-x86_64-gnu - build-binaries-x86_64-musl @@ -469,4 +491,4 @@ workflows: - build-binaries-mac filters: branches: - only: production + only: production