@@ -150,7 +150,6 @@ def listenBuild(secret):
150150### Entry functions
151151
152152if __name__ == "__main__" :
153-
154153 if not configFile == None :
155154 print ("Loading configuration from file: " + configFile )
156155 with open (configFile ) as config_file :
@@ -170,34 +169,3 @@ def listenBuild(secret):
170169 app .run (debug = config ["debug" ]== "True" ,
171170 port = defaultPort ,
172171 host = '0.0.0.0' )
173-
174-
175- def debug ():
176- repo , origin = initRepo (config ["workPath" ], config ["remoteUrl" ])
177- builtrefs = os .listdir (config ["buildRoot" ]+ '/origin' )
178-
179- srefs = [str (x ) for x in origin .refs ]
180- builtrefs = ['origin/' + str (x ) for x in builtrefs ]
181- print (builtrefs )
182- print (srefs )
183-
184- for bref in builtrefs :
185- if not bref in srefs :
186- print ('found stale preview: ' + bref )
187- remove_build = remove_build = config ["buildRoot" ] + '/' + bref
188- print ('Dry removing ' + remove_build )
189- shutil .rmtree (remove_build )
190-
191- # TODO: clean buildState when pruned
192- for ref in origin .refs :
193-
194- print ("ref %s (%s)" % (ref , ref .commit ))
195- sref = str (ref )
196- if not sref in buildState :
197- buildState [sref ] = {"sha" : str (ref .commit ), "status" : "init" , "built" : None }
198-
199- for ref in origin .refs :
200- buildRef (repo , ref , buildState [str (ref )])
201-
202- if __name__ == "__main__" and False :
203- debug ()
0 commit comments