@@ -31,28 +31,26 @@ def get_plans_from_project(project_key):
31
31
if __name__ == "__main__" :
32
32
bamboo = Bamboo (url = BAMBOO_URL , username = BAMBOO_LOGIN , password = BAMBOO_PASSWORD , timeout = 180 )
33
33
projects = get_all_projects ()
34
- print (( f"Start analyzing the { len (projects )} projects" ) )
34
+ print (f"Start analyzing the { len (projects )} projects" )
35
35
for project in projects :
36
- print (( f"Inspecting { project } project" ) )
36
+ print (f"Inspecting { project } project" )
37
37
plans = get_plans_from_project (project )
38
- print (( f"Start analyzing the { len (plans )} plans" ) )
38
+ print (f"Start analyzing the { len (plans )} plans" )
39
39
for plan in plans :
40
- print (( f"Inspecting { plan } plan" ) )
40
+ print (f"Inspecting { plan } plan" )
41
41
build_results = [
42
42
x for x in bamboo .results (plan_key = plan , label = LABEL , max_results = 100 , include_all_states = True )
43
43
]
44
44
for build in build_results :
45
45
build_key = build .get ("buildResultKey" ) or None
46
- print (( f"Inspecting { build_key } build" ) )
46
+ print (f"Inspecting { build_key } build" )
47
47
build_value = bamboo .build_result (build_key )
48
48
build_complete_time = build_value .get ("buildCompletedTime" ) or None
49
49
if not build_complete_time :
50
50
continue
51
51
datetimeObj = datetime .strptime (build_complete_time .split ("+" )[0 ] + "000" , "%Y-%m-%dT%H:%M:%S.%f" )
52
52
if datetime .now () > datetimeObj + timedelta (days = OLDER_DAYS ):
53
- print (
54
- (f"Build is old { build_key } as build complete date { build_complete_time .strftime ('%Y-%m-%d' )} " )
55
- )
53
+ print (f"Build is old { build_key } as build complete date { build_complete_time .strftime ('%Y-%m-%d' )} " )
56
54
if not DRY_RUN :
57
- print (( f"Removing { build_key } build" ) )
55
+ print (f"Removing { build_key } build" )
58
56
bamboo .delete_build_result (build_key )
0 commit comments