| #!/bin/bash |
| |
| # pre-requirments: |
| # apt-get install cloud-localds |
| # Cloudimg: wget https://cloud-images.ubuntu.com/xenial/current/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 CLUSTER_MODEL="https://github.com/jiribroulik/day01.git" |
| export CLUSTER_MODEL_REF="master" |
| export CLUSTER_NAME="mcp-day01" |
| |
| export MCP_VERSION="nightly" |
| export FORMULA_VERSION="nightly" |
| |
| BINARY_MCP_VERSION="nightly" |
| export UBUNTU_BASEURL="http://mirror.mirantis.com/${BINARY_MCP_VERSION}/ubuntu/" |
| export SALTSTACK_REPO="http://apt.mirantis.com/xenial/salt/2016.3/ ${BINARY_MCP_VERSION} main" |
| export APT_MIRANTIS_GPG="http://apt.mirantis.com/public.gpg" |
| export SALTSTACK_GPG="${APT_MIRANTIS_GPG}" |
| export APT_MIRANTIS_SALT_REPO="http://apt.mirantis.com/xenial/ ${BINARY_MCP_VERSION} salt " |
| # |
| export GIT_SALT_FORMULAS_SCRIPTS="https://github.com/salt-formulas/salt-formulas-scripts.git" |
| # |
| export APT_REPOSITORY=" deb [arch=amd64] ${APT_MIRANTIS_SALT_REPO} " |
| export APT_REPOSITORY_GPG=${APT_MIRANTIS_GPG} |
| |
| export PACKER_LOG=1 |
| # For qemu test-build: |
| cloud-localds --hostname ubuntu --dsmode local config-drive/cloudata.iso config-drive/user-data.yaml |
| ./packer build -only=qemu -parallel=false -on-error=ask template.json |
| rm -rf ~/.packer.d/ |