diff --git a/.ci/scripts/test-release.sh b/.buildkite/scripts/test-release.sh similarity index 100% rename from .ci/scripts/test-release.sh rename to .buildkite/scripts/test-release.sh diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile deleted file mode 100644 index a51803d2c..000000000 --- a/.ci/Jenkinsfile +++ /dev/null @@ -1,262 +0,0 @@ -#!/usr/bin/env groovy - -@Library('apm@current') _ - -pipeline { - agent { label 'ubuntu-18 && immutable' } - environment { - REPO="fleet-server" - BASE_DIR="src/github.com/elastic/${env.REPO}" - DOCKER_COMPOSE_VERSION = '1.25.5' - JOB_GIT_CREDENTIALS = "f6c7695a-671e-4f4f-a331-acdce44ff9ba" - PIPELINE_LOG_LEVEL='INFO' - JOB_GCS_BUCKET = 'fleet-ci-artifacts' - JOB_GCS_CREDENTIALS = 'fleet-ci-gcs-plugin-file-credentials' - - DOCKER_REGISTRY = 'docker.elastic.co' - DOCKER_REGISTRY_SECRET = 'secret/observability-team/ci/docker-registry/prod' - - DOCKER_IMAGE = "${env.DOCKER_REGISTRY}/observability-ci/fleet-server" - - EC_KEY_SECRET = 'secret/observability-team/ci/elastic-cloud/observability-pro' - TERRAFORM_VERSION = '1.4.6' - } - 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("${obltGitHubComments()}") - } - stages { - /** - Checkout the code and stash it, to use it on other stages. - */ - stage('Checkout') { - options { skipDefaultCheckout() } - steps { - deleteDir() - gitCheckout(basedir: "${BASE_DIR}") - stash allowEmpty: true, name: 'source', useDefaultExcludes: false - } - } - stage('Check') { - options { skipDefaultCheckout() } - steps { - withGithubNotify(context: "Check") { - cleanup() - dir("${BASE_DIR}"){ - withGoEnv(){ - sh(label: 'check',script: 'make check-ci') - } - } - } - } - } - stage('Local') { - options { skipDefaultCheckout() } - steps { - withGithubNotify(context: "Local") { - cleanup() - dir("${BASE_DIR}"){ - withGoEnv(){ - sh(label: 'local',script: 'make local') - } - } - } - } - } - stage('Unit Test') { - options { skipDefaultCheckout() } - steps { - withGithubNotify(context: "Unit Test", tab: 'tests') { - cleanup() - dir("${BASE_DIR}"){ - withGoEnv(){ - sh(label: 'test', script: 'make test-unit') - sh(label: 'test', script: 'make junit-report') - } - } - } - } - post { - always { - junit(allowEmptyResults: true, keepLongStdio: true, testResults: "${BASE_DIR}/build/*.xml") - } - } - } - stage('Integration Test') { - options { skipDefaultCheckout() } - steps { - withGithubNotify(context: "Integration Test", tab: 'tests') { - cleanup() - dir("${BASE_DIR}"){ - withGoEnv(){ - retryWithSleep(retries: 2, seconds: 5, backoff: true){ sh(label: "Install Docker", script: '.ci/scripts/install-docker-compose.sh') } - sh(label: 'test', script: 'make test-int') - sh(label: 'test', script: 'make junit-report') - } - } - } - } - post { - always { - junit(allowEmptyResults: true, keepLongStdio: true, testResults: "${BASE_DIR}/build/*.xml") - } - } - } - stage('E2E Test') { - options { skipDefaultCheckout() } - steps { - withGithubNotify(context: "E2E Test", tab: 'tests') { - cleanup() - dir("${BASE_DIR}"){ - withGoEnv(){ - retryWithSleep(retries: 2, seconds: 5, backoff: true){ sh(label: "Install Docker", script: '.ci/scripts/install-docker-compose.sh') } - sh(label: 'test', script: 'make test-e2e') - } - } - } - } - } - stage('Cloud e2e Test') { - options { skipDefaultCheckout() } - steps { - withGithubNotify(context: "Cloud e2e test", tab: 'tests') { - cleanup() - dir("${BASE_DIR}"){ - withGoEnv(){ - withTerraformEnv(version: "${TERRAFORM_VERSION}", forceInstallation: true) { - withSecretVault(secret: "${EC_KEY_SECRET}", data: ['apiKey': 'EC_API_KEY'] ) { - retryWithSleep(retries: 2, seconds: 5, backoff: true){ sh(label: "Install Docker", script: '.ci/scripts/install-docker-compose.sh') } - dockerLogin(secret: "${env.DOCKER_REGISTRY_SECRET}", - registry: "${env.DOCKER_REGISTRY}") - sh(label: 'cloud e2e tests', script: 'USER=fleetserverci make test-cloude2e') - } - } - } - } - } - } - } - stage('Publish Docker Image') { - options { skipDefaultCheckout() } - when { - not { changeRequest() } - } - environment { - DOCKER_IMAGE_SHA_TAG = "git-${env.GIT_BASE_COMMIT.substring(0, 12)}" - DOCKER_IMAGE_LATEST_TAG = "latest" - DOCKER_IMAGE_GIT_TAG = "${env.BRANCH_NAME}" - } - steps { - withGithubNotify(context: "Publish Docker images") { - cleanup() - dir("${BASE_DIR}") { - catchError(buildResult: 'UNSTABLE', message: 'Unable to push Docker images', stageResult: 'FAILURE') { - dockerLogin(secret: "${env.DOCKER_REGISTRY_SECRET}", - registry: "${env.DOCKER_REGISTRY}") - - sh(label: 'Build docker image', script: """ - # not rebuild the image if it exists in the docker registry - if ! docker pull -q ${env.DOCKER_IMAGE}:${env.DOCKER_IMAGE_SHA_TAG} 2> /dev/null ; then - DOCKER_IMAGE="${env.DOCKER_IMAGE}" DOCKER_IMAGE_TAG="${env.DOCKER_IMAGE_SHA_TAG}" make build-docker - fi - """) - - pushDockerImage(image: "${env.DOCKER_IMAGE}", tag: "${env.DOCKER_IMAGE_SHA_TAG}") - - whenFalse(isTag()) { - retagDockerImage(image: "${env.DOCKER_IMAGE}", currentTag: "${env.DOCKER_IMAGE_SHA_TAG}", newTag: "${env.DOCKER_IMAGE_LATEST_TAG}") - pushDockerImage(image: "${env.DOCKER_IMAGE}", tag: "${env.DOCKER_IMAGE_LATEST_TAG}") - } - whenTrue(isTag()) { - retagDockerImage(image: "${env.DOCKER_IMAGE}", currentTag: "${env.DOCKER_IMAGE_SHA_TAG}", newTag: "${env.DOCKER_IMAGE_GIT_TAG}") - pushDockerImage(image: "${env.DOCKER_IMAGE}", tag: "${env.DOCKER_IMAGE_GIT_TAG}") - } - } - } - } - } - } - stage('Release Test') { - options { skipDefaultCheckout() } - steps { - withGithubNotify(context: "Release Test") { - cleanup() - dir("${BASE_DIR}"){ - withGoEnv(){ - sh(label: 'Create release artifacts', script: 'make docker-release') - uploadPackagesToGoogleBucket(pattern: 'build/distributions/') - sh(label: 'Check release artifacts', script: 'make test-release') - - sh(label: 'Build docker image', script: 'make build-docker') - } - } - } - } - } - // Package registry is decoupled from the unified release, but we provide versioned distribution - // images with a "snapshot" of the packages available in epr.elastic.co. We decided to trigger the - // build of this snapshot from a project coupled to the unified release. It is now in fleet-server, but - // it could be in other projects. - stage('Release - Package Registry Distribution') { - options { skipDefaultCheckout() } - when { expression { isTag() } } - steps { - build(job: "release-package-registry-distribution", - propagate: false, - wait: false, - parameters: [ - string(name: 'DOCKER_TAG', value: "${env.TAG_NAME}") - ] - ) - } - } - stage('Downstream - Package') { - options { skipDefaultCheckout() } - when { expression { isBranch() } } - steps { - build(job: "fleet-server/fleet-server-package-mbp/${env.JOB_BASE_NAME}", - propagate: false, - wait: false, - parameters: [string(name: 'COMMIT', value: "${env.GIT_BASE_COMMIT}")]) - } - } - } - post { - cleanup { - notifyBuildResult(prComment: true, - analyzeFlakey: !isTag(), jobName: getFlakyJobName(withBranch: (isPR() ? env.CHANGE_TARGET : env.BRANCH_NAME)), - githubIssue: isBranch() && currentBuild.currentResult != "SUCCESS", - githubLabels: 'Team:Elastic-Agent-Control-Plane') - } - } -} - -def cleanup(){ - dir("${BASE_DIR}"){ - deleteDir() - } - unstash 'source' -} - -def retagDockerImage(Map args=[:]) { - sh(label: "Re-tag docker as git tag ${env.newTag}", script: """ - docker tag ${args.image}:${args.currentTag} ${args.image}:${args.newTag} - """) -} - -def pushDockerImage(Map args=[:]) { - retryWithSleep(retries: 3, seconds: 5, backoff: true){ - sh(label: "Push Docker image ${args.image}:${args.tag}", script: """ - DOCKER_IMAGE="${args.image}" DOCKER_IMAGE_TAG="${args.tag}" make release-docker - """) - } -} diff --git a/.ci/jobs/defaults.yml b/.ci/jobs/defaults.yml deleted file mode 100644 index 0e3defc4e..000000000 --- a/.ci/jobs/defaults.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -##### GLOBAL METADATA - -- meta: - cluster: fleet-ci - -##### JOB DEFAULTS - -- job: - logrotate: - numToKeep: 20 - node: linux - concurrent: true - publishers: - - email: - recipients: infra-root+build@elastic.co - prune-dead-branches: true diff --git a/.ci/jobs/fleet-server-package-mbp.yml b/.ci/jobs/fleet-server-package-mbp.yml deleted file mode 100644 index 781e4af22..000000000 --- a/.ci/jobs/fleet-server-package-mbp.yml +++ /dev/null @@ -1,56 +0,0 @@ ---- -- job: - name: fleet-server/fleet-server-package-mbp - display-name: Fleet Server Package - description: Jenkins pipeline for the Elastic Fleet Server package process - project-type: multibranch - concurrent: true - script-path: .ci/packaging.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: '(7\.17|8\.9|PR-.*)' - notification-context: 'fleet-server-package' - repo: fleet-server - repo-owner: elastic - credentials-id: 2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken - ssh-checkout: - credentials: f6c7695a-671e-4f4f-a331-acdce44ff9ba - property-strategies: - all-branches: - - suppress-scm-triggering: true - build-strategies: - - skip-initial-build: true - - named-branches: - - exact-name: - name: 'main' - case-sensitive: true - - regex-name: - regex: '7\.17' - case-sensitive: true - - regex-name: - regex: '8\.\d+' - case-sensitive: true - - change-request: - ignore-target-only-changes: true - 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 - reference-repo: /var/lib/jenkins/.git-references/fleet-server.git - timeout: '15' - use-author: true - wipe-workspace: true diff --git a/.ci/jobs/fleet-server.yml b/.ci/jobs/fleet-server.yml deleted file mode 100644 index f9ca637f3..000000000 --- a/.ci/jobs/fleet-server.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -- job: - name: fleet-server/fleet-server-mbp - display-name: Fleet Server - description: Jenkins pipeline for the Elastic Fleet Server 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 - head-filter-regex: '(7\.x|7\.1\d|8\.9|PR-.*|v\d+\.\d+\.\d+)' - notification-context: 'fleet-server' - repo: fleet-server - 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: '15' - use-author: true - wipe-workspace: true diff --git a/.ci/jobs/folders.yml b/.ci/jobs/folders.yml deleted file mode 100644 index 178ab4dc6..000000000 --- a/.ci/jobs/folders.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -#https://docs.openstack.org/infra/jenkins-job-builder/project_folder.html -- job: - name: fleet-server - description: Fleet Server related Jobs - project-type: folder - -- view: - name: fleet-server - view-type: list diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy deleted file mode 100644 index 905855c42..000000000 --- a/.ci/packaging.groovy +++ /dev/null @@ -1,266 +0,0 @@ -#!/usr/bin/env groovy -@Library('apm@current') _ - -pipeline { - agent none - environment { - REPO = 'fleet-server' - BASE_DIR = "src/github.com/elastic/${env.REPO}" - SLACK_CHANNEL = '#elastic-agent-control-plane' - NOTIFY_TO = 'fleet-server+build-package@elastic.co' - JOB_GCS_BUCKET = credentials('gcs-bucket') - JOB_GCS_CREDENTIALS = 'fleet-ci-gcs-plugin' - DOCKER_SECRET = 'secret/observability-team/ci/docker-registry/prod' - DOCKER_REGISTRY = 'docker.elastic.co' - DRA_OUTPUT = 'release-manager.out' - COMMIT = "${params?.COMMIT}" - JOB_GIT_CREDENTIALS = "f6c7695a-671e-4f4f-a331-acdce44ff9ba" - } - options { - timeout(time: 2, unit: 'HOURS') - buildDiscarder(logRotator(numToKeepStr: '100', artifactNumToKeepStr: '30', daysToKeepStr: '30')) - timestamps() - ansiColor('xterm') - disableResume() - durabilityHint('PERFORMANCE_OPTIMIZED') - rateLimitBuilds(throttle: [count: 60, durationName: 'hour', userBoost: true]) - quietPeriod(10) - } - parameters { - string(name: 'COMMIT', defaultValue: '', description: 'The Git commit to be used (empty will checkout the latest commit)') - } - stages { - stage('Filter build') { - options { skipDefaultCheckout() } - agent { label 'ubuntu-20 && immutable' } - when { - beforeAgent true - anyOf { - triggeredBy cause: "IssueCommentCause" - expression { - def ret = isUserTrigger() || isUpstreamTrigger() - if(!ret){ - currentBuild.result = 'NOT_BUILT' - currentBuild.description = "The build has been skipped" - currentBuild.displayName = "#${BUILD_NUMBER}-(Skipped)" - echo("the build has been skipped due the trigger is a branch scan and the allowed ones are manual, GitHub comment, and upstream job") - } - return ret - } - } - } - environment { - PATH = "${env.PATH}:${env.WORKSPACE}/bin" - HOME = "${env.WORKSPACE}" - } - stages { - stage('Checkout') { - options { skipDefaultCheckout() } - steps { - pipelineManager([ cancelPreviousRunningBuilds: [ when: 'PR' ] ]) - deleteDir() - smartGitCheckout() - stash(allowEmpty: true, name: 'source', useDefaultExcludes: false) - setEnvVar('IS_BRANCH_AVAILABLE', isBranchUnifiedReleaseAvailable(env.BRANCH_NAME)) - dir("${BASE_DIR}") { - setEnvVar('VERSION', sh(label: 'Get version', script: 'make get-version', returnStdout: true)?.trim()) - } - } - } - stage('Package') { - options { skipDefaultCheckout() } - matrix { - agent { - label "${PLATFORM}" - } - axes { - axis { - name 'PLATFORM' - values 'ubuntu-20 && immutable', 'arm' - } - axis { - name 'TYPE' - values 'snapshot', 'staging' - } - } - stages { - stage('Package') { - options { skipDefaultCheckout() } - environment { - PLATFORMS = "${isArm() ? 'linux/arm64' : ''}" - PACKAGES = "${isArm() ? 'docker' : ''}" - } - steps { - runIfNoMainAndNoStaging() { - runPackage(type: env.TYPE) - } - } - } - stage('Publish') { - options { skipDefaultCheckout() } - steps { - runIfNoMainAndNoStaging() { - publishArtifacts(type: env.TYPE) - } - } - } - } - } - post { - failure { - notifyStatus(subject: "[${env.REPO}@${env.BRANCH_NAME}] package failed.", - body: 'Contact the Productivity team [#observablt-robots] if you need further assistance.') - } - } - } - stage('DRA Snapshot') { - options { skipDefaultCheckout() } - // The Unified Release process keeps moving branches as soon as a new - // minor version is created, therefore old release branches won't be able - // to use the release manager as their definition is removed. - when { - expression { return env.IS_BRANCH_AVAILABLE == "true" } - } - steps { - runReleaseManager(type: 'snapshot', outputFile: env.DRA_OUTPUT) - } - post { - failure { - notifyStatus(analyse: true, - file: "${BASE_DIR}/${env.DRA_OUTPUT}", - subject: "[${env.REPO}@${env.BRANCH_NAME}] The Daily releasable artifact failed.", - body: 'Contact the Release Platform team [#platform-release].') - } - } - } - stage('DRA Release Staging') { - options { skipDefaultCheckout() } - when { - allOf { - // The Unified Release process keeps moving branches as soon as a new - // minor version is created, therefore old release branches won't be able - // to use the release manager as their definition is removed. - expression { return env.IS_BRANCH_AVAILABLE == "true" } - not { branch 'main' } - } - } - steps { - runReleaseManager(type: 'staging', outputFile: env.DRA_OUTPUT) - } - post { - failure { - notifyStatus(analyse: true, - file: "${BASE_DIR}/${env.DRA_OUTPUT}", - subject: "[${env.REPO}@${env.BRANCH_NAME}] The Daily releasable artifact failed.", - body: 'Contact the Release Platform team [#platform-release].') - } - } - } - } - } - } - post { - cleanup { - notifyBuildResult(prComment: false) - } - } -} - -def runPackage(def args = [:]) { - def makeGoal = args.type.equals('staging') ? 'release-manager-release' : 'release-manager-snapshot' - deleteDir() - unstash 'source' - dir("${BASE_DIR}"){ - withMageEnv() { - sh(label: 'make release-manager', script: "make ${makeGoal}") - } - } -} - -def publishArtifacts(def args = [:]) { - // Copy those files to another location with the sha commit to test them afterward. - googleStorageUpload(bucket: getBucketLocation(args.type), - credentialsId: "${JOB_GCS_CREDENTIALS}", - pathPrefix: "${BASE_DIR}/build/distributions/", - pattern: "${BASE_DIR}/build/distributions/**/*", - sharedPublicly: true, - showInline: true) -} - -def getBucketLocation(type) { - return "gs://${JOB_GCS_BUCKET}/${getBucketRelativeLocation(type)}" -} - -def getBucketRelativeLocation(type) { - def folder = type.equals('snapshot') ? 'commits' : type - return "${folder}/${env.GIT_BASE_COMMIT}" -} - -def getBucketPathPrefix(type) { - // JOB_GCS_BUCKET contains the bucket and some folders, - // let's build up the folder structure without the parent folder - def relative = getBucketRelativeLocation(type) - if (JOB_GCS_BUCKET.contains('/')) { - return JOB_GCS_BUCKET.substring(JOB_GCS_BUCKET.indexOf('/') + 1) + '/' + relative - } - return relative -} - -def runReleaseManager(def args = [:]) { - deleteDir() - unstash 'source' - googleStorageDownload(bucketUri: "${getBucketLocation(args.type)}/*", - credentialsId: "${JOB_GCS_CREDENTIALS}", - localDirectory: "${BASE_DIR}/build/distributions", - pathPrefix: getBucketPathPrefix(args.type)) - dir("${BASE_DIR}") { - def makeGoal = args.type.equals('staging') ? 'release-manager-dependencies-release' : 'release-manager-dependencies-snapshot' - withMageEnv() { - sh(label: 'create dependencies file', script: "make ${makeGoal}") - } - dockerLogin(secret: env.DOCKER_SECRET, registry: env.DOCKER_REGISTRY) - releaseManager(project: 'fleet-server', - version: env.VERSION, - type: args.type, - artifactsFolder: 'build/distributions', - outputFile: args.outputFile) - } -} - -def notifyStatus(def args = [:]) { - def releaseManagerFile = args.get('file', '') - def analyse = args.get('analyse', false) - def subject = args.get('subject', '') - def body = args.get('body', '') - releaseManagerNotification(file: releaseManagerFile, - analyse: analyse, - slackChannel: "${env.SLACK_CHANNEL}", - slackColor: 'danger', - slackCredentialsId: 'jenkins-slack-integration-token', - to: "${env.NOTIFY_TO}", - subject: subject, - body: "Build: (<${env.RUN_DISPLAY_URL}|here>).\n ${body}") -} - -def runIfNoMainAndNoStaging(Closure body) { - if (env.BRANCH_NAME.equals('main') && env.TYPE == 'staging') { - echo 'INFO: staging artifacts for the main branch are not required.' - } else { - body() - } -} - -def smartGitCheckout() { - // Checkout the given commit - if (env.COMMIT?.trim()) { - gitCheckout(basedir: "${BASE_DIR}", - branch: "${env.COMMIT}", - credentialsId: "${JOB_GIT_CREDENTIALS}", - repo: "https://github.com/elastic/${REPO}.git") - } else { - gitCheckout(basedir: "${BASE_DIR}", - githubNotifyFirstTimeContributor: false, - shallow: false, - reference: "/var/lib/jenkins/.git-references/${REPO}.git") - } -} diff --git a/.ci/scripts/install-docker-compose.sh b/.ci/scripts/install-docker-compose.sh deleted file mode 100755 index f08bfcddb..000000000 --- a/.ci/scripts/install-docker-compose.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -set -exuo pipefail - -MSG="environment variable missing: DOCKER_COMPOSE_VERSION." -DOCKER_COMPOSE_VERSION=${DOCKER_COMPOSE_VERSION:?$MSG} -HOME=${HOME:?$MSG} - -if command -v docker-compose -then - echo "Found docker-compose. Checking version.." - FOUND_DOCKER_COMPOSE_VERSION=$(docker-compose --version|awk '{print $3}'|sed s/\,//) - if [ "$FOUND_DOCKER_COMPOSE_VERSION" == "$DOCKER_COMPOSE_VERSION" ] - then - echo "Versions match. No need to install docker-compose. Exiting." - exit 0 - fi -fi - -echo "UNMET DEP: Installing docker-compose" - -DC_CMD="${HOME}/bin/docker-compose" - -mkdir -p "${HOME}/bin" - -curl -sSLo "${DC_CMD}" "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -chmod +x "${DC_CMD}" diff --git a/.go-version b/.go-version index 95393fc7d..20538953a 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.20.8 +1.20.9 diff --git a/.golangci.yml b/.golangci.yml index d032cd82f..de63b9f70 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -3,7 +3,7 @@ run: # timeout for analysis, e.g. 30s, 5m, default is 1m timeout: 1m build-tags: integration - go: "1.20.8" + go: "1.20.9" issues: # Maximum count of issues with the same text. diff --git a/Makefile b/Makefile index d87758eda..8a8495a39 100644 --- a/Makefile +++ b/Makefile @@ -154,7 +154,7 @@ test: prepare-test-context ## - Run all tests .PHONY: test-release test-release: ## - Check that all release binaries are created - ./.ci/scripts/test-release.sh $(DEFAULT_VERSION) + ./.buildkite/scripts/test-release.sh $(DEFAULT_VERSION) .PHONY: test-unit test-unit: prepare-test-context ## - Run unit tests only diff --git a/dev-tools/e2e/kibana.yml b/dev-tools/e2e/kibana.yml index 0e691e3bf..651fc5ee8 100644 --- a/dev-tools/e2e/kibana.yml +++ b/dev-tools/e2e/kibana.yml @@ -1,14 +1,12 @@ server.name: kibana server.host: "0.0.0.0" server.ssl.enabled: false -elasticsearch.hosts: [ "http://elasticsearch:9200" ] +elasticsearch.hosts: ["http://elasticsearch:9200"] elasticsearch.serviceAccountToken: "${KIBANA_TOKEN}" - xpack.securitySolution.packagerTaskInterval: 1s xpack.fleet.agents.enabled: true xpack.fleet.agents.fleet_server.hosts: ["https://fleet-server:8220"] -xpack.fleet.agents.elasticsearch.hosts: ["http://elasticsearch:9200"] xpack.fleet.packages: - name: elastic_agent version: latest @@ -40,6 +38,6 @@ xpack.fleet.outputs: - id: fleet-default-output name: default type: elasticsearch - hosts: [ http://elasticsearch:9200 ] + hosts: [http://elasticsearch:9200] is_default: true is_default_monitoring: true diff --git a/dev-tools/e2e/wait-for-kibana.sh b/dev-tools/e2e/wait-for-kibana.sh index def9d9b09..cec895136 100755 --- a/dev-tools/e2e/wait-for-kibana.sh +++ b/dev-tools/e2e/wait-for-kibana.sh @@ -6,8 +6,16 @@ host="$1" shift cmd="$@" +REPO_ROOT=$(cd $(dirname $(readlink -f "$0"))/../.. && pwd) + + until $(curl --output /dev/null --silent --head --fail "${host}/api/status"); do + if [[ ! $(docker compose -f $REPO_ROOT/dev-tools/e2e/docker-compose.yml --env-file $REPO_ROOT/dev-tools/integration/.env ps --filter status=running -q kibana 2>/dev/null) ]]; then + echo "Kibana container is not running" + docker-compose -f $REPO_ROOT/dev-tools/e2e/docker-compose.yml --env-file $REPO_ROOT/dev-tools/integration/.env logs kibana + exit 1 + fi printf '.' sleep 1 done diff --git a/dev-tools/integration/.env b/dev-tools/integration/.env index abea95fb4..e88706a9c 100644 --- a/dev-tools/integration/.env +++ b/dev-tools/integration/.env @@ -1,4 +1,4 @@ -ELASTICSEARCH_VERSION=8.11.0-6faed5c7-SNAPSHOT +ELASTICSEARCH_VERSION=8.12.0-31787d8c-SNAPSHOT ELASTICSEARCH_USERNAME=elastic ELASTICSEARCH_PASSWORD=changeme TEST_ELASTICSEARCH_HOSTS=localhost:9200