0

I'm still playing around with github/circle-ci and conan.

I've got a repository "fcdk", which is a simple C++ library.

I've another repository "fcdk-conan" which contain the conan's recipe to build the first repository (fcdk). This second repository also contains the .circle-ci stuf. All is building well.

These 2 repositories are on github

I would like to know if there is a way to fire a circle-ci build in the second repository when I push some commit on the first repository ?

Eugen Mayer
  • 8,942
  • 4
  • 33
  • 57
Gojita
  • 490
  • 4
  • 10

1 Answers1

1

Only Conan and Github won't be able to solve your problem, but you can use Circle CI to trigger a new build when the first build pass.

https://circleci.com/docs/2.0/api-job-trigger/

version: 2
.build-steps: &build-steps
  steps:
    - checkout
    - run:
        name: Build project
        command: .circleci/run.sh
    - run:
        name: Trigger Conan build
        command: curl --user ${CIRCLE_API_USER_TOKEN}: \
                --data build_parameters[CIRCLE_JOB]=build_conan \
                --data revision=$CIRCLE_SHA1 \
                https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/tree/$CIRCLE_BRANCH

jobs:
  xcode10:
    macos:
      xcode: "10.2"
    <<: *build-steps

  gcc-7:
    docker:
      - image: conanio/gcc9
    <<: *build-steps

workflows:
  version: 2
  build_and_test:
    jobs:
      - gcc-9
      - xcode10

The example above shows a YAML file which contains a generic build for Linux and OSX, where the curl command is executed to trigger the Conan build. Of course, you will need to customize that command with your project parameters.

This idea can be reproduced on Travis CI, Appveyor, Gitlab CI, Azure ...

Regards!

uilianries
  • 3,363
  • 15
  • 28