Search code examples
jenkinscucumberjenkins-pluginswebhookscloud66

How can I connect Cloud66 with Jenkins to run a cucumber test after a deploy?


I have a rails server app running in Cloud66 and I want my Jenkins CI to start running a test every time there is a deploy in Cloud66.

Is it possible to do this? How?

Thanks!


Solution

  • Ok, I found out the solution!

    So:

    1. We have to go to the Jenkins job and activate, under Build Triggers the option Trigger Builds Remotely. Then we have to choose a token.
    2. We have to to Manage Jenkins > Configure Global Security and add Read rights to the Anonymous user.
    3. Then, on the Rails project, create the file ./.cloud66/deploy_hooks.yml with this code:

    -

    staging:
       last_thing:
         command: curl $JENKINS_URL/job/$JOB_NAME/build?token=$TOKEN_DEFINED_EARLIER
         target: rails
         execute: true
    

    And that's it! Then you'll have an test execution triggered on deploy!