3 Commits

Author SHA1 Message Date
0967e35fbf chore(release): 0.2.0 (#7)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
### Added
- *(ci)* with pr
- *(ci)* on pr only
- *(ci)* with ci:pr.sh file
- *(ci)* update ci with best settings
- *(ci)* pr ignore master
- *(ci)* ignore pr for master
- add git init
- with actual docker login
- with docker login
- back to default
- with ldd
- only ci
- with musl instead
- with some debug stuff
- with shared volume
- with shared volume
- without going into module
- set to use prefix when in ci
- only master
- with working main
- ci:main script for ci
- with run script
- fixed stuff
- with ultra caching
- with ci
- with set -e for abort
- with drone yml
- add mkdocs build
- add basic version
- update with repository
- add publishable to rest
- hack get in control of log level

### Docs
- fix admonitions
- add docs
- remove 0.1 milestone

### Fixed
- with actual install

### Other
- *(rust)* fmt
- *(rust)* clippy fix
- *(ci)* no please for pr
- *(ci)* rename pr -> pull-request in ci:pr
- remove faulty test
- add git (alpine)
- add git
- musl
- remember package name
- rename variable
- openssl-src
- with openssl-dev
- with pkg config sysroot
- with musl dev
- with build-essential
- with libssl-dev
- with token
- add mit license
- add logging to stdout
- update versions
- add docs

Co-authored-by: cuddle-please <bot@cuddle.sh>
Reviewed-on: https://git.front.kjuulh.io/kjuulh/cuddle-please/pulls/7
2023-08-03 23:23:05 +00:00
67c2c0c0c5 chore(rust): fmt
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 01:19:15 +02:00
78307ec8a3 chore(rust): clippy fix
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 01:18:58 +02:00
5 changed files with 105 additions and 55 deletions

View File

@@ -6,6 +6,73 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.2.0] - 2023-08-03
### Added
- *(ci)* with pr
- *(ci)* on pr only
- *(ci)* with ci:pr.sh file
- *(ci)* update ci with best settings
- *(ci)* pr ignore master
- *(ci)* ignore pr for master
- add git init
- with actual docker login
- with docker login
- back to default
- with ldd
- only ci
- with musl instead
- with some debug stuff
- with shared volume
- with shared volume
- without going into module
- set to use prefix when in ci
- only master
- with working main
- ci:main script for ci
- with run script
- fixed stuff
- with ultra caching
- with ci
- with set -e for abort
- with drone yml
- add mkdocs build
- add basic version
- update with repository
- add publishable to rest
- hack get in control of log level
### Docs
- fix admonitions
- add docs
- remove 0.1 milestone
### Fixed
- with actual install
### Other
- *(rust)* fmt
- *(rust)* clippy fix
- *(ci)* no please for pr
- *(ci)* rename pr -> pull-request in ci:pr
- remove faulty test
- add git (alpine)
- add git
- musl
- remember package name
- rename variable
- openssl-src
- with openssl-dev
- with pkg config sysroot
- with musl dev
- with build-essential
- with libssl-dev
- with token
- add mit license
- add logging to stdout
- update versions
- add docs
## [0.1.0] - 2023-08-01
### Added

View File

@@ -2,19 +2,14 @@ use std::path::Path;
use std::path::PathBuf;
use std::sync::Arc;
use build::build_and_deploy;
use clap::Args;
use clap::Parser;
use clap::Subcommand;
use clap::ValueEnum;
use dagger_sdk::ContainerId;
use dagger_sdk::ContainerPublishOpts;
use dagger_sdk::Platform;
use dagger_sdk::QueryContainerOpts;
use futures::StreamExt;
use tokio::sync::Mutex;
use tokio::task::JoinHandle;
use crate::please_release::run_release_please;
@@ -137,7 +132,7 @@ async fn main() -> eyre::Result<()> {
&cli.global,
&base_image,
&prod_image,
&bin_name,
bin_name,
&None,
)
.await?;
@@ -158,11 +153,11 @@ async fn main() -> eyre::Result<()> {
image,
bin_name,
} => {
build::build_and_deploy(client, &cli.global, &bin_name, &image, &tag).await?;
build::build_and_deploy(client, &cli.global, bin_name, image, tag).await?;
}
LocalCommands::PleaseRelease => todo!(),
LocalCommands::BuildDocs {} => {
let image = docs::execute(
let _image = docs::execute(
client.clone(),
&cli.global,
&Some("linux/amd64".to_string()),
@@ -179,10 +174,10 @@ async fn main() -> eyre::Result<()> {
let args = &cli.global;
let base_image =
base_rust_image(client.clone(), &args, &None, bin_name, &"debug".into())
base_rust_image(client.clone(), args, &None, bin_name, &"debug".into())
.await
.unwrap();
test::execute(client.clone(), &args, base_image)
test::execute(client.clone(), args, base_image)
.await
.unwrap();
}
@@ -195,14 +190,14 @@ async fn main() -> eyre::Result<()> {
) {
let args = &cli.global;
build::build(client.clone(), &args, bin_name, image, tag)
build::build(client.clone(), args, bin_name, image, tag)
.await
.unwrap();
}
tokio::join!(
test(client.clone(), &cli, &bin_name),
build(client.clone(), &cli, &bin_name, &image, &tag),
test(client.clone(), &cli, bin_name),
build(client.clone(), &cli, bin_name, image, tag),
);
}
Commands::Main {
@@ -214,10 +209,10 @@ async fn main() -> eyre::Result<()> {
let args = &cli.global;
let base_image =
base_rust_image(client.clone(), &args, &None, bin_name, &"debug".into())
base_rust_image(client.clone(), args, &None, bin_name, &"debug".into())
.await
.unwrap();
test::execute(client.clone(), &args, base_image)
test::execute(client.clone(), args, base_image)
.await
.unwrap();
}
@@ -230,7 +225,7 @@ async fn main() -> eyre::Result<()> {
) {
let args = &cli.global;
build::build_and_deploy(client.clone(), &args, bin_name, image, tag)
build::build_and_deploy(client.clone(), args, bin_name, image, tag)
.await
.unwrap();
}
@@ -242,8 +237,8 @@ async fn main() -> eyre::Result<()> {
}
tokio::join!(
test(client.clone(), &cli, &bin_name),
build(client.clone(), &cli, &bin_name, &image, &tag),
test(client.clone(), &cli, bin_name),
build(client.clone(), &cli, bin_name, image, tag),
cuddle_please(client.clone(), &cli)
);
}
@@ -257,9 +252,7 @@ mod please_release {
use std::sync::Arc;
use dagger_sdk::Container;
use crate::{base_rust_image, build, get_base_debian_image, get_rust_dep_src, GlobalArgs};
use crate::{base_rust_image, GlobalArgs};
pub async fn run_release_please(
client: Arc<dagger_sdk::Query>,
@@ -366,7 +359,7 @@ mod docs {
pub async fn execute(
client: Arc<dagger_sdk::Query>,
args: &GlobalArgs,
platform: &Option<String>,
_platform: &Option<String>,
) -> eyre::Result<Container> {
let mkdocs_container = client.container().from(
args.mkdocs_image
@@ -429,10 +422,6 @@ mod build {
use dagger_sdk::Container;
use futures::StreamExt;
use tokio::sync::Mutex;
use tokio::task::JoinHandle;
use crate::{base_rust_image, get_base_debian_image, GlobalArgs};
pub async fn build_and_deploy(
@@ -453,7 +442,7 @@ mod build {
let container = base_rust_image(
client.clone(),
&args,
args,
&Some("linux/amd64".to_string()),
&bin_name.clone(),
&"release".into(),
@@ -461,10 +450,10 @@ mod build {
.await?;
let build_image = execute(
client.clone(),
&args,
args,
&container,
&base_image,
&bin_name,
bin_name,
&Some("linux/amd64".to_string()),
)
.await?;
@@ -487,8 +476,8 @@ mod build {
client: Arc<dagger_sdk::Query>,
args: &GlobalArgs,
bin_name: &String,
image: &String,
tag: &String,
_image: &String,
_tag: &String,
) -> eyre::Result<()> {
// let containers = vec!["linux/amd64", "linux/arm64"];
@@ -501,7 +490,7 @@ mod build {
let container = base_rust_image(
client.clone(),
&args,
args,
&Some("linux/amd64".to_string()),
&bin_name.clone(),
&"release".into(),
@@ -509,10 +498,10 @@ mod build {
.await?;
let build_image = execute(
client.clone(),
&args,
args,
&container,
&base_image,
&bin_name,
bin_name,
&Some("linux/amd64".to_string()),
)
.await?;
@@ -545,7 +534,7 @@ mod build {
rust_target,
"--release",
"-p",
&bin_name,
bin_name,
]);
let final_image = base_image
@@ -556,7 +545,7 @@ mod build {
.id()
.await?,
)
.with_exec(vec![&bin_name, "--help"]);
.with_exec(vec![bin_name, "--help"]);
let output = final_image.stdout().await?;
println!("{output}");
@@ -654,12 +643,12 @@ pub async fn get_rust_dep_src(
.build()?,
);
return Ok(directory);
Ok(directory)
}
pub async fn get_rust_skeleton_files(
client: Arc<dagger_sdk::Query>,
args: &GlobalArgs,
_args: &GlobalArgs,
) -> eyre::Result<(dagger_sdk::Directory, Vec<String>)> {
let mut rust_crates = vec![PathBuf::from("ci")];
let mut dirs = tokio::fs::read_dir("crates").await?;
@@ -701,7 +690,7 @@ pub async fn get_rust_skeleton_files(
if let Some(file_name) = rust_crate.file_name() {
crate_names.push(file_name.to_str().unwrap().to_string());
}
directory = create_skeleton_files(directory, &rust_crate)?;
directory = create_skeleton_files(directory, rust_crate)?;
}
Ok((directory, crate_names))
@@ -739,7 +728,7 @@ pub async fn base_rust_image(
.with_exec(vec!["rustup", "target", "add", rust_target]);
let target_cache = client.cache_volume(format!("rust_target_{}", profile));
let mut build_options = vec!["cargo", "build", "--target", rust_target, "-p", &bin_name];
let mut build_options = vec!["cargo", "build", "--target", rust_target, "-p", bin_name];
if profile == "release" {
build_options.push("--release");
@@ -754,7 +743,7 @@ pub async fn base_rust_image(
let exclude = crates
.iter()
.filter(|c| **c != "ci")
.map(|c| format!("**/*{}*", c.replace("-", "_")))
.map(|c| format!("**/*{}*", c.replace('-', "_")))
.collect::<Vec<_>>();
let exclude = exclude.iter().map(|c| c.as_str()).collect();

View File

@@ -50,10 +50,8 @@ impl ReleaseCommandHandler {
tracing::trace!("fetched commits since last version");
let current_version = get_current_version(significant_tag);
tracing::trace!("found current version: {}", current_version.to_string());
self.ui.write_str_ln(&format!(
"found current version: {}",
current_version
));
self.ui
.write_str_ln(&format!("found current version: {}", current_version));
let conventional_commit_results = parse_conventional_commits(current_version, commits)?;
tracing::trace!("parsing conventional commits");
@@ -64,10 +62,8 @@ impl ReleaseCommandHandler {
return Ok(());
}
let (commit_strs, next_version) = conventional_commit_results.unwrap();
self.ui.write_str_ln(&format!(
"calculated next version: {}",
next_version
));
self.ui
.write_str_ln(&format!("calculated next version: {}", next_version));
tracing::trace!("creating changelog");
let (changelog_placement, changelog, changelog_last_changes) =
@@ -253,7 +249,6 @@ fn parse_conventional_commits(
}
fn get_current_version(significant_tag: Option<Tag>) -> Version {
significant_tag
.map(|st| Version::try_from(st).unwrap())
.unwrap_or(Version::new(0, 0, 0))

View File

@@ -30,10 +30,9 @@ const CUDDLE_CONFIG_FILE_NAME: &str = "cuddle.please";
const YAML_EXTENSION: &str = "yaml";
pub fn get_config_from_config_file(current_dir: &Path) -> PleaseConfigBuilder {
let current_cuddle_path = current_dir
.join(format!("{CUDDLE_FILE_NAME}.{YAML_EXTENSION}"));
let current_cuddle_config_path = current_dir
.join(format!("{CUDDLE_CONFIG_FILE_NAME}.{YAML_EXTENSION}"));
let current_cuddle_path = current_dir.join(format!("{CUDDLE_FILE_NAME}.{YAML_EXTENSION}"));
let current_cuddle_config_path =
current_dir.join(format!("{CUDDLE_CONFIG_FILE_NAME}.{YAML_EXTENSION}"));
let mut please_config = PleaseConfigBuilder::default();
if let Some(config) = get_config_from_file::<CuddleEmbeddedPleaseConfig>(current_cuddle_path) {

View File

@@ -67,7 +67,7 @@ impl VcsClient {
"-c",
&format!("http.extraHeader='Authorization: token {}'", token),
"-c",
&format!("http.extraHeader='Sudo: kjuulh'"),
"http.extraHeader='Sudo: kjuulh'",
"-c",
&format!("user.name={}", username),
"-c",