Skip to content

Commit

Permalink
bug fix - ltr location
Browse files Browse the repository at this point in the history
  • Loading branch information
rafael-direito committed Jan 31, 2022
1 parent 9bb040c commit 06feca8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion API/aux/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@
"ci_cd_agent_cleaned_test_environment": "CLEANED_TEST_ENVIRONMENT",
"test_ended": "TEST_ENDED",
"obtained_metrics_collection_files": "OBTAINED_METRICS_COLLECTION_FILES",
}
}
2 changes: 1 addition & 1 deletion API/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

app.add_middleware(
CORSMiddleware,
allow_origin_regex="http(s)?://ci-cd-manager\.5gasp\.eu.*",
allow_origin_regex="http(s)?://ci-cd-(manager)|(service)\.5gasp\.eu.*",
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
Expand Down
10 changes: 4 additions & 6 deletions API/wrappers/jenkins/pipeline_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ def __init__(self, jenkins_script_str, executed_tests_info, available_tests, des
self.metrics_collection_information = metrics_collection_information
self.test_instance_id = test_instance_id
self.testbed_id = testbed_id
self.ltr_info = Utils.get_ltr_info_for_testbed(testbed_id)


def create_jenkins_pipeline_script(self):

# fill the pipeline script
print(self.ltr_info)
self.add_environment_setup_to_jenkins_pipeline_script()
self.add_obtain_metrics_collection_files_to_jenkins_pipeline_script(self.metrics_collection_information)
self.add_metrics_colllection_mechanism_to_jenkins_pipeline_script(self.descriptor_metrics_collection, self.metrics_collection_information)
Expand Down Expand Up @@ -79,7 +77,7 @@ def add_obtain_and_perform_tests_to_jenkins_pipeline_script(self, executed_tests
environment_obtain_tests = [
f"ltr_user = credentials('ltr_user')",
f"ltr_password = credentials('ltr_password')",
f"ltr_location = '{self.ltr_info['location']}'"
f"ltr_location = credentials('ltr_location')"
]

run_tests_commands = []
Expand Down Expand Up @@ -117,7 +115,7 @@ def add_publish_results_to_jenkins_pipeline_script(self):
publish_results_environment = [
f"ltr_user = credentials('ltr_user')",
f"ltr_password = credentials('ltr_password')",
f"ltr_location = '{self.ltr_info['location']}'",
f"ltr_location = credentials('ltr_location')",
f"results_ftp_location = '{Constants.FTP_RESULTS_URL}'",
f"results_ftp_user = '{Constants.FTP_RESULTS_USER}'",
f"results_ftp_password = '{Constants.FTP_RESULTS_PASSWORD}'",
Expand Down Expand Up @@ -147,7 +145,7 @@ def add_obtain_metrics_collection_files_to_jenkins_pipeline_script(self, metrics
obtain_metrics_environment = [
f"ltr_user = credentials('ltr_user')",
f"ltr_password = credentials('ltr_password')",
f"ltr_location = '{self.ltr_info['location']}'"
f"ltr_location = credentials('ltr_location')"
]

obtain_metrics_collection_file_commands = []
Expand Down Expand Up @@ -208,4 +206,4 @@ def __update_jenkins_script(self, tag_to_replace, commands_lst):
item2 = re.search("{\s*" + tag_to_replace, self.jenkins_script_str, re.MULTILINE)
line_offset = item1.span(0)[0] - item2.span(0)[0] - 2
commands_str = "\n{}".format(line_offset * " ").join(commands_lst)
self.jenkins_script_str = self.jenkins_script_str.replace(tag_to_replace, commands_str)
self.jenkins_script_str = self.jenkins_script_str.replace(tag_to_replace, commands_str)

0 comments on commit 06feca8

Please sign in to comment.