Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Pipelines seems to remove text from output

Edited

I have the following lines in my bitbucket-pipelines.yml inside a step:

 

- printf "$conf['reverse_proxy'] = true;\n" >> settings.php
- printf "$conf['reverse_proxy_addresses'] = array($_SERVER['REMOTE_ADDR']);\n" >> settings.php

which should append the two lines of text into the settings.php file.  Neither of the two $conf or $_SERVER are variables defined in my repository or deployment, but when I check the content of the file they are being removed and all i'm left with is:

['reverse_proxy'] = true;
['reverse_proxy_addresses'] = array(['REMOTE_ADDR']);

at the bottom of the file. I have tried everything I can think of to escape the $ and i've tried echo instead of printf in case it was some weird edge case.  I've also tried running the commands directly in a bash terminal and they output exactly what i'd expect.

In case it's relevant, i'm using the atlassian/default-image:3 image for the pipeline

1 answer

0 votes
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Feb 01, 2023

Hi @rob_norman-clarity,

Welcome to the community.

I do believe this is possible using echo command, you'll just need to produce those literal $ signs outside the double quotes.

You can use the below commands instead:

- echo '$conf'"['reverse_proxy'] = true;\n" >> settings.php
- echo '$conf'"['reverse_proxy_addresses'] = array("'$_SERVER'"['REMOTE_ADDR']);\n" >> settings.php

Hope it helps and let me know how it goes.

Regards,
Mark C

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events