blob: 2bc0641f0790f051fd65dd8f364b0b6557137c7c [file] [log] [blame]
azvyagintseve1b236a2018-07-13 16:59:49 +03001#!/bin/bash
2
3# pre-requirments:
4# apt-get install cloud-localds
5# Cloudimg: wget https://cloud-images.ubuntu.com/trusty/XXXX/trusty-server-cloudimg-amd64-disk1.img
6# Packer: https://releases.hashicorp.com/packer/1.1.3/packer_1.1.3_linux_amd64.zip
7
8# Those script - only example for variables, which should be passed to packer and
9# overwrite variables under /scripts/ directory
10
11# External script sources:
12# http/bootstrap.saltstack.com.sh https://github.com/saltstack/salt-bootstrap
13#
14export IMAGE_NAME="ubuntu-14-04-x64"
15export UBUNTU_BASEURL="http://mirror.mirantis.com/proposed/ubuntu/"
16export SALTSTACK_REPO="deb [arch=amd64] http://mirror.mirantis.com/proposed/saltstack-2017.7/trusty trusty main"
17export SALTSTACK_GPG="http://mirror.mirantis.com/proposed/saltstack-2017.7/trusty/SALTSTACK-GPG-KEY.pub"
18###
19# Hard-coded folder in template
20export PACKER_IMAGES_CACHE="${HOME}/packer_images_cache/"
21mkdir -p "${PACKER_IMAGES_CACHE}"
22
23export PACKER_LOG=1
24# For qemu test-build:
25cloud-localds --hostname ubuntu --dsmode local config-drive/cloudata.iso config-drive/user-data.yaml
26packer build -only=qemu -parallel=false -on-error=ask template.json
27#rm -rf ~/.packer.d/
28