-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: build and use temporary bastion for each vsphere CI test run (#850)
* ci: github action workflow to create vsphere bastion host * deprecate scripts that creates permanent bastion * ci: allow overriding bastion ssh port * ci: refactor scripts to create bastion host * test using airgapped bastion * ci: use temp bastion host for vsphere e2e tests * use datastore input from github action secrets * correct public key reference * update vsphre release flow to use temporary bastion * fix linter errors
- Loading branch information
Showing
12 changed files
with
180 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
#!/bin/bash | ||
set -eu | ||
# shellcheck disable=SC2001 | ||
echo "${SSH_BASTION_KEY_CONTENTS}" | sed 's/\\n/\n/g' >> vsphere-tests.pem | ||
chmod 600 vsphere-tests.pem | ||
|
||
SSH_BASTION_HOST="$("${TERRAFORM_BIN}" -chdir=.local/infra/vsphere output -raw bastion_node_ssh_nat_address)" | ||
export SSH_BASTION_HOST | ||
|
||
SSH_BASTION_PORT="$("${TERRAFORM_BIN}" -chdir=.local/infra/vsphere output -raw bastion_node_ssh_nat_port)" | ||
export SSH_BASTION_PORT | ||
|
||
SSH_BASTION_USERNAME="$("${TERRAFORM_BIN}" -chdir=.local/infra/vsphere output -raw bastion_node_ssh_user)" | ||
export SSH_BASTION_USERNAME | ||
|
||
"${ENVSUBST_ASSETS}"/envsubst < test/infra/vsphere/packer-vsphere-airgap.yaml.tmpl >> "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
resource "random_id" "build_id" { | ||
byte_length = 8 | ||
} | ||
module "bastion_node" { | ||
source = "github.com/mesosphere/vcenter-tools/modules/vmclone" | ||
|
||
node_name = "konvoy-image-builder-bastion-${random_id.build_id.hex}" | ||
ssh_public_key = file(var.ssh_public_key) | ||
|
||
datastore_name = var.datastore_name | ||
datastore_is_cluster = false | ||
vm_template_name = var.bastion_base_template | ||
resource_pool_name = var.resource_pool_name | ||
root_volume_size = var.root_volume_size #80 | ||
vsphere_folder = var.vsphere_folder | ||
ssh_user = var.ssh_user | ||
custom_attribute_owner = var.bastion_owner | ||
custom_attribute_expiration = "4h" | ||
vsphere_network = var.vsphere_network | ||
} | ||
|
||
output "bastion_node_ssh_user" { | ||
value = var.ssh_user | ||
} | ||
|
||
output "bastion_node_ssh_nat_address" { | ||
value = module.bastion_node.nat_address | ||
} | ||
|
||
output "bastion_node_ssh_nat_port" { | ||
value = module.bastion_node.nat_ssh_port | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.