salahhusa9 / laravel-updater

Laravel Updater is a simple yet powerful package for updater your Laravel applications. It makes it easy to upgrade your application to the latest version with just one command.
https://salahhusa9.com/laravel-updater
MIT License
176 stars 19 forks source link

[QUESTION]: how to do composer install and a roll back feature? #47

Closed itsmenewbie03 closed 5 months ago

itsmenewbie03 commented 6 months ago

Description

I have the following questions:

salahhusa9 commented 6 months ago

For composer install it's unrecommended to do inside/by package because in case of laravel-updater need also update well be a problem, i recommend running composer install after php artisan updater:update

salahhusa9 commented 6 months ago

For question tow:

In general, i will add it

itsmenewbie03 commented 6 months ago

For composer install it's unrecommended to do inside/by package because in case of laravel-updater need also update well be a problem, i recommend running composer install after php artisan updater:update

so this means that running composer install inside

    'after_update_pipelines' => [
        // you can add your own pipelines here
    ],

is a bad idea?

salahhusa9 commented 6 months ago

yes, it's bad idea you can use this in github action for update automaticity by release

name: deploy to server by ssh

concurrency:
  group: production
  cancel-in-progress: true

on:
  release:
    types: [released]

# on: [push]

jobs:
  deployment:
    runs-on: ubuntu-latest
    environment: production

    steps:
      - name: executing remote ssh commands using password
        uses: appleboy/ssh-action@v1.0.3
        env:
          COMPOSER_ALLOW_SUPERUSER: 1
        with:
          host: ${{ secrets.REMOTE_HOST }}
          username: ${{ secrets.REMOTE_USER }}
          password: ${{ secrets.REMOTE_PASSWORD }}
          port: ${{ secrets.REMOTE_PORT }}
          script: |
            cd ${{ secrets.REMOTE_TARGET }}
            php artisan updater:update
            export COMPOSER_ALLOW_SUPERUSER=1; composer install

as you see i run composer install after update.