Hi I’m trying to create a local way to run drone, so we can check the pipeline locally before pushing it.
I’m using drone exec adding a env file and a secret file
this is how is looking like for the moment:
drone exec --env-file ./.dg.env.drone-test --secret-file ./.dg.secrets.drone-test --trusted --pipeline $1 ./.drone.yml
So this is working fine, if I switch off half of the pipelines we have in the drone.yml (which was working for years but the whole process of adding new pipelines is really slow as you end up trying stuff in the ci env)
So our .drone.yml file has some stuff to create docker images, that uses DRONE_REPO, DRONE_SOURCE_BRANCH etc… Those pipelines are not intended to be engaged in local but, trying to run other pipelines (like unit tests / e2e tests etc…) result in errors like:
2023/03/28 11:46:19 yaml: line 45: did not find expected key
Which by the way is really puzzling to understand WHERE is the error, it will be really nice to have print out the entire line that is causing the error, as the line 45 is relative to the specific pipeline is failing, which who knows which one of the 10 the file has…
So my problem is even if in the env file I add
DRONE_REPO=reponame DRONE_SOURCE_BRANCH=chore/JIRAT-0000-mock-branch DRONE_COMMIT_SHA=7357foba4
These seems to be removed by drone. as then they are not exported if I execute env inside of the dockers containers.
There is any way to FAKE those env props so I can test my .drone.yaml locally ?