Chore: Upgrade Jenkins-job-builder to 6.3.0
[releng/global-jjb.git] / shell / openstack-stack-create.sh
1 #!/bin/bash -l
2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2017, 2018 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> Create HEAT stack"
12
13 os_cloud="${OS_CLOUD:-vex}"
14 stack_name="${OS_STACK_NAME}"
15 stack_template="${OS_STACK_TEMPLATE}"
16 stack_template_dir="/opt/ciman/${OS_STACK_TEMPLATE_DIR:-openstack-hot}"
17 stack_parameters="$WORKSPACE/stack-parameters.yaml"
18
19 set -eux -o pipefail
20
21 # shellcheck disable=SC1090
22 source ~/lf-env.sh
23
24 lf-activate-venv --python python3 "lftools[openstack]" \
25     kubernetes \
26     niet \
27     python-heatclient \
28     python-openstackclient \
29     python-magnumclient \
30     yq
31
32 openstack --os-cloud "$os_cloud" limits show --absolute
33
34 pushd "$stack_template_dir" || exit 1
35 lftools openstack --os-cloud "$os_cloud" stack create \
36     "$stack_name" "$stack_template" "$stack_parameters"
37 popd