Multiple builds for one repo

What exactly would your workflow look like? Would you like to be able to trigger the one or the other build? Or it is fine for you to run both the iOS and the OS X build every time?

If it is fine to run them both, just putting the two build commands in the dependencies and test section should be enough:

dependencies:
  override:
    - ./deps-osx.sh
    - ./deps-ios.sh

test:
  override:
    - ./build-test-osx.sh
    - ./build-test-ios.sh

(The script names are completely random for demonstration purposes.)

If you would need to run only certain parts of the build, this API endpoint allows you to trigger a new build with a certain value set for an environment variable, which you could subsequently base the decision of build commands on:

test:
  override:
    - if [[ ! -z $CIRCLE_OSX_BUILD ]] ; then ./build-test-osx.sh ; fi
    - if [[ ! -z $CIRCLE_IOS_BUILD ]] ; then ./build-test-ios.sh ; fi

Another option would be to have two separate projects, one for iOS and one for OS X, one of which would contain all the code and the other one would only contain a circle.yml file. This config-only build would then pull in the project code during the build with git pull.

Would any of those options work for you?

3 Likes