Commit 3c3f17fe authored by David Diederich's avatar David Diederich
Browse files

Adding more verbage to the job output to explain how to use the PUBLISH_RESULTS variable

parent a089c75a
Pipeline #7041 failed with stages
in 7 seconds
......@@ -11,7 +11,7 @@ collections = []
# environments # and collections arrays.
i = 0;
collectionDir = os.path.join(os.environ['CI_PROJECT_DIR'], 'Postman Collection')
collectionDir = os.path.join(os.getenv('CI_PROJECT_DIR', '.'), 'Postman Collection')
for root, dirnames, filenames in os.walk(collectionDir):
for f in filenames:
......@@ -63,9 +63,34 @@ with open('test-execution.gitlab-ci.yml', 'w') as pipelineConfig:
''
]))
onDefaultBranch = os.getenv('CI_COMMIT_BRANCH') == os.getenv('CI_DEFAULT_BRANCH')
publishResults = os.getenv('PUBLISH_RESULTS') == 'true'
if (onDefaultBranch or publishResults):
# --------------------------------------------------------------------------------
commitBranch = os.getenv('CI_COMMIT_BRANCH', 'undefined -- This is normally set by the GitLab pipeline, if testing manually, set this to the current branch')
defaultBranch = os.getenv('CI_DEFAULT_BRANCH', 'undefined -- This is normally set by the GitLab pipeline, if testing manually, set this to the project\'s default branch')
publishResults = os.getenv('PUBLISH_RESULTS', 'undefined')
print('CI_COMMIT_BRANCH = ' + commitBranch)
print('CI_DEFAULT_BRANCH = ' + defaultBranch)
print('CI_PUBLISH_RESULTS = ' + publishResults)
if commitBranch == defaultBranch:
print('Since the pipeline is executing on the default branch, I will be outputting the results on the Pages server')
outputPagesJob = True
elif publishResults == 'true':
print('Since the pipeline specifically request publication, I will be outputting the results on the Pages server')
outputPagesJob = True
else:
print('I am suppressing the pages output, because the pipeline is not from the default branch nor has publication been specifically requested')
print('To add this output, run the pipeline for your branch and add the variable "CI_PUBLISH_RESULTS", set to the value "true" (all lowercase)')
outputPagesJob = False
# --------------------------------------------------------------------------------
if (outputPagesJob):
print('Pages URL: ' + os.getenv('CI_PAGES_URL', ''))
# Output the pages job
pipelineConfig.write('\n'.join([
'',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment