packer-cn/builder/googlecompute
Scott Crunkleton b54b82d3ac Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes:
- 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
2016-09-09 16:22:50 -07:00
..
account.go Created googlecompute-export post-processor. Modified the googlecompute builder to pass a few configuration values to its resulting artifact. These values can then be used in googlecompute-export post-processor. 2016-08-15 14:36:26 -07:00
artifact.go Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes: 2016-09-09 16:22:50 -07:00
artifact_test.go builder/googlecompute: artifact tests 2013-12-13 19:08:27 -08:00
builder.go Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes: 2016-09-09 16:22:50 -07:00
builder_test.go Use the same license as Packer core 2013-12-12 21:53:04 -08:00
common.go Adding support for googlecompute startup scripts. 2016-07-20 14:54:36 -07:00
common_test.go Adding support for googlecompute startup scripts. 2016-07-20 14:54:36 -07:00
config.go Created googlecompute-export post-processor. Modified the googlecompute builder to pass a few configuration values to its resulting artifact. These values can then be used in googlecompute-export post-processor. 2016-08-15 14:36:26 -07:00
config_test.go builder/googlecompute: validate image_family 2016-05-13 15:24:02 -07:00
driver.go Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes: 2016-09-09 16:22:50 -07:00
driver_gce.go Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes: 2016-09-09 16:22:50 -07:00
driver_mock.go Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes: 2016-09-09 16:22:50 -07:00
image.go Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes: 2016-09-09 16:22:50 -07:00
image_test.go Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes: 2016-09-09 16:22:50 -07:00
private_key.go builder/googlecompute: fix all sorts of zone issues 2013-12-12 22:23:19 -08:00
private_key_test.go builder/googlecompute: private key tests 2013-12-12 21:53:04 -08:00
ssh.go helper/communicator: make host more generic 2015-06-13 19:23:33 -04:00
startup.go Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes: 2016-09-09 16:22:50 -07:00
step_check_existing_image.go Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes: 2016-09-09 16:22:50 -07:00
step_check_existing_image_test.go Check if image already exists before doing anything else on GCE. 2014-12-09 08:42:34 -08:00
step_create_image.go Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes: 2016-09-09 16:22:50 -07:00
step_create_image_test.go Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes: 2016-09-09 16:22:50 -07:00
step_create_instance.go Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes: 2016-09-09 16:22:50 -07:00
step_create_instance_test.go Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes: 2016-09-09 16:22:50 -07:00
step_create_ssh_key.go Adding support for googlecompute startup scripts. 2016-07-20 14:54:36 -07:00
step_create_ssh_key_test.go builder/googlecompute: tests for #867 2014-02-21 15:10:09 -08:00
step_instance_info.go Adding support for googlecompute startup scripts. 2016-07-20 14:54:36 -07:00
step_instance_info_test.go Adds support for using the internal IP rather than NAT IP in GCE 2015-05-29 14:50:11 -07:00
step_teardown_instance.go Created googlecompute-export post-processor. Modified the googlecompute builder to pass a few configuration values to its resulting artifact. These values can then be used in googlecompute-export post-processor. 2016-08-15 14:36:26 -07:00
step_teardown_instance_test.go builder/googlecompute: fix formatting directives 2015-02-25 05:29:53 +01:00
step_test.go Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes: 2016-09-09 16:22:50 -07:00
step_wait_instance_startup.go Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes: 2016-09-09 16:22:50 -07:00
step_wait_instance_startup_test.go Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes: 2016-09-09 16:22:50 -07:00