Skip to content

Commit

Permalink
func: start with the module to provision a cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
Juanadelacuesta committed Dec 3, 2024
1 parent fb789a2 commit 8295814
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 64 deletions.
4 changes: 4 additions & 0 deletions enos/enos-modules.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
module "build_artifactory" {
source = "./modules/fetch_artifactory"
}

module "provision_cluster" {
source = "../e2e/terraform"
}
43 changes: 0 additions & 43 deletions enos/enos-quality-upgrade.hcl

This file was deleted.

31 changes: 18 additions & 13 deletions enos/enos-scenario-upgrade.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,39 @@ scenario "upgrade" {

matrix {
arch = ["amd64", "arm64"]
//service_discovery = ["consul", "nomad"]
distro = ["alpine", "fedora", "rhel", "ubuntu"]
service_discovery = ["consul", "nomad"]
editions = ["ce", "ent"]
os = ["linux", "darwin", "windows"]
os = ["linux", "windows"]

exclude {
os = ["windows"]
arch = ["arm64"]
}
}

step "copy_binary" {
description = <<-EOF
Determine which Nomad artifact we want to use for the scenario, depending on the
'arch', 'distro' and 'os'
'arch', 'edition' and 'os'
EOF
module = module.build_artifactory

variables {
version = global.initial_version
artifactory_path = globals.artifact_path
artifact_token = globals.artifact_token
os = matrix.os
distro = matrix.os != "linux" ? var.distro : null
local_path = var.binary_local_path
artifactory_username = var.artifactory_username
artifactory_token = var.artifact_token
arch = matrix.arch
edition = matrix.edition
product_version = var.product_version
os = matrix.os
local_path = var.binary_local_path
}
}
/*

step "provision_cluster" {
description = <<-EOF
Using the binary from the previous step, provision a Nomad cluster using the e2e
EOF
module = "build_${matrix.os}_${matrix.distro}"
module = module.

variables {
name
Expand All @@ -47,7 +52,7 @@ scenario "upgrade" {
// ...
}
}
/*
step "run_new_workloads" {
description = <<-EOF
Verify the health of the cluster by running new workloads and stopping random allocs
Expand Down
8 changes: 0 additions & 8 deletions enos/enos-vars.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,18 @@ variable "artifactory_token" {
variable "artifactory_host" {
type = string
description = "The artifactory host to search for Nomad artifacts"
default = "https://artifactory.hashicorp.engineering/artifactory"
}

variable "artifactory_repo" {
type = string
description = "The artifactory repo to search for Nomad artifacts"
default = "hashicorp-crt-stable-local*"
}

variable "edition" {
type = string
description = "The edition of the binary to search, it can be either CE or ENT"
}

variable "revision" {
type = string
description = "The specific commit of the binary"
}

variable "os" {
type = string
description = "The operative system the binary is needed for"
Expand All @@ -57,5 +50,4 @@ variable "arch" {
variable "binary_path" {
description = "The path to donwload and unzip the binary"
type = string
default = "/home/ubuntu/nomad"
}

0 comments on commit 8295814

Please sign in to comment.