The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Run multiple commands in the remote server after a SCP deploy

sachinthasankalpa
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 26, 2021

Hi

I'm trying to deploy a Laravel application using SCP deploy to a server. After deploying, I want to run multiple commands like

php artisan migrate
php artisan config:cache

 in the deployed server. How can I achieve this.

Thank you.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 29, 2021

Hi @sachinthasankalpa

Thank you for your question!

It's a good case to use ssh-run pipe, so you could run a command or a bash script on your server )

script:
  - pipe: atlassian/ssh-run:0.3.0
    variables:
      SSH_USER: 'ec2-user'
      SERVER: '127.0.0.1'
      SSH_KEY: $MY_SSH_KEY
      MODE: 'script'
      COMMAND: 'myscript.sh' # path to a script in your repository

Also, we have scp-deploy pipe:

script:
  - pipe: atlassian/scp-deploy:1.0.1
    variables:
      USER: 'ec2-user'
      SERVER: '127.0.0.1'
      REMOTE_PATH: '/var/www/build/'
      LOCAL_PATH: 'build/*'

 

More pipes you could find on Bitbucket Pipes Marketplace.

 

Cheers,
Oleksandr Kyrdan

sachinthasankalpa
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!
July 1, 2021

Hi @Oleksandr Kyrdan

This's what I was expecting.

Thank you.

Like Oleksandr Kyrdan likes this
TAGS
AUG Leaders

Atlassian Community Events