blob: 3f7328c18e76f4bfbfac2b313d82055b425bfe45 [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
15export CLUSTER_MODEL="https://github.com/Mirantis/mcp-offline-model.git"
16export CLUSTER_MODEL_REF="master"
17export CLUSTER_NAME="mcp-offline"
18
19export MCP_VERSION="nightly"
20export FORMULA_VERSION="nightly"
21
22BINARY_MCP_VERSION="nightly"
23export UBUNTU_BASEURL="http://mirror.mirantis.com/${BINARY_MCP_VERSION}/ubuntu/"
24export SALTSTACK_REPO="http://apt.mirantis.com/xenial/salt/2016.3/ ${BINARY_MCP_VERSION} main"
25export APT_MIRANTIS_GPG="http://apt.mirantis.com/public.gpg"
26export SALTSTACK_GPG="${APT_MIRANTIS_GPG}"
27export APT_MIRANTIS_SALT_REPO="http://apt.mirantis.com/xenial/ ${BINARY_MCP_VERSION} salt "
28#
29export GIT_SALT_FORMULAS_SCRIPTS="https://github.com/salt-formulas/salt-formulas-scripts.git"
30#
31export APT_REPOSITORY=" deb [arch=amd64] ${APT_MIRANTIS_SALT_REPO} "
32export APT_REPOSITORY_GPG=${APT_MIRANTIS_GPG}
33
34# Openstack-related variables
35export VM_FLAVOR="3c4fe514-3eb6-464d-a419-7be09d72cf1e"
36export VM_FLOATING_IP_POOL="095f43ed-65ba-48ce-8185-d4080e430a88"
37export IMAGE_NAME="mcp-offline-mirror-$(date '+%Y-%m-%d-%H-%M-%S')"
azvyagintsevc86fbaf2018-03-02 18:57:03 +020038export VM_IMAGE="9953a40d-1fa2-4f26-b146-0507dbc912dc" # ubuntu cloud img
39# May be need, if cloud with keystone v3 used
40#export OS_TENANT_ID=$OS_PROJECT_ID
41#export OS_DOMAIN_NAME="xxxx"
42#export OS_TENANT_NAME="xxxxx"
azvyagintsev6d453852018-02-26 16:56:37 +020043
44export PACKER_LOG=1
azvyagintsevc86fbaf2018-03-02 18:57:03 +020045# For qemu test-build:
46#cloud-localds --hostname ubuntu --dsmode local config-drive/cloudata.iso config-drive/user-data.yaml
47# packer build -only=qemu -parallel=false -on-error=ask template.json
48# rm -rf ~/.packer.d/
49
50# For openstack test-build
azvyagintsev6d453852018-02-26 16:56:37 +020051packer build -only=openstack -parallel=false -on-error=ask template.json