How to perform an auto-update on a local web system?

Asked

Viewed 343 times

-1

Talk, you guys, blz?

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

  1. Server machine access via Teamviewer;
  2. I open the CMDER;
  3. Access my Bitbucket account to give a git pull;
  4. I perform the necessary migrations;

Thinking about these systems desktops who are searching for a new version automatically and if they are updated, it is possible to do a routine in this web system to accomplish the same thing? Search Bitbucket (or other web server) for a new version and then update?

I appreciate the suggestions.

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 caches your credentials the next time you pull/push.

Once the cache is made, user and password will no longer be requested

This way you can create a scheduled task in windows, which runs a php file automatically, which can contain a code to run a simple git pull or you can also do 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 to pull the git repository, otherwise it does nothing.
  • In this PHP code, you can also perform other actions such as some database update, deletion of old files, log cleanup, etc...
  • In the same way that you can control the GIT repository, you could provide a zipped package on a hosting and keep downloading the files from that hosting, doing the control inside the php file as well.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.