-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc8b0e3
commit fe53a79
Showing
2 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,19 @@ | |
from common import * | ||
|
||
tm1_database_name = "MiniSData" | ||
branch_name = "main" | ||
if len(sys.argv) > 1: | ||
pr_number = sys.argv[1] | ||
branch_name = sys.argv[1] | ||
if len(sys.argv) > 2: | ||
pr_number = sys.argv[2] | ||
print(f"Pull Request: #{pr_number}") | ||
tm1_database_name = f"{tm1_database_name}-{pr_number}" | ||
if len(sys.argv) > 2: | ||
commit_hash = sys.argv[2] | ||
if len(sys.argv) > 3: | ||
commit_hash = sys.argv[3] | ||
print(f"Commit Hash: {commit_hash}") | ||
tm1_database_name = f"{tm1_database_name}-{commit_hash[:7]}" | ||
print(f"Datbase name: {tm1_database_name}") | ||
print(f"Sourcing from branch: {branch_name}") | ||
|
||
tm1_service_root_url = "http://cwc-tm1-v12-demo.tm1-code.io:4444/tm1/api/v1" | ||
tm1_service_username = "[email protected]" | ||
|
@@ -62,7 +66,7 @@ def dump_file_content(file_endpoint): | |
|
||
# Pull the latest version of the sources from the main branch | ||
git_pull_payload = { | ||
"Branch": "main" | ||
"Branch": f"{branch_name}" | ||
} | ||
status_code, response = send_post_request(session, tm1_service_root_url, f"{database_endpoint}/GitPull", git_pull_payload) | ||
if status_code != 201: | ||
|
@@ -82,7 +86,7 @@ def dump_file_content(file_endpoint): | |
|
||
# Execute the create_Y2Ksales_cube process to validate that it works | ||
process_name = "create_Y2Ksales_cube" | ||
status_code, response = send_post_request(session, tm1_service_root_url, f"{database_endpoint}/Processes('{process_name}')/tm1.ExecuteWithReturn?$expand=*", git_pull_payload) | ||
status_code, response = send_post_request(session, tm1_service_root_url, f"{database_endpoint}/Processes('{process_name}')/tm1.ExecuteWithReturn?$expand=*", {}) | ||
if status_code != 201: | ||
log_output(f"The request to execute the {process_name} process failed!", status_code, response) | ||
cleanup() | ||
|