GithubHelp home page GithubHelp logo

bhanditz / packer-post-processor-teamcity Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jetbrains-infra/packer-post-processor-teamcity

0.0 2.0 0.0 193 KB

Publish IDs of generated images as a build parameters

License: Mozilla Public License 2.0

Shell 7.72% Go 92.28%

packer-post-processor-teamcity's Introduction

Packer Post-Processor for TeamСity

HashiCorp Packer generates image IDs, like ami-387dc380. When creating a build chain with separate configurations for building, testing, and deploying images, we need to reference their IDs.

This is a Packer plugin, which saves the generated image IDs as parameters in the build history: packer.artifact.id

Packer can run multiple builders in parallel, so a single build can produce several artifacts. Custom builder names can be used to distinguish them.

For AMIs in AWS, there is a special format, two parameters are published for each artifact: packer.artifact.aws.ami and packer.artifact.aws.region

Now dependent build configurations can reference these parameters and resolve the image IDs dynamically: reference

Usage

  1. Download the binaries from the Releases page.
  2. Install the plugin on build agents.
  3. Add the TeamCity post-processor to Packer configurations:
{
  "builders": [
    {
      "name":"agent",
      "type": "amazon-ebs",
      
      .......
    }
  ],
  "post-processors": [
    "teamcity"
  ]
}

Register TeamCity Cloud Agent Images

Optionally the plugin can be used to deploy new versions of TeamCity cloud agents: after the images are created Packer registrs them in cloud agent profiles on TeamCity server:

This feature works with vSphere only. See #3
{
  "builders": [
    {
      "name": "agent",
      .......
    }
  ],
  "post-processors": [
    {
      "type": "teamcity",
      "teamcity_url": "https://teamcity.local",
      "username": "admin",
      "password": "secret",
      "project_id": "_Root",
      "custom_image_name": "{{build_name}}",
      "agent_name": "{{build_name}}-{{user `build_number`}}"
    }
  ]
}

packer-post-processor-teamcity's People

Contributors

mkuzmin avatar lizatretyakova avatar julia-alexandrova avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.