Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling jenkins job builder with no config file #44

Merged
merged 1 commit into from
Dec 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions build-on-push/jjb/platform-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@
job-commit-dispatcher.sh "{component}" "$GIT_BRANCH" "{github-user}" "{platform-ci-branch}"
wrappers:
- default-ci-workflow-wrappers
- inject-passwords:
global: true
mask-password-params: true

- job-template:
name: 'ci-{component}-dispatcher-commit'
Expand Down
9 changes: 8 additions & 1 deletion build-on-push/platform_ci/platform_ci/jjb.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def get_job_as_xml(self, job):

jjb_xml = subprocess.Popen(to_execute, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]

if not jjb_xml:
if not jjb_xml and os.getenv("JOB_BUILDER_PASS", None):
jjb_user = os.environ["JOB_BUILDER_USER"]
jjb_password = os.environ["JOB_BUILDER_PASS"]

Expand All @@ -91,4 +91,11 @@ def get_job_as_xml(self, job):

jjb_xml = subprocess.Popen(to_execute, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]

if not jjb_xml:
# This is for case job doesn't have credentials and update fail with config containing just url.
# It should pass without any config at all
# Only jobs, which really need credentials, have access to them.
to_execute = ["jenkins-jobs", "test", self.workdir, job.name]
jjb_xml = subprocess.Popen(to_execute, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]

return jjb_xml