blob: 4694f394340bac026abdc458a3abd197df2d0798 [file] [log] [blame]
azvyagintsev9a1737f2019-03-11 15:44:54 +02001#!/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-18-04-x64"
15export MIRROR_HOSTNAME="mirror.mirantis.com"
16export MIRROR_DIRECTORY="/testing/ubuntu/"
17
18#export SALTSTACK_REPO="deb [arch=amd64] http://mirror.mirantis.com/proposed/saltstack-2017.7/xenial xenial main"
19#export SALTSTACK_GPG="https://mirror.mirantis.com/proposed/saltstack-2017.7/trusty/SALTSTACK-GPG-KEY.pub"
20export SALTSTACK_REPO="deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/18.04/amd64/2017.7/ bionic main"
21export SALTSTACK_GPG="http://repo.saltstack.com/apt/ubuntu/18.04/amd64/2017.7/SALTSTACK-GPG-KEY.pub"
22###
23# Hard-coded folder in template
24export PACKER_IMAGES_CACHE="${HOME}/packer_images_cache/"
25mkdir -p "${PACKER_IMAGES_CACHE}"
26
27export PACKER_KEY_INTERVAL='10ms'
28export PACKER_LOG=1
29# For qemu test-build:
30[ -f config-drive/cloudata.iso ] && rm -v config-drive/cloudata.iso
31mkisofs -o config-drive/cloudata.iso -V cidata -r -J --quiet config-drive
32# For qemu test-build:
33/home/alexz/bin/packer build -machine-readable -only=qemu -parallel=false -on-error=ask template.json
34#rm -rf ~/.packer.d/
35