How to perform a self-update on a local web system?

-1

Speak, gal, blz?

I developed a web system (in CodeIgniter) for a client and it runs on a local machine inside your office. Whenever I need to update the system, I perform the following steps:

  • TeamViewer server access;
  • I open the CMDER ;
  • Access my account on Bitbucket to give git pull ;
  • I perform the necessary migrations;
  • Thinking about these desktops systems that automatically search for a new version and upgrade, is it possible to do a routine on this web system to do the same thing? Search Bitbucket (or another web server) for a new version and then do the update?

    Thanks for the suggestions.

        
    asked by anonymous 23.05.2018 / 23:57

    1 answer

    0

    A very simple way is:

    Storing your repository login on the server:

    cd c:\seu_repositorio\
    git config credential.helper cache
    

    This command will cache your credentials the next time you pull / push.

    Once the cache is done, you will no longer be prompted for username and password

    In this way you can create a scheduled task in windows, which runs a php file automatically, which can contain a code to execute a simple git pull or you can also make other validations in the code, for example:

    • Check the md5 code of a file, if it has changed since the last version, then you update it pulls the git repository, otherwise it does nothing.
    • In this PHP code, you can also perform other actions like updating the database, deleting old files, cleaning logs, etc.
    • In the same way that you can do the control through the GIT repository, you could make a package available in a package and download the files from that hosting, making the control inside the php file as well.
    24.05.2018 / 05:47