Skip to content

Commit

Permalink
updated pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
oakrizan committed Mar 20, 2024
1 parent 6ef7c42 commit d9aa098
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 8 deletions.
51 changes: 48 additions & 3 deletions .buildkite/deploy/kubernetes/deploy-k8s-pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,58 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json

env:
IMAGE_UBUNTU_X86_64: "family/platform-ingest-beats-ubuntu-2204"
GCP_HI_PERF_MACHINE_TYPE: "c2d-highcpu-16"
KIND_VERSION: "v0.20.0"
K8S_VERSION": "v1.29.0"
KUBECONFIG: "${WORKSPACE}/kubecfg"

steps:
- label: "Checks"
command: echo "Hello!"
command: ".buildkite/deploy/kubernetes/scripts/make.sh"
if: build.env("BUILDKITE_PULL_REQUEST") != "false" && build.env("GITHUB_PR_LABELS") = "kubernetes"
notify:
- github_commit_status:
context: "Deploy K8S/Checks"
agents:
provider: "gcp"
image: "family/platform-ingest-beats-ubuntu-2204"
# "K8S_VERSION=${v}"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_HI_PERF_MACHINE_TYPE}"

- label: "K8S Test"
env:
k8sTest: "v1.29.0,v1.28.0,v1.27.3,v1.26.6"
command:
- ".buildkite/deploy/kubernetes/scripts/setup-k8s-env.sh"
- "MODULE=kubernetes make -C metricbeat integration-tests"


# setEnvVar('ONLY_DOCS', isGitRegionMatch(patterns: [ '(.*\\.(asciidoc|md)|deploy/kubernetes/.*-kubernetes\\.yaml)' ], shouldMatchAll: true).toString())

# def withK8s(Closure body) {
# withEnv(["KUBECONFIG=${env.WORKSPACE}/kubecfg"]){
# retryWithSleep(retries: 2, seconds: 5, backoff: true){ sh(label: "Install kind", script: ".ci/scripts/install-kind.sh") }
# retryWithSleep(retries: 2, seconds: 5, backoff: true){ sh(label: "Install kubectl", script: ".ci/scripts/install-kubectl.sh") }
# try {
# // Add some environmental resilience when setup does not work the very first time.
# def i = 0
# retryWithSleep(retries: 3, seconds: 5, backoff: true){
# try {
# sh(label: "Setup kind", script: ".ci/scripts/kind-setup.sh")
# } catch(err) {
# i++
# sh(label: 'Delete cluster', script: 'kind delete cluster')
# if (i > 2) {
# error("Setup kind failed with error '${err.toString()}'")
# }
# }
# }
# body()
# } finally {
# sh(label: 'Delete cluster', script: 'kind delete cluster')
# }
# }
# }

#sh(label: "Integration tests", script: "MODULE=kubernetes make -C metricbeat integration-tests")
#sh(label: "Deploy to kubernetes",script: "make -C deploy/kubernetes test")
Empty file modified .buildkite/deploy/kubernetes/scripts/install-kind.sh
100644 → 100755
Empty file.
Empty file modified .buildkite/deploy/kubernetes/scripts/install-kubectl.sh
100644 → 100755
Empty file.
Empty file modified .buildkite/deploy/kubernetes/scripts/kind-setup.sh
100644 → 100755
Empty file.
Empty file modified .buildkite/deploy/kubernetes/scripts/make.sh
100644 → 100755
Empty file.
10 changes: 5 additions & 5 deletions .buildkite/deploy/kubernetes/scripts/setup-k8s-env.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ set -euo pipefail

source .buildkite/env-scripts/util.sh

echo ":: Starting K8S Setup ::"
echo "--- Starting K8S Setup"

echo ":: Install kind ::"
retry .buildkite/deploy/kubernetes/scripts/install-kind.sh
retry .buildkite/deploy/kubernetes/scripts/install-kubectl.sh
echo "--- Installing kind"
retry_with_count .buildkite/deploy/kubernetes/scripts/install-kind.sh
retry_with_count .buildkite/deploy/kubernetes/scripts/install-kubectl.sh

echo ":: Setup kind ::"
echo "--- Setting up kind"
max_retries=3
timeout=5
retries=0
Expand Down

0 comments on commit d9aa098

Please sign in to comment.