-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from baoyachi/issue_8
add gitlab ,github ci env ,get current commit branch
- Loading branch information
Showing
5 changed files
with
103 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#[derive(Debug)] | ||
pub enum CIType { | ||
Github, | ||
Gitlab, | ||
Jenkins, | ||
Travis, | ||
None, | ||
} | ||
|
||
impl Default for CIType { | ||
fn default() -> Self { | ||
Self::None | ||
} | ||
} | ||
|
||
impl ToString for CIType { | ||
fn to_string(&self) -> String { | ||
match self { | ||
CIType::Github => "github".into(), | ||
CIType::Gitlab => "gitlab".into(), | ||
CIType::Jenkins => "jenkins".into(), | ||
CIType::Travis => "travis".into(), | ||
_ => "none".into(), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
extern crate shadow_rs; | ||
|
||
use shadow_rs::Shadow; | ||
use std::fs; | ||
|
||
fn main() -> shadow_rs::err::SdResult<()> { | ||
let src_path = std::env::var("CARGO_MANIFEST_DIR")?; | ||
|
||
Shadow::build(src_path, "./".to_string())?; | ||
|
||
for (k, v) in std::env::vars_os() { | ||
println!("{:?},{:?}", k, v); | ||
} | ||
println!("{}", fs::read_to_string("./shadow.rs")?); | ||
|
||
Ok(()) | ||
} |