-
Notifications
You must be signed in to change notification settings - Fork 7
/
build-amis
executable file
·62 lines (47 loc) · 1.06 KB
/
build-amis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
set -euo pipefail
INIT_LIB_LOAD_PREINSTALLED_TEST_SUBJECT_VERSIONS=true
# Init lib.
# shellcheck source=SCRIPTDIR/../lib/vector-test-harness/init.sh
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)/../lib/vector-test-harness/init.sh"
#
# Usage
#
register_usage <<END
USAGE
build-amis
DESCRIPTION
Builds the various AMIs necessary to run the test cases. This saves quite
a bit of time when tests are consecutively run, avoiding the need to
install dependencies and test subjects.
OPTIONS
none
EXAMPLES
./build-amis
END
#
# Dependencies
#
ensure_commad_available "ansible-playbook" "sudo pip install ansible"
ensure_commad_available "packer" "brew install packer"
#
# Variables
#
prepare_preinstalled_test_subject_versions_ansible_vars
#
# Header
#
print_vector_logo
print_divider
cat <<END
Test subject versions to bake into the AMI:
END
print_preinstalled_test_subject_versions "- "
print_divider
print_spacer
#
# Build AMIs
#
cd packer
export PREINSTALLED_TEST_SUBJECT_VERSIONS_ANSIBLE_VARS
packer build ami.json