diff -r e7c7e6e0a8bc -r 62bffc051e1c deploy/deploy.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deploy/deploy.sh Wed Nov 28 15:45:37 2018 +0100 @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SCRIPTNAME=`basename "$0"` + +usage() { + echo -n "${SCRIPTNAME} [CONFIG] [VERSION] + +Deploy the using ansible. +config must be in the following list : test, prod +" +} + +if [[ "$#" -ne 2 ]]; then + usage + exit 1 +fi + +config=${1} +VERSION=${2} + +case $config in + test) configOK=true;; + prod) configOK=true;; + *) configOK=false;; +esac + +if [[ "$configOK" = false ]]; then + usage + exit 1 +fi + +pushd "$SCRIPTPATH" + +ANSIBLE_SSH_PIPELINING=1 ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook -v -i "./hosts/hosts.$config" -l "$config" ./deploy.yml --extra-vars "irinotes_version=${VERSION}" --ask-vault-pass + +popd