-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathscript
More file actions
executable file
·81 lines (53 loc) · 2.01 KB
/
script
File metadata and controls
executable file
·81 lines (53 loc) · 2.01 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env bash
# To implement this command, edit the "Command implementation" section below.
# Usage
# -----
# Comments prefixed with `#/` are managed by stubbs.
# The `command` and `usage` comments describe the command
# and show its options.
#
#/ command: tests:provision: "Provision a cluster"
#/ usage: rerun tests:provision --provider <vagrant> --version <dev> [ --skip-cleanup <false>]
# Load common functions
# ---------------------
# Load the function library for this module.
# This loads rerun functions, too.
. $RERUN_MODULE_DIR/lib/functions.sh provision || {
echo >&2 "Failed loading function library." ; exit 1 ;
}
# Error handling
# ---------------
# This script is designed to _fail-fast_.
# Trap errors and exit. The call to `rerun_die` will print the
# the error message and exit with the error command exit status.
trap 'rerun_die $? "*** command failed: tests:provision. ***"' ERR
# Run [set] `nounset` to treat unset variables as errors. Set [pipefail]
# so a pipeline return status is the value of the last
# (rightmost) command to exit with non-zero status.
#
# [set]: http://ss64.com/bash/set.html
# [pipefail]: http://www.gnu.org/software/bash/manual/html_node/Pipelines.html
set -o nounset -o pipefail
# Command variables
# -----------------
# This command script can access the following variables
# declared by `rerun` or by the option parser function.
#/ rerun-variables: RERUN, RERUN_VERSION, RERUN_MODULES, RERUN_MODULE_DIR
#/ option-variables: PROVIDER VERSION SKIP_CLEANUP
# The `rerun_options_parse` function processes the command line
# arguments. Each accepted command line flag results in setting
# one the corresponding option variables.
rerun_options_parse "$@"
trap destroy-cluster EXIT
# Command implementation
# ----------------------
TEST_ROOT="${TEST_ROOT}/${VERSION}"
setup-provider "${PROVIDER}"
setup-provider-dependencies
destroy-cluster
setup-clients "${VERSION}"
make discovery-url
create-cluster
build-deis "${VERSION}"
deploy-deis "${VERSION}"
make test-smoke