-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdev.sh
29 lines (25 loc) · 955 Bytes
/
dev.sh
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
set -x
# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
--debug)
export ANSIBLE_STDOUT_CALLBACK=debug
shift
;;
*)
extra_arguments+=("$1")
shift
;;
esac
done
# Set environment variables
export ANSIBLE_WORK_DIR="${ANSIBLE_WORK_DIR:-$(pwd)}"
export ANSIBLE_VARIABLE_FILE_NAME="${ANSIBLE_VARIABLE_FILE_NAME:-".spin.yml"}"
export ANSIBLE_VARIABLE_FILEPATH="${ANSIBLE_VARIABLE_FILEPATH:-"${ANSIBLE_WORK_DIR}/${ANSIBLE_VARIABLE_FILE_NAME}"}"
# Use ANSIBLE_VARIABLE_FILEPATH instead of variable_file_path
variable_file_path="${ANSIBLE_VARIABLE_FILEPATH}"
version=$(awk '/version:/ {print $2; exit}' galaxy.yml)
ansible-galaxy collection build --force
ansible-galaxy collection install "serversideup-spin-${version}.tar.gz" --force
ansible-playbook -i plugins/inventory/spin-dynamic-inventory.sh playbooks/provision.yml --extra-vars "@${variable_file_path}" "${extra_arguments[@]}"