Skip to content
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
87 changes: 87 additions & 0 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#!/usr/bin/env groovy

@Library('apm@current') _

pipeline {
agent { label 'linux && immutable' }
environment {
REPO = 'ecs-logging-python'
BASE_DIR = "src/go.elastic.co/apm/${env.REPO}"
NOTIFY_TO = credentials('notify-to')
}
options {
timeout(time: 1, unit: 'HOURS')
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)?.*')
}
stages {
stage('Checkout') {
options { skipDefaultCheckout() }
steps {
pipelineManager([ cancelPreviousRunningBuilds: [ when: 'PR' ] ])
deleteDir()
gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: true)
stash allowEmpty: true, name: 'source', useDefaultExcludes: false
}
}
stage('Sanity checks') {
options { skipDefaultCheckout() }
environment {
HOME = "${env.WORKSPACE}"
PATH = "${env.HOME}/bin:${env.PATH}"
}
steps {
deleteDir()
unstash 'source'
dir("${BASE_DIR}"){
preCommit(commit: "${GIT_BASE_COMMIT}", junit: true)
}
}
}
stage('Test') {
matrix {
agent { label 'linux && immutable' }
axes {
axis {
name 'VERSION'
values '2.7', '3.5', '3.6', '3.7', '3.8'
}
}
stages {
stage('Test') {
options { skipDefaultCheckout() }
steps {
withGithubNotify(context: "Test ${VERSION}") {
deleteDir()
unstash 'source'
dir("${BASE_DIR}"){
sh(".ci/scripts/test.sh ${VERSION}")
}
}
}
post {
always {
dir("${BASE_DIR}"){
junit(allowEmptyResults: true, keepLongStdio: true, testResults: '**/junit*.xml')
}
}
}
}
}
}
}
}
post {
cleanup {
notifyBuildResult()
}
}
}
59 changes: 59 additions & 0 deletions .ci/jobs/defaults.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---

##### GLOBAL METADATA

- meta:
cluster: apm-ci

##### JOB DEFAULTS

- job:
view: APM-CI
project-type: multibranch
logrotate:
daysToKeep: 30
numToKeep: 100
number-to-keep: '5'
days-to-keep: '1'
concurrent: true
node: linux
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
repo: ecs-logging-python
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: 3
do-not-fetch-tags: true
submodule:
disable: false
recursive: true
parent-credentials: true
timeout: 100
timeout: '15'
use-author: true
wipe-workspace: 'True'
periodic-folder-trigger: 1w
prune-dead-branches: true
publishers:
- email:
recipients: infra-root+build@elastic.co
5 changes: 5 additions & 0 deletions .ci/jobs/ecs-logging-python-mbp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- job:
name: apm-agent-python/ecs-logging-python-mbp
display-name: ecs-logging-python
description: Logging formatters for the Elastic Common Schema (ECS) in Python
4 changes: 4 additions & 0 deletions .ci/scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -e

echo 'TBD'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something to be done in a follow-up

4 changes: 4 additions & 0 deletions .ci/scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -e

echo 'TBD'
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repos:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something to be done in a follow-up

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
hooks:
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict

- repo: git@github.com:elastic/apm-pipeline-library
rev: current
hooks:
- id: check-bash-syntax
- id: check-jenkins-pipelines
- id: check-jjbb