mirror of
https://github.com/hashicorp/packer.git
synced 2026-03-09 09:52:29 -04:00
- startup scripts don't run for Windows since it is isn't implemented yet.
- startup scripts use instance metadata instead of serial port output to flag when they are done.
- added licenses to Image data type (to check if an Image is a Windows Image).
- added GetImage and GetImageFromProject to googlecompute Drivers.
- changed some of the builder/googlecompute tests to use github.com/stretchr/testify/assert.
Tests:
- (in the Packer directory) `go test .`, `go test ./builder/googlecompute`, and `go test ./post-processor/googlecompute-export`
- manual run of `packer build packer_template.json` with the following files
--packer_template.json--
{
"builders": [
{
"type": "googlecompute",
"account_file": "creds.json",
"project_id": "google.com:packer-test",
"source_image": "debian-8-jessie-v20160629",
"zone": "us-central1-a",
"startup_script_file": "startup_script.sh",
"metadata": {
"startup-script": "#!/bin/sh\necho \"This should be overwritten.\"",
"startup-script-log-dest": "gs://packer-test.google.com.a.appspot.com/startup-script.log"
},
"image_name": "test-packer-modifications",
"ssh_username": "foo"
}
],
"post-processors": [
{
"type": "googlecompute-export",
"paths": [
"gs://packer-test.google.com.a.appspot.com/foo.tar.gz",
"gs://packer-test.google.com.a.appspot.com/bar.tar.gz"
],
"keep_input_artifact": true
}
]
}
--startup_script.sh--
\#!/bin/sh
echo "Hi, my name is Scott. I'm waiting 60 seconds!" >> /scott
sleep 60
echo "I'm done waiting!" >> /scott
|
||
|---|---|---|
| .. | ||
| account.go | ||
| artifact.go | ||
| artifact_test.go | ||
| builder.go | ||
| builder_test.go | ||
| common.go | ||
| common_test.go | ||
| config.go | ||
| config_test.go | ||
| driver.go | ||
| driver_gce.go | ||
| driver_mock.go | ||
| image.go | ||
| image_test.go | ||
| private_key.go | ||
| private_key_test.go | ||
| ssh.go | ||
| startup.go | ||
| step_check_existing_image.go | ||
| step_check_existing_image_test.go | ||
| step_create_image.go | ||
| step_create_image_test.go | ||
| step_create_instance.go | ||
| step_create_instance_test.go | ||
| step_create_ssh_key.go | ||
| step_create_ssh_key_test.go | ||
| step_instance_info.go | ||
| step_instance_info_test.go | ||
| step_teardown_instance.go | ||
| step_teardown_instance_test.go | ||
| step_test.go | ||
| step_wait_instance_startup.go | ||
| step_wait_instance_startup_test.go | ||