Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,368,311
Community Members
 
Community Events
168
Community Groups

bitbucket pipeline doesn't work with grep using dollar sign $

Ky Nguyen I'm New Here Aug 24, 2022

I'm trying to filter out any empty env variable inside of my .env file like this
cat .env | grep "=$" but the pipeline doesn't output any, in fact it even giving out error Does anyone know how to fix this?Screen Shot 2022-08-24 at 8.39.21 PM.png

1 answer

0 votes
Ben Atlassian Team Aug 29, 2022

G'day Ky!

Welcome to the Bitbucket Cloud community :)

I have copied your commands and ran this against my own repository, I was able to produce the same issue with the error in pipelines but only when there was no empty variables.

When I have tried with the following sample text (similar to yours, when there is some empty), it executed in pipelines without issue:

DB_HOST=localhost
DB_USER=root
DB_PASS=test123
TEST=
TEST2=123

Are you able to perform the grep commands in a local Docker container and see if you encounter the same issue?
https://support.atlassian.com/bitbucket-cloud/docs/debug-pipelines-locally-with-docker/

Cheers!

- Ben (Bitbucket Cloud Support)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events