GithubHelp home page GithubHelp logo

poc-packer-win2016-jenkins-slave's Introduction

An Amazon EC2 Windows build slave provisioned using Packer.

This project has two main features:

  • pre-provisioning of common build tools using Packer
  • the Jenkins swarm plugin and a launch script for slaves to auto-register with the Jenkins master.

Usage

Building AMIs

$ REPO=`git remote get-url origin` \
  SHA=`git log -n 1 --format=%h` \
  packer build \
  -var='region=us-east-1' \
  -var='instance_type=m4.large' \
  -var-file=./aws_secret.json \
  template.json

packer verify before you build.

See template.json for the list of variables needed.

Launching instances

The slaves are provisioned with a startup script (scripts/start_slave.ps1) which can be called as user data, e.g.:

aws ec2 run-instances \
    --image-id $AMIID \
...
    --user-data "<powershell>& C:\start_slave.ps1 -master_private_ip <ip_here> -label sensei_build</powershell><persist>true</persist>" \
    --query "Instances[*].InstanceId"

Use the script launch_slaves.sh to ensure that the slaves are in the same subnet and security groups as the Jenkins master.

Connectivity and auto-registration

Jenkins will need to be configured specifically for slaves to auto-register. See https://stackoverflow.com/questions/32886262/jenkins-swarm-plugin-authentication.

Todo

  • Fix tags (ref template.json "tags") - should be more sensible

Refs

Builds on work from Vincent Rivellino and Peter Goodman, see http://blog.petegoo.com/2016/05/10/packer-aws-windows/.

poc-packer-win2016-jenkins-slave's People

Contributors

jzohrab avatar petegoo avatar

Watchers

James Cloos avatar  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.