diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index de7de19137..8103f87e0c 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -23,6 +23,7 @@ pipeline { JOB_GCS_EXT_CREDENTIALS = 'fleet-ci-gcs-plugin-file-credentials' ELASTIC_PACKAGE_GCP_SECRET = 'secret/observability-team/ci/service-account/elastic-package-gcp' ELASTIC_OBSERVABILITY_PROJECT_ID = 'elastic-observability' + BUILDKITE_MERGE_COMMIT = "79ee1738578deac17f8f5caf8d925db6244ab6df" } options { timeout(time: 1, unit: 'HOURS') @@ -55,6 +56,27 @@ pipeline { /** Check the source code. */ + stage('Check it contains Buildkite pipeline') { + steps { + cleanup() + dir("${BASE_DIR}"){ + script { + githubEnv() + r = sh(label: 'Check', returnStatus: true, script: ''' + echo "Base commit: ${GIT_BASE_COMMIT}" + git log --format=%H "${GIT_BASE_COMMIT}" | grep "${BUILDKITE_MERGE_COMMIT}" + ''') + if (r != 0) { + echo("You should update your branch to include latest buildkite pipelines") + sh(label: 'Exit', script: 'exit 1') + } + } + } + } + } + /** + Check the source code. + */ stage('Check static') { steps { cleanup()