-
Notifications
You must be signed in to change notification settings - Fork 5
The details behind detecting modified images
If current branch is not master then it will diff with the latest master branch. If current branch is master then it will diff with the commit 205bbf4d430d906875a30e4a47872145ee9d06ee.
$ git diff --name-only $(git rev-parse master)
The diff command will return a list of files. The result will be filtered and aggregated into a list of ImageBundle
objects which represent some images in images
folder like bitcoind/0.19.1
, utils
, etc.
The second step is to iterate the history of current branch and find modified images for each commit in the history.
master -> c1 -> c2 -> c3 -> c4
c4: img1
c3: img1, img2
c2:
c1: img2, img3
img1: []
img2: [c4]
img3: [c2, c3, c4]
Say the cloud img3 has a label "com.exchangeunion.image.revision" whose value is c3
and current Git HEAD is c4
, we will NOT build img3 because the cloud version has no differences with the HEAD according to the unmodified history.
We use this technique to detect the real modifed images to build on Travis.