Skip to content

ashraf-minhaj/File-Content-Change-Detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File Content Change Detector

License: GPL v3

Contents:

Why?

First, understand the need of this automation cover In the process of CI/CD, we don't always need to build all the files. The blind pipelines just process/build everything and eats up time, cicd runtime etc. So I

How it works

TLDR:

  • make hash of a file and store it as a file.
  • make hash of the updated file, compare with the old one.
  • and do whatever you wish to do.

This is where I am making an atttempt to make hash of a file, then store that into another file. While in the process of building, a new hash is created and compared, if any change is detected the file is taken to build and the hash file is updated, else it moves on.

And the process continues.

Install md5sum

  • macOS -> brew install md5sha1sum

  • Linux -> sudo apt install -y ucommon-utils

  • Check if installation complete (should return a path) - which md5sum

How to run

  • put your file in the src directory. Example file app.py. Change the name according to your need, don't forget to change in the shell script file variable. file="../src/app.py" # change the file name according to your need
  • go to the scripts directory and run - change_detector.sh

references: superuser, devconnected, javatpoint.

(C) Ashraf Minhaj

Contact me:

LinkedIn   ashraf_minhaj@yahoo.com