Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Run multiple commands in the remote server after a SCP deploy

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

1 vote
Answer accepted

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

Hi @Oleksandr Kyrdan

This's what I was expecting.

Thank you.

Like Oleksandr Kyrdan likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

111 views 2 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you