-
Notifications
You must be signed in to change notification settings - Fork 41
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
[jjbb] for scheduling e2e jobs #418
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,61 @@ | ||
#!/usr/bin/env groovy | ||
|
||
@Library('apm@current') _ | ||
|
||
pipeline { | ||
agent { label 'ubuntu-18 && immutable' } | ||
environment { | ||
REPO = "synthetics" | ||
BASE_DIR = "src/github.com/elastic/${env.REPO}" | ||
PIPELINE_LOG_LEVEL = 'INFO' | ||
SLACK_CHANNEL = '#synthetics-user_experience-uptime' | ||
cachedout marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
options { | ||
timeout(time: 1, unit: 'HOURS') // to support releases then we will add a timeout in each stage | ||
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) | ||
} | ||
stages { | ||
stage('Checkout') { | ||
options { | ||
skipDefaultCheckout() | ||
timeout(5) | ||
} | ||
steps { | ||
deleteDir() | ||
gitCheckout(basedir: "${BASE_DIR}") | ||
stash allowEmpty: true, name: 'source', useDefaultExcludes: false, excludes: ".nvm/**,.npm/_cacache/**,.nvm/.git/**" | ||
} | ||
} | ||
} | ||
post { | ||
cleanup { | ||
notifyBuildResult(prComment: true) | ||
} | ||
unsuccessful { | ||
notifyStatus(slackStatus: 'danger', subject: "[${env.REPO}] e2e failed", body: "(<${env.RUN_DISPLAY_URL}|Open>)") | ||
} | ||
success { | ||
notifyStatus(slackStatus: 'good', subject: "[${env.REPO}] e2e ran successfully", body: "Great news, the e2e for synthetics has finished successfully. (<${env.RUN_DISPLAY_URL}|Open>).") | ||
} | ||
} | ||
} | ||
|
||
/** | ||
This is the wrapper to send notifications for the release process through | ||
v1v marked this conversation as resolved.
Show resolved
Hide resolved
|
||
slack and email, since it requires some formatting to support the same | ||
message in both systems. | ||
*/ | ||
def notifyStatus(def args = [:]) { | ||
releaseNotification(slackChannel: "${env.SLACK_CHANNEL}", | ||
v1v marked this conversation as resolved.
Show resolved
Hide resolved
|
||
slackColor: args.slackStatus, | ||
slackCredentialsId: 'jenkins-slack-integration-token', | ||
to: 'synthrum@elastic.co', | ||
subject: args.subject, | ||
body: args.body) | ||
} |
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 @@ | ||
--- | ||
- job: | ||
name: apm-agent-rum/e2e-synthetics-mbp | ||
display-name: E2E for Elastic Synthetics | ||
description: E2E for Elastic Synthetics. | ||
project-type: multibranch | ||
script-path: .ci/e2e-synthetics.groovy | ||
scm: | ||
- github: | ||
branch-discovery: 'no-pr' | ||
discover-pr-forks-strategy: 'merge-current' | ||
discover-pr-forks-trust: 'permission' | ||
discover-pr-origin: 'merge-current' | ||
discover-tags: false | ||
disable-pr-notifications: true | ||
head-filter-regex: '(master|\d+\.\d+\.\d+|PR-.*)' | ||
notification-context: 'elastic-synthetics' | ||
repo: 'synthetics' | ||
repo-owner: 'elastic' | ||
credentials-id: 2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken | ||
ssh-checkout: | ||
credentials: f6c7695a-671e-4f4f-a331-acdce44ff9ba | ||
build-strategies: | ||
- regular-branches: true | ||
- change-request: | ||
ignore-target-only-changes: true | ||
property-strategies: | ||
all-branches: | ||
- suppress-scm-triggering: true | ||
clean: | ||
after: true | ||
before: true | ||
prune: true | ||
shallow-clone: true | ||
depth: 3 | ||
do-not-fetch-tags: true | ||
submodule: | ||
disable: false | ||
recursive: true | ||
parent-credentials: true | ||
timeout: 100 | ||
timeout: '15' | ||
use-author: true | ||
wipe-workspace: true |
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,26 @@ | ||
--- | ||
- job: | ||
name: apm-agent-rum/e2e-synthetics-schedule | ||
display-name: Jobs scheduled daily | ||
description: Jobs scheduled daily from Monday to Friday | ||
project-type: pipeline | ||
parameters: | ||
- string: | ||
name: branch_specifier | ||
default: master | ||
description: the Git branch specifier to build | ||
pipeline-scm: | ||
script-path: .ci/schedule.groovy | ||
scm: | ||
- git: | ||
url: git@github.com:elastic/synthetics.git | ||
refspec: +refs/heads/*:refs/remotes/origin/* +refs/pull/*/head:refs/remotes/origin/pr/* | ||
wipe-workspace: 'True' | ||
name: origin | ||
shallow-clone: true | ||
credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba | ||
reference-repo: /var/lib/jenkins/.git-references/synthetics.git | ||
branches: | ||
- $branch_specifier | ||
triggers: | ||
- timed: 'H 4,16 * * 1-5' |
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,37 @@ | ||
#!/usr/bin/env groovy | ||
|
||
@Library('apm@current') _ | ||
|
||
pipeline { | ||
agent none | ||
environment { | ||
NOTIFY_TO = credentials('notify-to') | ||
PIPELINE_LOG_LEVEL='INFO' | ||
} | ||
options { | ||
timeout(time: 1, unit: 'HOURS') | ||
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20')) | ||
timestamps() | ||
ansiColor('xterm') | ||
disableResume() | ||
durabilityHint('PERFORMANCE_OPTIMIZED') | ||
} | ||
triggers { | ||
cron('H 4,16 * * 1-5') | ||
} | ||
stages { | ||
stage('Run Tasks'){ | ||
steps { | ||
build(job: 'apm-agent-rum/e2e-synthetics-mpb/master', | ||
v1v marked this conversation as resolved.
Show resolved
Hide resolved
|
||
propagate: false, | ||
wait: false | ||
) | ||
} | ||
} | ||
} | ||
post { | ||
cleanup { | ||
notifyBuildResult() | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Quite basic pipeline to only checkout the source code and notify the status in slack/email.
TBC in a follow up