Sign inSign up

doughoke/packer-resource-gce

By doughoke

•Updated over 5 years ago

A concourse packer resource for gce only.

Image
0

1.6K

doughoke/packer-resource-gce repository overview

⁠concourse_resource_packer_gce

⁠Packer Build Resource for GCP based GCE

A Concourse CI resource to build new Google Compute Images (Image) via Packer⁠

This is spawned from

⁠Source Configurations

  • project (optional string): The project name the image is in (should be used when the account may not have permission to the default parent account)
  • region (required string): The GCP region to work in
  • credentials (required string): for GCP account
  • family (optional string): used for check if you are triggering against an image family
  • debug (optional string): defaults to false

⁠Behaviour

⁠check: Check for new versions of a GCP Image

Returns an ordered list of versions that match the criteria specified in the source. This can be used to trigger a new build when a new version of a GCE Image is created.

⁠in: Get metadata about an GCP Image

Provides 3 files:

  • version.txt - a text file containing the selected Image Name
  • version.json - a JSON file containing the selected Image Name in the image field of the json parent version
  • image.json - the GCE metadata⁠ for the selected Image
⁠out: Build a new GCP Image
⁠Parameters

All other parameters will be passed through to packer as variables.

** source.project will not be read by out process only in and check. 'project' must be passed in the packer file or packer variable.

⁠Example

resource_types:
- name: packer-gce
  type: docker-image
  source:
    repository: doughoke/packer-resource-gce

resources:
- name: base-gce-image
  type: packer-gce
  source:
    region: us-central1a
    credentials: (gce_json_key)
    family: centos

- name: created-image
  type: packer-gce
  source:
    region: us-central1a
    credentials: (gce_json_key)
    project: your-project

- name: my-packer-template-source
  type: git
  source:
    uri: https://github.com/packdemo/packergce

jobs:
- name: sample-gce-image
  plan:
  - get: my-packer-template-source
    trigger: true
  - get: base-gce-image
    trigger: true
  - put: created-image
    params:
      template: my-packer-template-source/packer_template.json
      var_file:
        - base-gce-image/version.json
        - my-packer-template-source/packer_params.json

Tag summary

Content type

Image

Digest

Size

166.8 MB

Last updated

over 5 years ago

docker pull doughoke/packer-resource-gce