Skip to content

Commit

Permalink
fix: check works without an environment specified
Browse files Browse the repository at this point in the history
  • Loading branch information
bodymindarts committed Dec 16, 2021
1 parent 89e2cf0 commit 2efb8a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion ci/release_notes.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Empty - please add release notes here
## Improvement

- Latest concourse version wants to check even though the resource is never used to push
12 changes: 8 additions & 4 deletions src/concourse/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,19 @@ pub fn exec() -> Result<()> {

let config = Config::from_file(&source.config)?;
let ws = Workspace::new(&config.scope, source.config.clone(), source.ignore_queue)?;
let environment = source
.environment
.ok_or_else(|| anyhow!("Environment not specified in source"))?;
let mut res = Vec::new();
let environment = if let Some(environment) = source.environment {
environment
} else {
eprintln!("No environment specified - ignoring");
println!("{}", serde_json::to_string(&res)?);
return Ok(());
};
let env = config.environments.get(&environment).context(format!(
"Environment '{}' not found in config '{}'",
environment, source.config
))?;
eprintln!("Checking equivalence with last deployed state...");
let mut res = Vec::new();
let gate = get_gate(
source.gates_file.as_ref(),
source.gates_branch.as_ref(),
Expand Down

0 comments on commit 2efb8a4

Please sign in to comment.