labs42io / circleci-monorepo

An example of monorepo with CircleCI using conditional workflows and pipeline parameters.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: no completed CI builds in branch master

ggupta36 opened this issue · comments

Hi,
Thanks a lot for this. I am trying to run this but facing below issue:

There are no completed CI builds in branch master.
Searching for CI builds in branch 'master' ...
No CI builds for branch master. Using master.
Searching for changes since commit [master] ...

It seems the below line is not able to fetch the result from API
curl -Ss -u ${CIRCLE_TOKEN}: ${LAST_COMPLETED_BUILD_URL} > circle.json

I can verify that if I try to fetch using LAST_COMPLETED_BUILD_URL from browser, it fetches the expected result, but somehow not working during build.

I have double verified CIRCLE_TOKEN and it seems fine. Any idea as to where could be the issue?

perhaps try running curl -Ss -u ${CIRCLE_TOKEN}: ${LAST_COMPLETED_BUILD_URL} > circle.json locally on your terminal. If it doesn't work you could then follow up with CircleCI

I verified by doing ssh into the CircleCI container that CIRCLE_TOKEN is correct. However problem seems to be with the below line
LAST_COMPLETED_BUILD_SHA=cat circle.json | jq -r 'map(select(.status == "success") | select(.workflows.workflow_name != "ci")) | .[0]["vcs_revision"]'``

Can you help me understand how will this work for the 1st time build as there doesn't exist any last successful build due to which I am getting LAST_COMPLETED_BUILD_SHA as null

@ggupta36 I had the same issue on the first build, to get past it I just disabled the trigger job and manually enabled all other workflows in order to produce some successful builds in the history.

the readme explains that here.
It appears you only have one branch -- master. The trigger script cannot pick up your changes on a first time build in that case (line 78). You may have to do as rynmsh suggests.

Thanks @rynmsh & @ozimos . It worked..