blob: cab63933d2b2b2cfef7a3cdfc87d7184dabc8085 [file] [log] [blame]
azvyagintsev6d453852018-02-26 16:56:37 +02001#!/bin/bash
2
3# pre-requirments:
4# apt-get install cloud-localds
5# Cloudimg: wget https://cloud-images.ubuntu.com/xenial/current/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#
14
azvyagintsev0f697cf2018-06-22 11:44:13 +030015export PACKER_IMAGES_CACHE="${HOME}/packer_images_cache/"
16#
azvyagintsev6d453852018-02-26 16:56:37 +020017export CLUSTER_MODEL="https://github.com/Mirantis/mcp-offline-model.git"
18export CLUSTER_MODEL_REF="master"
19export CLUSTER_NAME="mcp-offline"
20
21export MCP_VERSION="nightly"
22export FORMULA_VERSION="nightly"
23
24BINARY_MCP_VERSION="nightly"
25export UBUNTU_BASEURL="http://mirror.mirantis.com/${BINARY_MCP_VERSION}/ubuntu/"
azvyagintsev41bc80d2018-07-12 13:46:56 +030026export SALTSTACK_REPO="http://mirror.mirantis.com/${BINARY_MCP_VERSION}/saltstack-2017.7/xenial xenial main"
27export SALTSTACK_GPG="http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/SALTSTACK-GPG-KEY.pub"
azvyagintsev6d453852018-02-26 16:56:37 +020028export APT_MIRANTIS_GPG="http://apt.mirantis.com/public.gpg"
azvyagintsev6d453852018-02-26 16:56:37 +020029export APT_MIRANTIS_SALT_REPO="http://apt.mirantis.com/xenial/ ${BINARY_MCP_VERSION} salt "
30#
31export GIT_SALT_FORMULAS_SCRIPTS="https://github.com/salt-formulas/salt-formulas-scripts.git"
32#
33export APT_REPOSITORY=" deb [arch=amd64] ${APT_MIRANTIS_SALT_REPO} "
34export APT_REPOSITORY_GPG=${APT_MIRANTIS_GPG}
35
36# Openstack-related variables
azvyagintsev0f697cf2018-06-22 11:44:13 +030037#export VM_FLAVOR="3c4fe514-3eb6-464d-a419-7be09d72cf1e"
38#export VM_FLOATING_IP_POOL="095f43ed-65ba-48ce-8185-d4080e430a88"
39#export IMAGE_NAME="mcp-offline-mirror-$(date '+%Y-%m-%d-%H-%M-%S')"
40#export VM_IMAGE="9953a40d-1fa2-4f26-b146-0507dbc912dc" # ubuntu cloud img
azvyagintsevc86fbaf2018-03-02 18:57:03 +020041# May be need, if cloud with keystone v3 used
42#export OS_TENANT_ID=$OS_PROJECT_ID
43#export OS_DOMAIN_NAME="xxxx"
44#export OS_TENANT_NAME="xxxxx"
azvyagintsev6d453852018-02-26 16:56:37 +020045
azvyagintsev0f697cf2018-06-22 11:44:13 +030046# Hard-coded folder in template
47mkdir -p "${PACKER_IMAGES_CACHE}"
48
azvyagintsev6d453852018-02-26 16:56:37 +020049export PACKER_LOG=1
azvyagintsevc86fbaf2018-03-02 18:57:03 +020050# For qemu test-build:
azvyagintsev0f697cf2018-06-22 11:44:13 +030051cloud-localds --hostname ubuntu --dsmode local config-drive/cloudata.iso config-drive/user-data.yaml
52packer build -only=qemu -parallel=false -on-error=ask template.json
azvyagintsevc86fbaf2018-03-02 18:57:03 +020053# rm -rf ~/.packer.d/