@@ -236,6 +236,11 @@ def _deploy_zip(bucket_name, zip_path, test_deployment=False):
236236 else :
237237 common .execute ('gsutil cp %s gs://%s/%s' % (zip_path , bucket_name ,
238238 os .path .basename (zip_path )))
239+
240+
241+ def _download_zip (bucket_name , gcs_file_path , target_path ):
242+ """Download zip from GCS."""
243+ common .execute ('gsutil cp gs://%s/%s %s' % (bucket_name , gcs_file_path , target_path ))
239244
240245
241246def _deploy_manifest (bucket_name ,
@@ -610,10 +615,21 @@ def execute(args):
610615 if args .staging :
611616 _staging_deployment_helper ()
612617 else :
613- # This workaround is needed to set the env vars APPLICATION_ID and BOT_NAME
614- # for local environment, and it's needed for loading the monitoring module
615- config = local_config .ProjectConfig ().get ('env' )
616- environment .set_value ("APPLICATION_ID" , config ["APPLICATION_ID" ])
618+ # This workaround is needed to set BOT_NAME for local environment
619+ # and it's needed for loading the monitoring module
620+ config = local_config .ProjectConfig ()
621+ config .set_environment ()
622+ # We are removing the internal_issue_tracker module from cluterfuzz-config code
623+ # to be able to open the clusterfuzz-config code.
624+ # This workaround manages to download the internal_issue_tracker module from
625+ # GCS during the deployment.
626+ if config .get_target () == "google" :
627+ config_dir = config .get_config_dir ()
628+ config_path = os .path .join (config_dir , 'modules' )
629+ bucket = config .get ('deployment.bucket' )
630+ _download_zip (bucket , "internal_issue_tracker.zip" , config_path )
631+ common .execute (f'unzip { config_path } /internal_issue_tracker.zip -d { config_path } ' )
632+ common .execute (f'rm { config_path } /internal_issue_tracker.zip' )
617633 environment .set_value ("BOT_NAME" , os .uname ().nodename )
618634 _prod_deployment_helper (
619635 args .config_dir ,
0 commit comments