@@ -27,7 +27,7 @@ def prepare(self, cfg):
2727 if not self .args .dist_git_enable :
2828 return
2929 self .git .prepare ()
30- self .git .clean ()
30+ self .git .clean_scripts ()
3131
3232 def after_sources (self , files ):
3333 if not self .args .dist_git_enable :
@@ -85,7 +85,7 @@ def update(self):
8585 self .update_value ("JBOSS_IMAGE_RELEASE" , new_release )
8686 self .update_dist_git (new_version , new_release )
8787
88- def clean (self ):
88+ def clean_scripts (self ):
8989 """ Removes the scripts directory from staging and disk """
9090 shutil .rmtree (os .path .join (self .path , "scripts" ), ignore_errors = True )
9191
@@ -177,8 +177,12 @@ def update_lookaside_cache(self, artifacts):
177177
178178 def update_dist_git (self , version , release ):
179179 with Chdir (self .path ):
180- # Add everything
181- subprocess .check_call (["git" , "add" , "." ])
180+ # Add new Dockerfile
181+ subprocess .check_call (["git" , "add" , "Dockerfile" ])
182+
183+ # Add the scripts directory if it exists
184+ if os .path .exists (os .path .join (self .path , "scripts" )):
185+ subprocess .check_call (["git" , "add" , "scripts" ])
182186
183187 commit_msg = "Sync"
184188
0 commit comments