From 9815564a30e331a0308b7764ed6ca694ed66b28e Mon Sep 17 00:00:00 2001 From: Blake Mealey Date: Tue, 16 Nov 2021 07:49:05 -0800 Subject: [PATCH] rename to mantle (#68) --- .github/workflows/release.yml | 24 +++++----- Cargo.lock | 48 +++++++++---------- Cargo.toml | 2 +- README.md | 6 +-- bump-version.ps1 | 4 +- .../dev/{rocat.yml => mantle.yml} | 4 +- src/cli.rs | 16 +++---- src/config.rs | 2 +- src/project.rs | 2 +- src/resources.rs | 4 +- src/roblox_api.rs | 2 +- src/state.rs | 6 +-- 12 files changed, 60 insertions(+), 60 deletions(-) rename project-fixtures/dev/{rocat.yml => mantle.yml} (91%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8afb76f..3c3be5b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,13 +25,13 @@ jobs: - name: Zip binary uses: thedoctor0/zip-release@0.6.0 with: - filename: rocat-win64.zip - path: target/release/rocat.exe + filename: mantle-win64.zip + path: target/release/mantle.exe - name: Upload artifacts uses: actions/upload-artifact@v2 with: - name: rocat-win64 - path: rocat-win64.zip + name: mantle-win64 + path: mantle-win64.zip macos: runs-on: macos-latest steps: @@ -56,13 +56,13 @@ jobs: - name: Zip binary uses: thedoctor0/zip-release@0.6.0 with: - filename: rocat-macos.zip - path: target/release/rocat + filename: mantle-macos.zip + path: target/release/mantle - name: Upload artifacts uses: actions/upload-artifact@v2 with: - name: rocat-macos - path: rocat-macos.zip + name: mantle-macos + path: mantle-macos.zip linux: runs-on: ubuntu-latest steps: @@ -83,13 +83,13 @@ jobs: - name: Zip binary uses: thedoctor0/zip-release@0.6.0 with: - filename: rocat-linux.zip - path: target/release/rocat + filename: mantle-linux.zip + path: target/release/mantle - name: Upload artifacts uses: actions/upload-artifact@v2 with: - name: rocat-linux - path: rocat-linux.zip + name: mantle-linux + path: mantle-linux.zip release: runs-on: ubuntu-latest needs: [windows, macos, linux] diff --git a/Cargo.lock b/Cargo.lock index eca5021..fd84d49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -860,6 +860,30 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" +[[package]] +name = "mantle" +version = "0.8.2" +dependencies = [ + "base64 0.13.0", + "chrono", + "clap", + "difference", + "glob", + "mime_guess 2.0.3", + "multipart", + "rusoto_core", + "rusoto_s3", + "scraper", + "serde", + "serde_json", + "serde_yaml", + "sha2", + "tokio", + "ureq", + "url 2.2.2", + "yansi", +] + [[package]] name = "markup5ever" version = "0.10.1" @@ -1626,30 +1650,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "rocat" -version = "0.8.2" -dependencies = [ - "base64 0.13.0", - "chrono", - "clap", - "difference", - "glob", - "mime_guess 2.0.3", - "multipart", - "rusoto_core", - "rusoto_s3", - "scraper", - "serde", - "serde_json", - "serde_yaml", - "sha2", - "tokio", - "ureq", - "url 2.2.2", - "yansi", -] - [[package]] name = "rusoto_core" version = "0.47.0" diff --git a/Cargo.toml b/Cargo.toml index dcf70b8..c9288f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "rocat" +name = "mantle" version = "0.8.2" authors = ["Blake Mealey "] edition = "2018" diff --git a/README.md b/README.md index d0c4666..e1ceefa 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Rocat 🚀 +# Mantle 🚀 An infrastructure-as-code and deployment tool for Roblox. @@ -13,7 +13,7 @@ It is recommended to install with Foreman, with the following config: # foreman.toml [tools] -rocat = { source = "blake-mealey/rocat", version = "0.8.2" } +mantle = { source = "blake-mealey/mantle", version = "0.8.2" } ``` You can learn more about Foreman including how to install it from [its @@ -21,4 +21,4 @@ documentation](https://github.com/Roblox/foreman#readme). ## Documentation -Check out the [docs site](https://rocat-docs.vercel.app) for more info. +Check out the [docs site](https://mantle-docs.vercel.app) for more info. diff --git a/bump-version.ps1 b/bump-version.ps1 index e4e7adb..c174613 100644 --- a/bump-version.ps1 +++ b/bump-version.ps1 @@ -18,7 +18,7 @@ function Get-PackageVersion() { } $PackageMeta = ConvertFrom-Json -InputObject $PackageMetaRaw - return ($PackageMeta.packages | where { $_.name -eq "rocat" }).version + return ($PackageMeta.packages | where { $_.name -eq "mantle" }).version } function Undo-Changes() { @@ -117,7 +117,7 @@ function Invoke-BumpVersion() { return } - Write-Host "🎉 Bumped Rocat version to $NextVersion. Ready to push with 'git push origin && git push --tags'`n" + Write-Host "🎉 Bumped Mantle version to $NextVersion. Ready to push with 'git push origin && git push --tags'`n" $choices = "&Yes", "&No" $selectedIndex = $Host.UI.PromptForChoice($Null, "Automatically push changes to Git?", $choices, 0) diff --git a/project-fixtures/dev/rocat.yml b/project-fixtures/dev/mantle.yml similarity index 91% rename from project-fixtures/dev/rocat.yml rename to project-fixtures/dev/mantle.yml index b46ebc8..20699b4 100644 --- a/project-fixtures/dev/rocat.yml +++ b/project-fixtures/dev/mantle.yml @@ -68,5 +68,5 @@ templates: state: remote: region: [us-west-2] - bucket: rocat-states - key: project-fixtures/single-place + bucket: mantle-states + key: project-fixtures/dev diff --git a/src/cli.rs b/src/cli.rs index 8f373a9..b8d36ed 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -4,17 +4,17 @@ use clap::{crate_version, App, AppSettings, Arg, SubCommand}; use std::env; fn get_app() -> App<'static, 'static> { - App::new("Rocat") + App::new("Mantle") .version(crate_version!()) .about("Manages Roblox deployments") .setting(AppSettings::ArgRequiredElseHelp) .subcommand( SubCommand::with_name("deploy") - .about("Deploys a Rocat deployment") + .about("Deploys a Mantle deployment") .arg( Arg::with_name("PROJECT") .index(1) - .help("The Rocat project: either the path to a directory containing a 'rocat.yml' file or the path to a configuration file. Defaults to the current directory.") + .help("The Mantle project: either the path to a directory containing a 'mantle.yml' file or the path to a configuration file. Defaults to the current directory.") .takes_value(true) ) .arg( @@ -27,15 +27,15 @@ fn get_app() -> App<'static, 'static> { .arg( Arg::with_name("allow_purchases") .long("allow-purchases") - .help("Gives Rocat permission to make purchases with Robux.")) + .help("Gives Mantle permission to make purchases with Robux.")) ) .subcommand( SubCommand::with_name("destroy") - .about("Destroys a Rocat deployment") + .about("Destroys a Mantle deployment") .arg( Arg::with_name("PROJECT") .index(1) - .help("The Rocat project: either the path to a directory containing a 'rocat.yml' file or the path to a configuration file. Defaults to the current directory.") + .help("The Mantle project: either the path to a directory containing a 'mantle.yml' file or the path to a configuration file. Defaults to the current directory.") .takes_value(true) ) .arg( @@ -48,11 +48,11 @@ fn get_app() -> App<'static, 'static> { ) .subcommand( SubCommand::with_name("outputs") - .about("Prints a Rocat deployment's outputs to the console or a file in a machine-readable format") + .about("Prints a Mantle deployment's outputs to the console or a file in a machine-readable format") .arg( Arg::with_name("PROJECT") .index(1) - .help("The Rocat project: either the path to a directory containing a 'rocat.yml' file or the path to a configuration file. Defaults to the current directory.") + .help("The Mantle project: either the path to a directory containing a 'mantle.yml' file or the path to a configuration file. Defaults to the current directory.") .takes_value(true) ) .arg( diff --git a/src/config.rs b/src/config.rs index f94ab76..a463713 100644 --- a/src/config.rs +++ b/src/config.rs @@ -42,7 +42,7 @@ impl fmt::Display for RemoteStateConfig { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, - "{}/{}/{}.rocat-state.yml", + "{}/{}/{}.mantle-state.yml", self.region.name(), self.bucket, self.key diff --git a/src/project.rs b/src/project.rs index b1fb160..33ad217 100644 --- a/src/project.rs +++ b/src/project.rs @@ -18,7 +18,7 @@ fn parse_project(project: Option<&str>) -> Result<(PathBuf, PathBuf), String> { let project_path = Path::new(project).to_owned(); let (project_dir, config_file) = if project_path.is_dir() { - (project_path.clone(), project_path.join("rocat.yml")) + (project_path.clone(), project_path.join("mantle.yml")) } else if project_path.is_file() { (project_path.parent().unwrap().into(), project_path) } else { diff --git a/src/resources.rs b/src/resources.rs index b9454b7..e0ab130 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -439,7 +439,7 @@ impl ResourceGraph { ))) } else { return OperationResult::Skipped(format!( - "Resource would cost {} Robux to create. Give Rocat permission to make purchases with --allow-purchases.", + "Resource would cost {} Robux to create. Give Mantle permission to make purchases with --allow-purchases.", price )); } @@ -517,7 +517,7 @@ impl ResourceGraph { ))) } else { return OperationResult::Skipped(format!( - "Resource would cost {} Robux to update. Give Rocat permission to make purchases with --allow-purchases.", + "Resource would cost {} Robux to update. Give Mantle permission to make purchases with --allow-purchases.", price )); } diff --git a/src/roblox_api.rs b/src/roblox_api.rs index 3aee303..12a57f5 100644 --- a/src/roblox_api.rs +++ b/src/roblox_api.rs @@ -1165,7 +1165,7 @@ impl RobloxApi { let res = ureq::post("https://data.roblox.com/data/upload/json") .query("assetTypeId", "13") .query("name", &file_name) - .query("description", "madewithrocat") + .query("description", "madewithmantle") .set("Content-Type", "*/*") .set_auth(AuthType::CookieAndCsrfToken, &mut self.roblox_auth)? .send_bytes(&data); diff --git a/src/state.rs b/src/state.rs index 60e29f9..44eb192 100644 --- a/src/state.rs +++ b/src/state.rs @@ -28,7 +28,7 @@ pub struct ResourceState { } fn get_state_file_path(project_path: &Path) -> PathBuf { - project_path.join(".rocat-state.yml") + project_path.join(".mantle-state.yml") } fn get_hash(data: &[u8]) -> String { @@ -89,7 +89,7 @@ async fn get_state_from_remote( let object_res = client .get_object(rusoto_s3::GetObjectRequest { bucket: config.bucket.clone(), - key: format!("{}.rocat-state.yml", config.key), + key: format!("{}.mantle-state.yml", config.key), ..Default::default() }) .await; @@ -467,7 +467,7 @@ pub async fn save_state_to_remote(config: &RemoteStateConfig, data: &[u8]) -> Re let res = client .put_object(rusoto_s3::PutObjectRequest { bucket: config.bucket.clone(), - key: format!("{}.rocat-state.yml", config.key), + key: format!("{}.mantle-state.yml", config.key), body: Some(rusoto_core::ByteStream::from(data.to_vec())), ..Default::default() })