@@ -80,35 +80,6 @@ pipeline:
8080 envVariables :
8181 PYTHONPATH : ${PYTHONPATH}:.
8282 PYTEST_ADDOPTS : " --verbose"
83- - step :
84- type : Run
85- name : Extract Version
86- identifier : extract_version
87- spec :
88- connectorRef : account.harnessImage
89- image : python:3.7.16-alpine
90- shell : Python
91- command : |
92- import os
93- import re
94-
95- # Read the version.py file
96- with open('splitio/version.py', 'r') as file:
97- content = file.read()
98-
99- # Extract version using regex
100- version_match = re.search(r'__version__\s*=\s*["\']([^"\']*)["\']\'', content)
101- if version_match:
102- version = version_match.group(1)
103- print(f"Extracted version: {version}")
104- # Export as environment variable for output
105- os.environ["VERSION"] = version
106- else:
107- print("Version not found in version.py file")
108- os.environ["VERSION"] = "not_found"
109- outputVariables :
110- - name : VERSION
111- timeout : 10m
11283 - step :
11384 identifier : sonarqube_scan
11485 name : SonarQube Scan
@@ -121,15 +92,15 @@ pipeline:
12192 type : repository
12293 detection : auto
12394 auth :
124- access_token : <+pipeline.variables.sonarqube_token >
95+ access_token : <+secrets.getValue("sonarqube-token") >
12596 tool :
12697 project_key : <+codebase.repoName>
12798 branch_name : <+codebase.branch>
12899 pull_request_key : <+codebase.prNumber>
129100 pull_request_branch : <+codebase.targetBranch>
130101 pull_request_base : <+codebase.sourceBranch>
131102 settings :
132- sonar.host.url : <+pipeline.variables.sonarqube_host>
103+ sonar.host.url : https://sonar.harness.io/
133104 sonar.qualitygate.wait : true
134105 sonar.branch.name : <+codebase.branch>
135106 sonar.pullrequest.key : <+codebase.prNumber>
0 commit comments