Provides current CI environment information.
This library main goal is to provide development/build tools such as cargo-make the needed information on the current CI environment.
The code is based on the ci-info npm module.
Simply include the library and invoke the get function to pull all info as follows:
```rust extern crate ci_info;
fn main() { // Just check if a CI environment is detected. let ci = ciinfo::isci(); println!("Is CI: {}", ci);
// Get CI environment information
let info = ci_info::get();
println!("Is CI: {}", info.ci);
if info.vendor.is_some() {
println!("Vendor: {:#?}", info.vendor.unwrap());
println!("Name: {:#?}", info.name.unwrap());
}
if info.pr.is_some() {
println!("Is PR: {:#?}", info.pr.unwrap());
}
} ```
In order to use this library, just add it as a dependency:
ini
[dependencies]
ci_info = "*"
There is optional serde
support that can be enabled via the serde-1
feature:
ini
[dependencies]
ci_info = { version = "*", features = ["serde-1"] }
See full docs at: API Docs
| Date | Version | Description | | ----------- | ------- | ----------- | | 2019-05-10 | v0.6.0 | Maintenance | | 2019-05-08 | v0.5.0 | Use envmnt library for environment variables support | | 2019-03-13 | v0.4.0 | Added pr flag and vendor name | | 2018-12-10 | v0.3.0 | Added optional serde support | | 2017-10-10 | v0.1.0 | Initial release. |
Developed by Sagie Gur-Ari and licensed under the Apache 2 open source license.