-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: migrate permissions-report to infra.ci
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
- Loading branch information
Showing
3 changed files
with
48 additions
and
13 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
@Library('pipeline-library@pull/348/head') _ | ||
|
||
pipeline { | ||
triggers { | ||
// Execute once per day | ||
cron('@daily') | ||
} | ||
options { | ||
// This pipeline takes 6-7 hours max to execute | ||
timeout(time: 10, unit: 'HOURS') | ||
lock(resource: 'infra-reports-github-permissions', inversePrecedence: true) | ||
} | ||
agent { | ||
kubernetes { | ||
yamlFile 'JenkinsAgentPodTemplate.yaml' | ||
} | ||
} | ||
stages { | ||
stage('Generate GitHub Permissions Report') { | ||
environment { | ||
GITHUB_AUTH = credentials('jenkins-infra-reports') | ||
/** | ||
The error "graphql-<version>/lib/graphql/schema/loader.rb:17:in `fetch': key not found: "data" (KeyError)" | ||
means that the connection to GitHub GraphQL API failed (usually bad authentication) | ||
**/ | ||
} | ||
steps { | ||
dir('permissions-report') { | ||
// Requires $GITHUB_AUTH_PSW to hold an IAT (github installation access token) valid for 1 hour, or a PAT | ||
// Requires $GITHUB_AUTH_USR to hold the GitHub App ID, or the username (if using a PAT) | ||
sh 'ruby ./permissions-report.rb > github-jenkinsci-permissions-report.json' | ||
archiveArtifacts 'github-jenkinsci-permissions-report.json' | ||
} | ||
} | ||
} | ||
stage('Publish Report') { | ||
steps { | ||
dir('permissions-report') { | ||
publishReports ([ 'github-jenkinsci-permissions-report.json' ]) | ||
} | ||
} | ||
} | ||
} | ||
} |
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