blob: 4694f394340bac026abdc458a3abd197df2d0798 [file] [log] [blame]
#!/bin/bash
# pre-requirments:
# apt-get install cloud-localds
# Cloudimg: wget https://cloud-images.ubuntu.com/xenial/XXXX/xenial-server-cloudimg-amd64-disk1.img
# Packer: https://releases.hashicorp.com/packer/1.1.3/packer_1.1.3_linux_amd64.zip
# Those script - only example for variables, which should be passed to packer and
# overwrite variables under /scripts/ directory
# External script sources:
# http/bootstrap.saltstack.com.sh https://github.com/saltstack/salt-bootstrap
#
export IMAGE_NAME="ubuntu-18-04-x64"
export MIRROR_HOSTNAME="mirror.mirantis.com"
export MIRROR_DIRECTORY="/testing/ubuntu/"
#export SALTSTACK_REPO="deb [arch=amd64] http://mirror.mirantis.com/proposed/saltstack-2017.7/xenial xenial main"
#export SALTSTACK_GPG="https://mirror.mirantis.com/proposed/saltstack-2017.7/trusty/SALTSTACK-GPG-KEY.pub"
export SALTSTACK_REPO="deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/18.04/amd64/2017.7/ bionic main"
export SALTSTACK_GPG="http://repo.saltstack.com/apt/ubuntu/18.04/amd64/2017.7/SALTSTACK-GPG-KEY.pub"
###
# Hard-coded folder in template
export PACKER_IMAGES_CACHE="${HOME}/packer_images_cache/"
mkdir -p "${PACKER_IMAGES_CACHE}"
export PACKER_KEY_INTERVAL='10ms'
export PACKER_LOG=1
# For qemu test-build:
[ -f config-drive/cloudata.iso ] && rm -v config-drive/cloudata.iso
mkisofs -o config-drive/cloudata.iso -V cidata -r -J --quiet config-drive
# For qemu test-build:
/home/alexz/bin/packer build -machine-readable -only=qemu -parallel=false -on-error=ask template.json
#rm -rf ~/.packer.d/