0

I have a repository that build and deploys two different components - a frontend and a backend. Each of these have a specific set of steps that need to be executed for the CICD. Is there a way to run a selective set of steps based on which component has actually changed. For e.g. let us say all my frontend is under frontend/ and all my backend is under backend/. Is there a way to run a selective set of steps when there are changes only in the frontend ?

Omprakaash
  • 159
  • 2
  • 9

1 Answers1

0

The closest approach would be to adopt branch naming conventions that separate frontend and backend test builds.

For example, you could manage all frontend work with a frontend- prefix and all backend work with a backend- prefix. The codeship-steps.yml would then be implemented as:


- name: Frontend tests
  service: your-app
  type: serial
  tag: ^frontend-
  steps:
    - service: your-app
      command: ./run-frontend-test.sh
    - [other step commands...]
- name: Backend tests
  service: your-app
  type: serial
  tag: ^backend-
  steps:
    - service: your-app
      command: ./run-backend-test.sh
    - [other step commands...]

See here for more.

Drew Kitch
  • 201
  • 1
  • 3
  • Thanks for the response. Yes, branch naming convention is something that I had thought of as well; I was however trying to avoid that since that is an additional step that developers have to remember to name the branch correctly. I was wondering if there are other ways to achieve the same in codeship. – Omprakaash Apr 27 '18 at 21:15
  • I'm having the same problem. I created a bash script that performs a `git diff` on the selected folder, but I'm getting a "not a git repository" error so I guess that codeship doesn't reveal git files during the test execution? – Dani Medina Jul 09 '18 at 10:13