-
Notifications
You must be signed in to change notification settings - Fork 72
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
Adding CI setup files #13
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,75 @@ | ||||||
#!/usr/bin/env groovy | ||||||
|
||||||
@Library('apm@current') _ | ||||||
|
||||||
pipeline { | ||||||
agent { label 'ubuntu-18 && immutable' } | ||||||
environment { | ||||||
BASE_DIR="src/github.com/elastic/package-spec" | ||||||
JOB_GIT_CREDENTIALS = "f6c7695a-671e-4f4f-a331-acdce44ff9ba" | ||||||
PIPELINE_LOG_LEVEL='INFO' | ||||||
} | ||||||
options { | ||||||
timeout(time: 15, unit: 'MINUTES') | ||||||
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20', daysToKeepStr: '30')) | ||||||
timestamps() | ||||||
ansiColor('xterm') | ||||||
disableResume() | ||||||
durabilityHint('PERFORMANCE_OPTIMIZED') | ||||||
rateLimitBuilds(throttle: [count: 60, durationName: 'hour', userBoost: true]) | ||||||
quietPeriod(10) | ||||||
} | ||||||
triggers { | ||||||
issueCommentTrigger('(?i)(.*(?:jenkins\\W+)?run\\W+(?:the\\W+)?tests(?:\\W+please)?.*|^\\/test$)') | ||||||
} | ||||||
stages { | ||||||
/** | ||||||
Checkout the code and stash it, to use it on other stages. | ||||||
*/ | ||||||
stage('Checkout') { | ||||||
steps { | ||||||
deleteDir() | ||||||
gitCheckout(basedir: "${BASE_DIR}") | ||||||
stash allowEmpty: true, name: 'source', useDefaultExcludes: false | ||||||
} | ||||||
} | ||||||
/** | ||||||
Check the source code. | ||||||
*/ | ||||||
stage('Check') { | ||||||
steps { | ||||||
cleanup() | ||||||
withMageEnv(){ | ||||||
dir("${BASE_DIR}"){ | ||||||
sh(label: 'Check',script: 'make check') | ||||||
} | ||||||
} | ||||||
} | ||||||
} | ||||||
/** | ||||||
Test the source code. | ||||||
*/ | ||||||
stage('Test') { | ||||||
steps { | ||||||
cleanup() | ||||||
withMageEnv(){ | ||||||
dir("${BASE_DIR}"){ | ||||||
sh(label: 'Check',script: 'make test') | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Tiny nit: missing space There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What output does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the moment Would it be better if it output in a junit-compatible format? We could certainly make that happen with something like https://github.com/jstemmer/go-junit-report. |
||||||
} | ||||||
} | ||||||
} | ||||||
} | ||||||
} | ||||||
post { | ||||||
cleanup { | ||||||
notifyBuildResult(prComment: true) | ||||||
} | ||||||
} | ||||||
} | ||||||
|
||||||
def cleanup(){ | ||||||
dir("${BASE_DIR}"){ | ||||||
deleteDir() | ||||||
} | ||||||
unstash 'source' | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
|
||
##### GLOBAL METADATA | ||
|
||
- meta: | ||
cluster: beats-ci | ||
|
||
##### JOB DEFAULTS | ||
|
||
- job: | ||
logrotate: | ||
numToKeep: 20 | ||
node: linux | ||
concurrent: true | ||
publishers: | ||
- email: | ||
recipients: [email protected] | ||
prune-dead-branches: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
- job: | ||
name: Beats/package-spec | ||
display-name: Package Spec | ||
description: Jenkins pipeline for the Package Spec project | ||
view: Beats | ||
project-type: multibranch | ||
script-path: .ci/Jenkinsfile | ||
scm: | ||
- github: | ||
branch-discovery: no-pr | ||
discover-pr-forks-strategy: merge-current | ||
discover-pr-forks-trust: permission | ||
discover-pr-origin: merge-current | ||
discover-tags: true | ||
notification-context: 'package-spec' | ||
repo: package-spec | ||
repo-owner: elastic | ||
credentials-id: 2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken | ||
ssh-checkout: | ||
credentials: f6c7695a-671e-4f4f-a331-acdce44ff9ba | ||
build-strategies: | ||
- tags: | ||
ignore-tags-older-than: -1 | ||
ignore-tags-newer-than: -1 | ||
- regular-branches: true | ||
- change-request: | ||
ignore-target-only-changes: false | ||
clean: | ||
after: true | ||
before: true | ||
prune: true | ||
shallow-clone: true | ||
depth: 5 | ||
do-not-fetch-tags: true | ||
submodule: | ||
disable: false | ||
recursive: true | ||
parent-credentials: true | ||
timeout: 100 | ||
timeout: '15' | ||
use-author: true | ||
wipe-workspace: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny nit: Missing space