Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update packer conf to HCL from JSON and update bazel version used in CI
- Loading branch information
1 parent
e0ef252
commit b997e12
Showing
5 changed files
with
105 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
4.1.0 |
23 changes: 0 additions & 23 deletions
23
infrastructure/aws/ami/continuous_integration/packer-conf.json
This file was deleted.
Oops, something went wrong.
63 changes: 63 additions & 0 deletions
63
infrastructure/aws/ami/continuous_integration/packer-conf.pkr.hcl
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,63 @@ | ||
# This file was autogenerated by the 'packer hcl2_upgrade' command. We | ||
# recommend double checking that everything is correct before going forward. We | ||
# also recommend treating this file as disposable. The HCL2 blocks in this | ||
# file can be moved to other files. For example, the variable blocks could be | ||
# moved to their own 'variables.pkr.hcl' file, etc. Those files need to be | ||
# suffixed with '.pkr.hcl' to be visible to Packer. To use multiple files at | ||
# once they also need to be in the same folder. 'packer inspect folder/' | ||
# will describe to you what is in that folder. | ||
|
||
# Avoid mixing go templating calls ( for example ```{{ upper(`string`) }}``` ) | ||
# and HCL2 calls (for example '${ var.string_value_example }' ). They won't be | ||
# executed together and the outcome will be unknown. | ||
|
||
# All generated input variables will be of 'string' type as this is how Packer JSON | ||
# views them; you can change their type later on. Read the variables type | ||
# constraints documentation | ||
# https://www.packer.io/docs/templates/hcl_templates/variables#type-constraints for more info. | ||
variable "aws_access_key" { | ||
type = string | ||
} | ||
|
||
variable "aws_secret_key" { | ||
type = string | ||
} | ||
|
||
variable "bazel_version" { | ||
type = string | ||
} | ||
|
||
variable "region" { | ||
type = string | ||
default = "us-east-2" | ||
} | ||
|
||
# "timestamp" template function replacement | ||
locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") } | ||
|
||
# source blocks are generated from your builders; a source can be referenced in | ||
# build blocks. A build block runs provisioner and post-processors on a | ||
# source. Read the documentation for source blocks here: | ||
# https://www.packer.io/docs/templates/hcl_templates/blocks/source | ||
source "amazon-ebs" "autogenerated_1" { | ||
access_key = "${var.aws_access_key}" | ||
ami_name = "continuous-integration ${local.timestamp}" | ||
instance_type = "t2.small" | ||
region = "us-east-2" | ||
secret_key = "${var.aws_secret_key}" | ||
source_ami = "ami-05512b79a46f1fabb" | ||
ssh_username = "ec2-user" | ||
} | ||
|
||
# a build block invokes sources and runs provisioning steps on them. The | ||
# documentation for build blocks can be found here: | ||
# https://www.packer.io/docs/templates/hcl_templates/blocks/build | ||
build { | ||
sources = ["source.amazon-ebs.autogenerated_1"] | ||
|
||
provisioner "shell" { | ||
environment_vars = [format("BAZEL_VERSION=%s", var.bazel_version)] | ||
script = "./prepare.sh" | ||
} | ||
|
||
} |
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