From 225bbf598e1ff11994b19805fcccb839922c0cf0 Mon Sep 17 00:00:00 2001 From: jowj Date: Sun, 7 Oct 2018 01:31:49 -0500 Subject: [PATCH] Update to actually work! Some debug statements here, changing a lot of commands to shell. --- deployments/mojobot/mojo.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/deployments/mojobot/mojo.yml b/deployments/mojobot/mojo.yml index 0b13a28..3d7b05a 100644 --- a/deployments/mojobot/mojo.yml +++ b/deployments/mojobot/mojo.yml @@ -4,12 +4,20 @@ - mojo-vars-vault.yml remote_user: josiah tasks: + - name: print hostname + command: hostname + register: hostname + - debug: msg="{{ hostname.stdout }}" + - name: print working directory + shell: ls -la | grep 'mojo' + register: ls + - debug: msg="{{ ls.stdout }}" - name: Pull latest version from github - command: cd ~/mojojojo-bot/ && git pull + shell: cd /home/josiah/mojojojo-bot/ # && git pull - name: Build from the latest version - command: cd ~/mojojojo-bot && docker build -t mojo -f docker/dockerfile . + shell: cd ~/mojojojo-bot && docker build -t mojo -f docker/dockerfile . - name: Check if there are any existing mojo containers running and kill it # this has to be a shell because command: isn't interactive shell: docker ps | grep 'mojo' | awk '{print $1}' | xargs docker kill - name: Run the newly built docker container - command: docker container run -e "SLACK_BOT_TOKEN={{ VAULT_SLACK_BOT_TOKEN }}" --restart "always" -d mojo \ No newline at end of file + command: docker container run -e "SLACK_BOT_TOKEN={{ VAULT_SLACK_BOT_TOKEN }}" --restart "always" -d mojo