Triggering script upon file upload

Answered

I have TeamCity setup to build and sign my Android project from source -- everything works perfectly.  Occasionally a colleague will give me an APK that needs to be signed with our keys and I have to do it manually.  Can I setup TeamCity with a workflow (or build trigger ... not sure what term to use) so that I can upload an arbitrary APK via the TeamCity web interface and have it trigger my build signing script using the uploaded APK as input?

This is trivial to do in Jenkins (the CI tool I'm endeavoring to replace with TeamCity).

1 comment

Hello Drew,

There is no special UI in TeamCity that provides an ability to upload files before build. We have the related feature request: https://youtrack.jetbrains.com/issue/TW-16345, please vote for it.

You can use the following setup: e.g. you have two build configurations A - to build a project, B - to sign the package. B downloads package via artifact dependency from A.
In build configuration B you can create a parameter env.package_url (empty by default). Inside the build script in B you can check:

  • if env.package_url parameter is empty => sign package downloaded as artifact dependency
  • if env.package_url is not empty => use it to download colleague's package

In this case, you will be able to run custom build and specify env.package_url.

Hope it's clear. If you have any further question, please do not hesitate to ask.

0

Please sign in to leave a comment.