Appcenter: Post Build Script was ran when Build Failed

Created on 16 Apr 2019  Â·  3Comments  Â·  Source: microsoft/appcenter

What App Center service does this affect?
Build

Describe the bug
I updated my repository's directory structure and forgot to set the new location for the .xcwokspace. Since the setup is built to run on every push, app center ran the Build.

To Reproduce
Steps to reproduce the behavior:

  1. Create an Xcode project link it to App Center
  2. Setup the build settings
  3. Place the Xcode project in a different directory.
  4. Run the build
  5. The post build script will run

Expected behavior
The post build script should not run if the build failed

Screenshots
Screen Shot 2019-04-16 at 1 58 37 PM

Desktop:

  • OS: Mac OS 10.14.4
  • Browser Safari
  • Version 12.1
bug

All 3 comments

@kuyazee Thanks for the report but this is actually intentional. Some people want to run certain code, even if the build failed.
If you want your code to only run if the build actually succeeded, you can use a gate like this in your post-build script:

if [ "$AGENT_JOBSTATUS" == "Succeeded" ]; then
 …
fi

Thank you so much for the reply, I'm not sure if this is in the documentation I haven't checked in a while. If not please consider placing this on the documentation.

Good idea, we'll look into that. Thanks! 🙂

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chriskellor picture chriskellor  Â·  3Comments

Oddj0b picture Oddj0b  Â·  3Comments

DouglasMarq picture DouglasMarq  Â·  4Comments

sindresorhus picture sindresorhus  Â·  3Comments

muhammaddadu picture muhammaddadu  Â·  3Comments