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

pipeline script "echo $some_var" first shows the command itself and then the actual output

vpandey6
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 4, 2019

I do not want to see the command itself in the pipeline output.

How can I achieve this ?

and is there any way to change the heading of the specific command? Like

```

SHOW OUTPUT

echo "Show $(Output)"

```

1 answer

0 votes
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 6, 2019

Hi @vpandey6

Pipelines was designed to group the output of commands in those expanders. There is no configuration to avoid printing the command itself. This is a way to identify what is the command running from bitbucket-pipelines.yml file.

Possible approaches that may meet part of your needs:

  1. Use a variable with the content you are trying to hide
    Repository settings >> Repository variables
    | Variable     | Content
    | SHOW_OUTPUT | echo "Show $(Output)"

     

    Pipelines file definition:
    script:
    - $SHOW_OUTPUT

    Output:
    $SHOW_OUTPUT  
    +$SHOW_OUTPUT
    Output of command or commands inside the variable.

     

  2. Add an extra file/script to your repository with all the commands you want to run. There you can even control what commands will actually have output to pipelines logs or not. Then call that file/script from the terminal.

    Commit the file with commands:
    command1
    command2
    command3

    Pipelines file definition:
    bash file

    Output:
    bash command
    +bash command
    Output of command or commands inside the file.

     

I hope that helps you.
If not, please share what is the problem you are really trying to solve and how do you think a Bitbucket pipelines new feature could be designed to solve it. That will help us to write a feature request for it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events