diff --git a/.buildkite/pipeline.publish.yml b/.buildkite/pipeline.publish.yml index ba49e5edda14..b9239a83dc39 100644 --- a/.buildkite/pipeline.publish.yml +++ b/.buildkite/pipeline.publish.yml @@ -37,7 +37,7 @@ steps: memory: "8G" env: ARTIFACTS_FOLDER: "artifacts-to-sign" - DRY_RUN: "true" + DRY_RUN: "${DRY_RUN}" depends_on: - step: "check" allow_failure: false diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index df3e5f0c7788..74249460f6bd 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -29,57 +29,66 @@ steps: cpu: "8" memory: "4G" - - label: ":package: Build packages" - key: "build-packages" - command: ".buildkite/scripts/build_packages.sh" - agents: - image: "${LINUX_AGENT_IMAGE}" - cpu: "8" - memory: "8G" - env: - ARTIFACTS_FOLDER: "artifacts-to-sign" - DRY_RUN: "false" - depends_on: - - step: "check" - allow_failure: false - artifact_paths: - - artifacts-to-sign/*.zip - - - label: "Trigger integrations" - key: "test-integrations" - command: ".buildkite/scripts/trigger_integrations_in_parallel.sh" - env: - UPLOAD_SAFE_LOGS: 1 - depends_on: - - step: "check" - allow_failure: false - - - wait: ~ - continue_on_failure: true - - - label: "Publish benchmarks" - key: publish-benchmarks - command: ".buildkite/scripts/process_benchmarks.sh" - env: - BENCHMARK_THRESHOLD: 15 - agents: - image: "${LINUX_AGENT_IMAGE}" - cpu: "8" - memory: "4G" + # - label: ":package: Build packages" + # key: "build-packages" + # command: ".buildkite/scripts/build_packages.sh" + # agents: + # image: "${LINUX_AGENT_IMAGE}" + # cpu: "8" + # memory: "8G" + # env: + # ARTIFACTS_FOLDER: "artifacts-to-sign" + # DRY_RUN: "false" + # depends_on: + # - step: "check" + # allow_failure: false + # artifact_paths: + # - artifacts-to-sign/*.zip + - label: ":package: test pipeline" + key: test-build-package + trigger: "integrations-publish" + build: + env: + DRY_RUN: "true" + BUILDKITE_REFSPEC: "refs/pull/${BUILDKITE_PULL_REQUEST}/merge" + BUILDKITE_COMMIT: "${BUILDKITE_COMMIT}" - - label: ":sonarqube: Continuous Code Inspection" - env: - VAULT_SONAR_TOKEN_PATH: "kv/ci-shared/platform-ingest/elastic/integrations/sonar-analyze-token" - agents: - image: "docker.elastic.co/cloud-ci/sonarqube/buildkite-scanner:latest" - command: ".buildkite/scripts/run_sonar_scanner.sh" - artifact_paths: - - build/test-coverage/coverage_merged.xml - - label: ":junit: Junit annotate" - plugins: - - junit-annotate#v2.4.1: - artifacts: "build/test-results/*.xml" - failed-download-exit-code: 0 # Not fail the build in case there are no XML files - agents: - provider: "gcp" # junit plugin requires docker + # - label: "Trigger integrations" + # key: "test-integrations" + # command: ".buildkite/scripts/trigger_integrations_in_parallel.sh" + # env: + # UPLOAD_SAFE_LOGS: 1 + # depends_on: + # - step: "check" + # allow_failure: false + # + # - wait: ~ + # continue_on_failure: true + # + # - label: "Publish benchmarks" + # key: publish-benchmarks + # command: ".buildkite/scripts/process_benchmarks.sh" + # env: + # BENCHMARK_THRESHOLD: 15 + # agents: + # image: "${LINUX_AGENT_IMAGE}" + # cpu: "8" + # memory: "4G" + # + # - label: ":sonarqube: Continuous Code Inspection" + # env: + # VAULT_SONAR_TOKEN_PATH: "kv/ci-shared/platform-ingest/elastic/integrations/sonar-analyze-token" + # agents: + # image: "docker.elastic.co/cloud-ci/sonarqube/buildkite-scanner:latest" + # command: ".buildkite/scripts/run_sonar_scanner.sh" + # artifact_paths: + # - build/test-coverage/coverage_merged.xml + # + # - label: ":junit: Junit annotate" + # plugins: + # - junit-annotate#v2.4.1: + # artifacts: "build/test-results/*.xml" + # failed-download-exit-code: 0 # Not fail the build in case there are no XML files + # agents: + # provider: "gcp" # junit plugin requires docker diff --git a/.buildkite/scripts/build_packages.sh b/.buildkite/scripts/build_packages.sh index 3de198335acb..cd1ca8180c2b 100644 --- a/.buildkite/scripts/build_packages.sh +++ b/.buildkite/scripts/build_packages.sh @@ -64,11 +64,13 @@ build_packages() { local package_zip="${name}-${version}.zip" + if [[ "${package_zip}" != "elastic_package_registry-0.2.0.zip" ]]; then if is_already_published "${package_zip}" ; then echo "Skipping. ${package_zip} already published" popd > /dev/null continue fi + fi echo "Build package as zip: ${package}" if check_and_build_package "${package}" ; then @@ -97,6 +99,7 @@ with_yq with_go use_elastic_package +echo "--- Testing on PR" echo "--- Build packages" if [[ "$BUILDKITE_RETRY_COUNT" != "0" ]]; then @@ -115,10 +118,10 @@ cd "${WORKSPACE}" || exit 1 mkdir -p "${ARTIFACTS_FOLDER}" cp "${BUILD_PACKAGES_FOLDER}"/*.zip "${ARTIFACTS_FOLDER}"/ -if [ "${DRY_RUN}" == "true" ]; then - echo "DRY_RUN enabled. Publish packages steps skipped." - exit 0 -fi +# if [ "${DRY_RUN}" == "true" ]; then +# echo "DRY_RUN enabled. Publish packages steps skipped." +# exit 0 +# fi # triggering dynamically the steps for signing and publishing # allow us to check whether or not this group of steps needs to be run in one script @@ -148,7 +151,7 @@ steps: env: SIGNING_STEP_KEY: "sign-service" ARTIFACTS_FOLDER: "packageArtifacts" - DRY_RUN: "${DRY_RUN}" + DRY_RUN: "true" agents: image: "${LINUX_AGENT_IMAGE}" cpu: "8"