mserranom / bbrun

Run Bitbucket Pipelines locally
MIT License
208 stars 31 forks source link

Execution fails, but it works interactively #41

Closed lovato closed 5 years ago

lovato commented 5 years ago

image

If I run it interactively, it works.

My script called deploy.sh bbrun $1 $2 $3 --pipeline branches:$BRANCH --env "AWS_SECRET_ACCESS_KEY=xxx, AWS_ACCESS_KEY_ID=yyy"

I made a script to basically copy everything to a /tmp area, and only them run bb in it. Else, it ends changing my project files, since I do npm install and I kind of change a few file contents depending on the deployment environment (dev / prod strings, stuff like that). But when running on Bitbucket, everything happens in a docker and gets disposed.

Anyway, the problem is that it fails directly. I also commented out my aws commands on yml file and it keeps saying "my aws command" is faulty. Interactively, it works like a charm.

lovato commented 5 years ago

`image: atlassian/default-image:2

pipelines: branches: develop:

lovato commented 5 years ago

Just ran the command deploy.sh again ... it worked, even by issuing that very same error. The deploy actually happened. I have no idea why this error is being pushed to console.

lovato commented 5 years ago

I added a set -x to my first command inside the step and was able to catch that the error was mine. Variables that do not exist locally are being sent empty to AWS commands.