{"action":"created","comment":{"url":"https://api.github.com/repos/edx/jenkins-job-dsl/pulls/comments/77684875","id":77684875,"diff_hunk":"@@ -0,0 +1,141 @@\n+package devops\n+\n+import org.yaml.snakeyaml.Yaml\n+import static org.edx.jenkins.dsl.JenkinsPublicConstants.JENKINS_PUBLIC_LOG_ROTATOR\n+import static org.edx.jenkins.dsl.JenkinsPublicConstants.JENKINS_PUBLIC_GITHUB_BASEURL\n+\n+\n+/*\n+Example secret YAML file used by this script\n+\n+    authUser : name-of-auth-user-for-stage\n+    authPass : password-of-auth-user-for-stage\n+    loginEmail : email-for-stage-login\n+    loginPass : password-for-stage-login\n+    courseOrg: organization-of-course-for-test\n+    courseNumber: course-number-of-course-for-test\n+    courseRun: course-run-number-of-course-for-test\n+    courseDisp: course-display-name-of-course-for-test\n+    repoName : repo-name\n+    open : true/false\n+    email: email_for_notification@email.com\n+    platformUrl : platform-github-url-segment\n+    jobName : job-name-to-be-created\n+    platformCredential: n/a\n+*/\n+\n+/* stdout logger */\n+/* use this instead of println, because you can pass it into closures or other scripts. */\n+Map config = [:]\n+Binding bindings = getBinding()\n+config.putAll(bindings.getVariables())\n+PrintStream out = config['out']\n+\n+\n+/* Map to hold the k:v pairs parsed from the secret file */\n+Map secretMap = [:]\n+out.println('Parsing secret YAML file')\n+try {\n+    /* Parse k:v pairs from the secret file referenced by secretFileVariable */\n+    String contents = new File(\"${EDX_END_TO_END_TESTS}\").text\n+    Yaml yaml = new Yaml()\n+    secretMap = yaml.load(contents)\n+    out.println('Successfully parsed secret YAML file')\n+}\n+catch (any) {\n+    out.println('Jenkins DSL: Error parsing secret YAML file')\n+    out.println('Exiting with error code 1')\n+    return 1\n+}\n+\n+/* Iterate over the job configurations */\n+secretMap.each { jobConfigs ->\n+\n+    Map jobConfig = jobConfigs.getValue()\n+\n+    /* Test secret contains all necessary keys for this job */\n+    /* TODO: Use/Build a more robust test framework for this */\n+    assert jobConfig.containsKey('authUser')\n+    assert jobConfig.containsKey('authPass')\n+    assert jobConfig.containsKey('loginEmail')\n+    assert jobConfig.containsKey('loginPass')\n+    assert jobConfig.containsKey('courseOrg')\n+    assert jobConfig.containsKey('courseNumber')\n+    assert jobConfig.containsKey('courseRun')\n+    assert jobConfig.containsKey('courseDisp')\n+    assert jobConfig.containsKey('repoName')","path":"platform/jobs/edxEndToEndRepoMasterWeeklyJob.groovy","position":66,"original_position":66,"commit_id":"7d852f3dc626ad4ed8d34aee53fd54e6769c9e94","original_commit_id":"7d852f3dc626ad4ed8d34aee53fd54e6769c9e94","user":{"login":"estute","id":9300884,"avatar_url":"https://avatars.githubusercontent.com/u/9300884?v=3","gravatar_id":"","url":"https://api.github.com/users/estute","html_url":"https://github.com/estute","followers_url":"https://api.github.com/users/estute/followers","following_url":"https://api.github.com/users/estute/following{/other_user}","gists_url":"https://api.github.com/users/estute/gists{/gist_id}","starred_url":"https://api.github.com/users/estute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estute/subscriptions","organizations_url":"https://api.github.com/users/estute/orgs","repos_url":"https://api.github.com/users/estute/repos","events_url":"https://api.github.com/users/estute/events{/privacy}","received_events_url":"https://api.github.com/users/estute/received_events","type":"User","site_admin":false},"body":"This is not used within the script.","created_at":"2016-09-06T17:50:17Z","updated_at":"2016-09-06T17:50:17Z","html_url":"https://github.com/edx/jenkins-job-dsl/pull/46#discussion_r77684875","pull_request_url":"https://api.github.com/repos/edx/jenkins-job-dsl/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/edx/jenkins-job-dsl/pulls/comments/77684875"},"html":{"href":"https://github.com/edx/jenkins-job-dsl/pull/46#discussion_r77684875"},"pull_request":{"href":"https://api.github.com/repos/edx/jenkins-job-dsl/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/edx/jenkins-job-dsl/pulls/46","id":80981016,"html_url":"https://github.com/edx/jenkins-job-dsl/pull/46","diff_url":"https://github.com/edx/jenkins-job-dsl/pull/46.diff","patch_url":"https://github.com/edx/jenkins-job-dsl/pull/46.patch","issue_url":"https://api.github.com/repos/edx/jenkins-job-dsl/issues/46","number":46,"state":"open","locked":false,"title":"Added script to run jenkins job against edx-e2e-tests repo","user":{"login":"Muddasser","id":4279899,"avatar_url":"https://avatars.githubusercontent.com/u/4279899?v=3","gravatar_id":"","url":"https://api.github.com/users/Muddasser","html_url":"https://github.com/Muddasser","followers_url":"https://api.github.com/users/Muddasser/followers","following_url":"https://api.github.com/users/Muddasser/following{/other_user}","gists_url":"https://api.github.com/users/Muddasser/gists{/gist_id}","starred_url":"https://api.github.com/users/Muddasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Muddasser/subscriptions","organizations_url":"https://api.github.com/users/Muddasser/orgs","repos_url":"https://api.github.com/users/Muddasser/repos","events_url":"https://api.github.com/users/Muddasser/events{/privacy}","received_events_url":"https://api.github.com/users/Muddasser/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-11T15:43:14Z","updated_at":"2016-09-06T17:50:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38e80b7b18ca0a44aef17c601e7a332937de2e11","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/edx/jenkins-job-dsl/pulls/46/commits","review_comments_url":"https://api.github.com/repos/edx/jenkins-job-dsl/pulls/46/comments","review_comment_url":"https://api.github.com/repos/edx/jenkins-job-dsl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/jenkins-job-dsl/issues/46/comments","statuses_url":"https://api.github.com/repos/edx/jenkins-job-dsl/statuses/7d852f3dc626ad4ed8d34aee53fd54e6769c9e94","head":{"label":"edx:muddasser/e2e/jenkins","ref":"muddasser/e2e/jenkins","sha":"7d852f3dc626ad4ed8d34aee53fd54e6769c9e94","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":58765632,"name":"jenkins-job-dsl","full_name":"edx/jenkins-job-dsl","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/jenkins-job-dsl","description":"","fork":false,"url":"https://api.github.com/repos/edx/jenkins-job-dsl","forks_url":"https://api.github.com/repos/edx/jenkins-job-dsl/forks","keys_url":"https://api.github.com/repos/edx/jenkins-job-dsl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/jenkins-job-dsl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/jenkins-job-dsl/teams","hooks_url":"https://api.github.com/repos/edx/jenkins-job-dsl/hooks","issue_events_url":"https://api.github.com/repos/edx/jenkins-job-dsl/issues/events{/number}","events_url":"https://api.github.com/repos/edx/jenkins-job-dsl/events","assignees_url":"https://api.github.com/repos/edx/jenkins-job-dsl/assignees{/user}","branches_url":"https://api.github.com/repos/edx/jenkins-job-dsl/branches{/branch}","tags_url":"https://api.github.com/repos/edx/jenkins-job-dsl/tags","blobs_url":"https://api.github.com/repos/edx/jenkins-job-dsl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/jenkins-job-dsl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/jenkins-job-dsl/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/jenkins-job-dsl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/jenkins-job-dsl/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/jenkins-job-dsl/languages","stargazers_url":"https://api.github.com/repos/edx/jenkins-job-dsl/stargazers","contributors_url":"https://api.github.com/repos/edx/jenkins-job-dsl/contributors","subscribers_url":"https://api.github.com/repos/edx/jenkins-job-dsl/subscribers","subscription_url":"https://api.github.com/repos/edx/jenkins-job-dsl/subscription","commits_url":"https://api.github.com/repos/edx/jenkins-job-dsl/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/jenkins-job-dsl/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/jenkins-job-dsl/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/jenkins-job-dsl/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/jenkins-job-dsl/contents/{+path}","compare_url":"https://api.github.com/repos/edx/jenkins-job-dsl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/jenkins-job-dsl/merges","archive_url":"https://api.github.com/repos/edx/jenkins-job-dsl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/jenkins-job-dsl/downloads","issues_url":"https://api.github.com/repos/edx/jenkins-job-dsl/issues{/number}","pulls_url":"https://api.github.com/repos/edx/jenkins-job-dsl/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/jenkins-job-dsl/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/jenkins-job-dsl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/jenkins-job-dsl/labels{/name}","releases_url":"https://api.github.com/repos/edx/jenkins-job-dsl/releases{/id}","deployments_url":"https://api.github.com/repos/edx/jenkins-job-dsl/deployments","created_at":"2016-05-13T19:03:50Z","updated_at":"2016-06-03T15:18:56Z","pushed_at":"2016-09-05T04:17:41Z","git_url":"git://github.com/edx/jenkins-job-dsl.git","ssh_url":"git@github.com:edx/jenkins-job-dsl.git","clone_url":"https://github.com/edx/jenkins-job-dsl.git","svn_url":"https://github.com/edx/jenkins-job-dsl","homepage":null,"size":270,"stargazers_count":0,"watchers_count":0,"language":"Groovy","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":7,"forks":2,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"2988cbe7a360d3dcbac7e105d46c0809035d8fc8","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":58765632,"name":"jenkins-job-dsl","full_name":"edx/jenkins-job-dsl","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/jenkins-job-dsl","description":"","fork":false,"url":"https://api.github.com/repos/edx/jenkins-job-dsl","forks_url":"https://api.github.com/repos/edx/jenkins-job-dsl/forks","keys_url":"https://api.github.com/repos/edx/jenkins-job-dsl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/jenkins-job-dsl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/jenkins-job-dsl/teams","hooks_url":"https://api.github.com/repos/edx/jenkins-job-dsl/hooks","issue_events_url":"https://api.github.com/repos/edx/jenkins-job-dsl/issues/events{/number}","events_url":"https://api.github.com/repos/edx/jenkins-job-dsl/events","assignees_url":"https://api.github.com/repos/edx/jenkins-job-dsl/assignees{/user}","branches_url":"https://api.github.com/repos/edx/jenkins-job-dsl/branches{/branch}","tags_url":"https://api.github.com/repos/edx/jenkins-job-dsl/tags","blobs_url":"https://api.github.com/repos/edx/jenkins-job-dsl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/jenkins-job-dsl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/jenkins-job-dsl/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/jenkins-job-dsl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/jenkins-job-dsl/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/jenkins-job-dsl/languages","stargazers_url":"https://api.github.com/repos/edx/jenkins-job-dsl/stargazers","contributors_url":"https://api.github.com/repos/edx/jenkins-job-dsl/contributors","subscribers_url":"https://api.github.com/repos/edx/jenkins-job-dsl/subscribers","subscription_url":"https://api.github.com/repos/edx/jenkins-job-dsl/subscription","commits_url":"https://api.github.com/repos/edx/jenkins-job-dsl/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/jenkins-job-dsl/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/jenkins-job-dsl/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/jenkins-job-dsl/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/jenkins-job-dsl/contents/{+path}","compare_url":"https://api.github.com/repos/edx/jenkins-job-dsl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/jenkins-job-dsl/merges","archive_url":"https://api.github.com/repos/edx/jenkins-job-dsl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/jenkins-job-dsl/downloads","issues_url":"https://api.github.com/repos/edx/jenkins-job-dsl/issues{/number}","pulls_url":"https://api.github.com/repos/edx/jenkins-job-dsl/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/jenkins-job-dsl/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/jenkins-job-dsl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/jenkins-job-dsl/labels{/name}","releases_url":"https://api.github.com/repos/edx/jenkins-job-dsl/releases{/id}","deployments_url":"https://api.github.com/repos/edx/jenkins-job-dsl/deployments","created_at":"2016-05-13T19:03:50Z","updated_at":"2016-06-03T15:18:56Z","pushed_at":"2016-09-05T04:17:41Z","git_url":"git://github.com/edx/jenkins-job-dsl.git","ssh_url":"git@github.com:edx/jenkins-job-dsl.git","clone_url":"https://github.com/edx/jenkins-job-dsl.git","svn_url":"https://github.com/edx/jenkins-job-dsl","homepage":null,"size":270,"stargazers_count":0,"watchers_count":0,"language":"Groovy","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":7,"forks":2,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/jenkins-job-dsl/pulls/46"},"html":{"href":"https://github.com/edx/jenkins-job-dsl/pull/46"},"issue":{"href":"https://api.github.com/repos/edx/jenkins-job-dsl/issues/46"},"comments":{"href":"https://api.github.com/repos/edx/jenkins-job-dsl/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/jenkins-job-dsl/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/jenkins-job-dsl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/jenkins-job-dsl/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/edx/jenkins-job-dsl/statuses/7d852f3dc626ad4ed8d34aee53fd54e6769c9e94"}}}}
{"actor":{"display_login":"estute"}}