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

Is there a way to deploy laravel app through pipelines to AWS using ssh and Git Pull?

Jeffrey Jacobo August 1, 2022

I plan to deploy the master branch onto the AWS EC2 instance by using ssh and git pull to retrieve the resource merged in the master branch and update the resources on EC2.

so the script goes as :

apt-get install -y ssh
ssh -i user@ipaddress
cd <directory>
git pull repository-url
php artisan migrate
php artisan optimize
composer dump-autoload
Somehow I get the error when using ssh
E: Unable to locate package ssh
./devops/ line 4: ssh: command not found
I am using PHP:7.4-fpm image. Can anyone help me with this? I have been stuck for weeks.

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 3, 2022

Hello @Jeffrey Jacobo ,

Welcome to Atlassian Community.

This error usually happens when the package list of your system, in this case the container with php:7.4-fpm image, is not updated or does not have this package (ssh) available to be installed.

In order to re-synchronize the package index files from their remote sources, you should first execute :

apt-get update

This will download the package lists from the repositories and "updates" them to get information on the newest versions of packages and their dependencies.

After it, you can then install the package by running 

apt-get install -y ssh

You can try changing your script to include the commands above and let us know how it goes.

Thank you, @Jeffrey Jacobo .

Kind regards,

Patrik S

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events