blob: 7341ce7cb6d491c2e96ceb31d1bcc94f92a73b72 [file] [log] [blame]
azvyagintsev0f697cf2018-06-22 11:44:13 +03001#!/bin/bash
2
3# pre-requirments:
4# apt-get install cloud-localds
5# Cloudimg: wget https://cloud-images.ubuntu.com/xenial/XXXX/xenial-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-16-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/xenial xenial main"
azvyagintsevdd137842018-07-13 18:13:06 +030017export SALTSTACK_GPG="https://mirror.mirantis.com/proposed/saltstack-2017.7/trusty/SALTSTACK-GPG-KEY.pub"
azvyagintsev0f697cf2018-06-22 11:44:13 +030018###
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:
azvyagintsev045d9e52018-12-05 14:24:36 +020025[ -f config-drive/cloudata.iso ] && rm -v config-drive/cloudata.iso
26mkisofs -o config-drive/cloudata.iso -V cidata -r -J --quiet config-drive
27# For qemu test-build:
azvyagintseve052fbe2018-12-13 22:08:32 +020028packer build -machine-readable -only=qemu -parallel=false -on-error=ask template.json
azvyagintsev0f697cf2018-06-22 11:44:13 +030029#rm -rf ~/.packer.d/
30