Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can I run own shell file in pipeline?

tuguldur Jamiyansharav
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 29, 2018 edited

Hi, guys. I need to execute own shell file from project folder to deploy remote server something like this.

image: node:10.4.1
pipelines:
default:
-
step:
caches:
-
node
script: # Modify the commands below to build your repository.
-
deploy.sh
deployment: production
  

But the result is: 

Screen Shot 2018-09-29 at 20.07.31.png

Anything would help!

Thank you,

 

1 answer

1 accepted

5 votes
Answer accepted
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 1, 2018

Hi tuguldur,

You can run a shell file in Pipelines.

The quickest fix:

Change your command to

/bin/bash deploy.sh

if it fails due to bash not existing, then instead use

/bin/sh deploy.sh

More detail below:

You can check that it is an executable with:

ls -l

If you're not familiar with Linux file permissions, you just want to see an 'x' character in this output:

-rwxr-xr-x  1 user  group  1531 18 Sep  2017 deploy.sh

If it is marked as an executable, you can change your command to:

./deploy.sh

If it is not marked as an executable, you can run it straight through /bin/bash or /bin/sh (as above).

Thanks,

Phil

tuguldur Jamiyansharav
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!
October 5, 2018

Thank you so much, it works now.

ffischer January 7, 2020

my local machine is windows - how can i set the x-flag on windows?

Like • Gus Crawford likes this
Jeff Silverman
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!
June 2, 2020

if you run it as

/bin/bash deploy.sh

you do not need to set the exec flag

Like • Maxim Nalimov likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events