@@ -1533,6 +1533,10 @@ def fetch_docker_tags(self):
1533
1533
the -t flag.
1534
1534
"""
1535
1535
1536
+ # list to store the already parsed components (useful when forks are
1537
+ # given to the pipeline string via -t flag
1538
+ list_of_parsed = []
1539
+
1536
1540
# fetches terminal width and subtracts 3 because we always add a
1537
1541
# new line character and we want a space at the beggining and at the end
1538
1542
# of each line
@@ -1562,12 +1566,20 @@ def fetch_docker_tags(self):
1562
1566
# Skip first init process and iterate through the others
1563
1567
for p in self .processes [1 :]:
1564
1568
template = p .template
1569
+ # if component has already been printed then skip and don't print
1570
+ # again
1571
+ if template in list_of_parsed :
1572
+ continue
1573
+
1574
+ list_of_parsed .append (template )
1575
+
1565
1576
# fetch repo name from directives of the template. Since some
1566
1577
# components like integrity_coverage doesn't have a directives with
1567
1578
# container, thus if no directive there the script will skip this
1568
1579
# template
1569
1580
try :
1570
1581
repo = p .directives [template ]["container" ]
1582
+ default_version = p .directives [template ]["version" ]
1571
1583
except KeyError :
1572
1584
continue
1573
1585
# make the request to docker hub
@@ -1581,7 +1593,10 @@ def fetch_docker_tags(self):
1581
1593
# parse response content to dict and fetch results key
1582
1594
r_content = json .loads (r .content )["results" ]
1583
1595
for version in r_content :
1584
- tags_list .append ([template , repo , version ["name" ]])
1596
+ printed_version = (version ["name" ] + "*" ) \
1597
+ if version ["name" ] == default_version \
1598
+ else version ["name" ]
1599
+ tags_list .append ([template , repo , printed_version ])
1585
1600
else :
1586
1601
tags_list .append ([template , repo , "No DockerHub tags" ])
1587
1602
@@ -1607,7 +1622,7 @@ def fetch_docker_tags(self):
1607
1622
* entry , * final_width ), color )
1608
1623
)
1609
1624
# assures that the entire line gets the same color
1610
- sys .stdout .write ("\n " )
1625
+ sys .stdout .write ("\n {0: >{1}} \n " . format ( "(* = default)" , terminal_width + 3 ) )
1611
1626
1612
1627
def build (self ):
1613
1628
"""Main pipeline builder
0 commit comments