Drone

Multiple steps in one pipeline

Hi,
We’re using bitbucket for CI but for deployment on test envt we are using Drone. We already have drone.yml that deploys, tests (regression test suite), publishes results from acceptance branch & is triggered by a cron job. Now, i want to have similar steps running but the tests would be different (smoke test suite) after creation of each PR. Will following thing work, if not, kindly suggest the correct one?

kind: pipeline
type: docker
name: default

steps:
- name: deployment

steps:
- name: regression test
when:
   event:
   - cron
    cron:
    - every_night 

steps:
- name: smoke test
when:
   event:
   - pull_request

steps:
- name: slack

trigger:
 event:
 - cron
  cron:
  - every_night
 event:
 - pull_request

you cannot define multiple yaml keys with the same name. Instead you would have a single steps section and you would use the when block to define when the particular step should execute:

steps:
- name: regression
  image: ...
  when:
    event:
    - cron

- name: smoke
  image: ...
  when:
    event:
    - pull_request

- name: deployment
  image: ...

trigger:
  event:
  - cron
  - pull_request

@bradrydzewski - Thanks for the information, but my concern is that our CI pipeline is in Bitbucket, thus the PRs are created there. How can i convey this information to Drone, so that it triggers a pipeline job whenever a PR gets created.

I’m sorry, I do not think I understand the underlying question.

Can i trigger Drone pipeline based on PRs created in Bitbucket?

NOTE: We’re using Bitbucket for CI while Drone for CD in Test environment.

I assume you are using Bitbucket Cloud and not Bitbucket Server (self-hosted) since the answer would be different depending on which you are using.

If you are using Bitbucket Cloud, the answer is no. In order to support pull requests with Bitbucket Cloud we need the following issue to be resolved by Atlassian https://jira.atlassian.com/browse/BCLOUD-5814

Yes, we’re using cloud. Thanks for the clarification.

Regards,
Jinesh