#!/bin/sh # # vm-create - create VM images to run Jenkins and workers # # Copyright 2012, 2013 Lars Wirzenius # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -eux PATH="$PATH:/home/liw/vmdebootstrap/vmdebootstrap" VMTMP="/big/scratch/jenkinstool-images-new" # Create the SSH host and user keys. for key in jenkins.host-key jenkins.user-key worker.host-key worker.user-key do filename="vm-data/$key" if [ ! -e "$filename" ] then ssh-keygen -q -f "$filename" -N '' fi done # Create the images for flavor in \ jenkins \ wheezy-amd64 wheezy-i386 \ sid-amd64 sid-i386 do conf="vm-data/$flavor.conf" img="$VMTMP/$flavor.img" if [ ! -e "$img" ] then vmdebootstrap \ --config vm-data/common.conf --config "$conf" \ --image "$img" "$@" fi done