summaryrefslogtreecommitdiff
path: root/pre_build_hook
blob: bca820839e988d9d3f3abf02eaa38b8d3905fc97 (plain)
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
#!/bin/bash
# Add here any the actions which are required before plugin build
# like packages building, packages downloading from mirrors and so on.
# The script should return 0 if there were no errors.

set -eux

ROOT="$(dirname $(readlink -f $0))"
PLUGIN_MOD_DIR="$ROOT/deployment_scripts/puppet/modules/upstream"
MODULE_NAME='nsxt'

# Download upstream puppet modules that are not in fuel-library/
find "$ROOT/deployment_scripts/puppet/modules" -maxdepth 1 -mindepth 1 -type d ! -name $MODULE_NAME -prune -exec rm -fr {} \;
"$ROOT"/update_modules.sh -d "$PLUGIN_MOD_DIR"

# Remove .git directory
rm -fr $(find "${PLUGIN_MOD_DIR:?}" -name '.git' )

mv "$PLUGIN_MOD_DIR"/* "$(dirname $PLUGIN_MOD_DIR)"

# Download puppet modules that are in fuel-library/
TARBALL_VERSION='stable/mitaka'
REPO_PATH="https://github.com/openstack/fuel-library/tarball/${TARBALL_VERSION}"
#
wget -qO- "$REPO_PATH" | tar --wildcards -C "$PLUGIN_MOD_DIR" --strip-components=3 -zxvf - "openstack-fuel-library-*/deployment/puppet/"
mv "$PLUGIN_MOD_DIR"/osnailyfacter/lib/puppet/parser/functions/get_ssl_property.rb "$(dirname $PLUGIN_MOD_DIR)"/$MODULE_NAME/lib/puppet/parser/functions

# clean
rm -fr "$PLUGIN_MOD_DIR"