diff --git a/src/commands/infra.sh b/src/commands/infra.sh index e595800..c453fca 100644 --- a/src/commands/infra.sh +++ b/src/commands/infra.sh @@ -16,6 +16,7 @@ wx-infra(){ INFRA_PATH="~/.warengroup/infra" else INFRA_PATH="~/.warengroup/infra" + mkdir -p "$INFRA_PATH" &> /dev/null git clone ssh://git@git.waren.io:2222/warengroup-private/infra.git --config core.sshCommand="ssh -i ~/.ssh/keys/warengroup-legacy" "$INFRA_PATH" fi fi @@ -31,11 +32,13 @@ wx-infra(){ echo "Tag Required" else cd "$INFRA_PATH" + git pull &> /dev/null ansible-playbook --vault-id warengroup@vault/warengroup --vault-id cwchristerw@vault/cwchristerw playbooks/init.yml -t $2 $3 $4 $5 $6 $7 $8 $9 cd "$OLDPWD" fi else cd "$INFRA_PATH" + git pull &> /dev/null ansible-playbook --vault-id warengroup@vault/warengroup --vault-id cwchristerw@vault/cwchristerw playbooks.yml -t $1 $2 $3 $4 $5 $6 $7 $8 $9 cd "$OLDPWD" fi diff --git a/wx b/wx index cffcbed..55e0d36 100755 --- a/wx +++ b/wx @@ -149,6 +149,7 @@ wx-infra(){ INFRA_PATH="~/.warengroup/infra" else INFRA_PATH="~/.warengroup/infra" + mkdir -p "$INFRA_PATH" &> /dev/null git clone ssh://git@git.waren.io:2222/warengroup-private/infra.git --config core.sshCommand="ssh -i ~/.ssh/keys/warengroup-legacy" "$INFRA_PATH" fi fi @@ -164,11 +165,13 @@ wx-infra(){ echo "Tag Required" else cd "$INFRA_PATH" + git pull &> /dev/null ansible-playbook --vault-id warengroup@vault/warengroup --vault-id cwchristerw@vault/cwchristerw playbooks/init.yml -t $2 $3 $4 $5 $6 $7 $8 $9 cd "$OLDPWD" fi else cd "$INFRA_PATH" + git pull &> /dev/null ansible-playbook --vault-id warengroup@vault/warengroup --vault-id cwchristerw@vault/cwchristerw playbooks.yml -t $1 $2 $3 $4 $5 $6 $7 $8 $9 cd "$OLDPWD" fi