open-vault/enos/modules/build_local/main.tf
hc-github-team-secure-vault-core be67c16299
backport of commit 8d22142a3e9d13435b1a65685317fefba7e2f5b3 (#21421)
Co-authored-by: Ryan Cragun <me@ryan.ec>
2023-06-22 22:14:22 +00:00

70 lines
1.3 KiB
HCL

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
terraform {
required_providers {
enos = {
source = "app.terraform.io/hashicorp-qti/enos"
}
}
}
variable "bundle_path" {
type = string
default = "/tmp/vault.zip"
}
variable "build_tags" {
type = list(string)
description = "The build tags to pass to the Go compiler"
}
variable "goarch" {
type = string
description = "The Go architecture target"
default = "amd64"
}
variable "goos" {
type = string
description = "The Go OS target"
default = "linux"
}
variable "artifactory_host" { default = null }
variable "artifactory_repo" { default = null }
variable "artifactory_username" { default = null }
variable "artifactory_token" { default = null }
variable "arch" {
default = null
}
variable "artifact_path" {
default = null
}
variable "artifact_type" {
default = null
}
variable "distro" {
default = null
}
variable "edition" {
default = null
}
variable "revision" {
default = null
}
variable "product_version" {
default = null
}
resource "enos_local_exec" "build" {
scripts = [abspath("${path.module}/scripts/build.sh")]
environment = {
BUNDLE_PATH = var.bundle_path,
GO_TAGS = join(" ", var.build_tags)
GOARCH = var.goarch
GOOS = var.goos
}
}