Skip to content

Commit

Permalink
Merge branch 'main' into updatecli_bump-elastic-stack-snapshot-main
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jul 25, 2023
2 parents 7e5115c + 7b05dd1 commit c2fd370
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .buildkite/pipeline.package.mbp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ steps:
command: ".buildkite/scripts/package.sh {{matrix.type}}"
agents:
provider: "aws"
image: "${IMAGE_UBUNTU_ARM_64}"
imagePrefix: "${IMAGE_UBUNTU_ARM_64}"
instanceType: "t4g.medium"
matrix:
setup:
type:
Expand Down
12 changes: 7 additions & 5 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json

env:
SETUP_GVM_VERSION: 'v0.5.0'
DOCKER_COMPOSE_VERSION: '1.25.5'
SETUP_GVM_VERSION: "v0.5.0"
DOCKER_COMPOSE_VERSION: "1.25.5"
DOCKER_REGISTRY: "docker.elastic.co"
DOCKER_IMAGE: "${DOCKER_REGISTRY}/observability-ci/fleet-server" # needs to rename for rollback
DOCKER_IMAGE_SHA_TAG: "git-${BUILDKITE_COMMIT:0:12}" # needs to rename for rollback, should be "git-${BUILDKITE_COMMIT:0:12}"
DOCKER_IMAGE_LATEST_TAG: "latest" # needs to rename for rollback
DOCKER_IMAGE_GIT_TAG: "${BUILDKITE_BRANCH}" # needs to rename for rollback
GO_AGENT_IMAGE: "golang:${GO_VERSION}"
TERRAFORM_VERSION: '1.4.6'
TERRAFORM_VERSION: "1.4.6"

steps:
- group: "Check and build"
Expand Down Expand Up @@ -90,7 +90,7 @@ steps:
- label: ":docker: Publish docker image"
key: "publish"
command: ".buildkite/scripts/build_push_docker_image.sh"
if: "build.env('BUILDKITE_PULL_REQUEST') == '' && build.env('BUILDKITE_BRANCH') == 'main'"
if: "build.env('BUILDKITE_PULL_REQUEST') == 'false' && build.env('BUILDKITE_BRANCH') == 'main'"
agents:
provider: "gcp"
depends_on:
Expand All @@ -105,6 +105,8 @@ steps:
env:
SERVICE_COMMIT_HASH: ${BUILDKITE_COMMIT:0:12}
REMOTE_SERVICE_CONFIG: https://raw.githubusercontent.com/elastic/serverless-gitops/main/gen/gpctl/fleet/config.yaml
depends_on:
- step: "publish"

- label: ":gcloud: Release test"
key: "release-test"
Expand All @@ -130,7 +132,7 @@ steps:
- trigger: "fleet-server-package-mbp"
label: ":esbuild: Downstream - Package"
key: "downstream-package"
if: "build.env('BUILDKITE_BRANCH') != '' && build.env('BUILDKITE_TAG') == '' && build.env('BUILDKITE_PULL_REQUEST') == ''"
if: "build.env('BUILDKITE_BRANCH') != '' && build.env('BUILDKITE_TAG') == '' && build.env('BUILDKITE_PULL_REQUEST') == ''"
depends_on:
- step: "release-package-registry"
allow_failure: false
29 changes: 26 additions & 3 deletions .buildkite/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ set -euo pipefail
WORKSPACE="$(pwd)/bin"
TMP_FOLDER_TEMPLATE_BASE="tmp.fleet-server"
REPO="fleet-server"
platform_type="$(uname)"
platform_type_lowercase="${platform_type,,}"
hw_type="$(uname -m)"

check_platform_architeture() {
# for downloading the GVM and Terraform packages
case "${hw_type}" in
"x86_64")
arch_type="amd64"
;;
"aarch64")
arch_type="arm64"
;;
"arm64")
arch_type="arm64"
;;
*)
echo "The current platform/OS type is unsupported yet"
;;
esac
}

create_workspace() {
if [[ ! -d "${WORKSPACE}" ]]; then
Expand All @@ -21,7 +42,8 @@ add_bin_path() {
with_go() {
echo "Setting up the Go environment..."
create_workspace
retry 5 curl -sL -o ${WORKSPACE}/gvm "https://github.com/andrewkroh/gvm/releases/download/${SETUP_GVM_VERSION}/gvm-linux-amd64"
check_platform_architeture
retry 5 curl -sL -o ${WORKSPACE}/gvm "https://github.com/andrewkroh/gvm/releases/download/${SETUP_GVM_VERSION}/gvm-${platform_type_lowercase}-${arch_type}"
chmod +x ${WORKSPACE}/gvm
eval "$(gvm $(cat .go-version))"
go version
Expand All @@ -32,7 +54,7 @@ with_go() {
with_docker_compose() {
echo "Setting up the Docker-compose environment..."
create_workspace
retry 5 curl -SL -o ${WORKSPACE}/docker-compose "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64"
retry 5 curl -sSL -o ${WORKSPACE}/docker-compose "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-${platform_type_lowercase}-${hw_type}"
chmod +x ${WORKSPACE}/docker-compose
docker-compose version
}
Expand Down Expand Up @@ -70,7 +92,8 @@ with_Terraform() {
echo "Setting up the Terraform environment..."
local path_to_file="${WORKSPACE}/terraform.zip"
create_workspace
retry 5 curl -SL -o ${path_to_file} "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip"
check_platform_architeture
retry 5 curl -sSL -o ${path_to_file} "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_${platform_type_lowercase}_${arch_type}.zip"
unzip -q ${path_to_file} -d ${WORKSPACE}/
rm ${path_to_file}
chmod +x ${WORKSPACE}/terraform
Expand Down
4 changes: 2 additions & 2 deletions .ci/jobs/fleet-server-package-mbp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
description: Jenkins pipeline for the Elastic Fleet Server package process
project-type: multibranch
concurrent: true
# script-path: .ci/packaging.groovy
script-path: .ci/packaging.groovy
scm:
- github:
branch-discovery: no-pr
Expand All @@ -14,7 +14,7 @@
discover-pr-origin: merge-current
discover-tags: false
disable-pr-notifications: true
head-filter-regex: '(main|7\.17|8\.\d+|PR-.*)'
head-filter-regex: '(7\.17|8\.9\.\d+|PR-.*)'
notification-context: 'fleet-server-package'
repo: fleet-server
repo-owner: elastic
Expand Down
4 changes: 2 additions & 2 deletions .ci/jobs/fleet-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
description: Jenkins pipeline for the Elastic Fleet Server project
view: Beats
project-type: multibranch
# script-path: .ci/Jenkinsfile
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: '(main|7\.x|7\.1\d|8\.\d+|PR-.*|v\d+\.\d+\.\d+)'
head-filter-regex: '(7\.x|7\.1\d|8\.9\.\d+|PR-.*|v\d+\.\d+\.\d+)'
notification-context: 'fleet-server'
repo: fleet-server
repo-owner: elastic
Expand Down

0 comments on commit c2fd370

Please sign in to comment.