~evanj/cms

5858835001d7b11f5798f26344b0ce8fbf633c2c — Evan M Jones 4 months ago d759eda
Feat(.build.yml): Tip deployments.
1 files changed, 6 insertions(+), 2 deletions(-)

M .build.yml
M .build.yml => .build.yml +6 -2
@@ 11,13 11,17 @@ tasks:
      export PATH=$PATH:$HOME/go/bin
      cd cms
      touch .env
      make gen
      make build
      make setup gen build
      if [ `git branch | head -n 1 | awk '{print$5}' | sed 's/)//g' | xargs -I X bash -c "git log --pretty=oneline origin/master | grep X" | wc -l` == "1" ]; then
        echo "deploying to production"
        ssh -o 'StrictHostKeyChecking=no' evan@140.82.14.80 'bash -c "rm ~/cms/cms 2>/dev/null"'
        scp -o 'StrictHostKeyChecking=no' cms evan@140.82.14.80:~/cms
        ssh -o 'StrictHostKeyChecking=no' evan@140.82.14.80 'bash -c "sudo systemctl restart cms"'
      elif [ `git branch | head -n 1 | awk '{print$5}' | sed 's/)//g' | xargs -I X bash -c "git log --pretty=oneline origin/tip | grep X" | wc -l` == "1" ]; then
        echo "deploying to tip"
        ssh -o 'StrictHostKeyChecking=no' evan@140.82.14.80 'bash -c "rm ~/cms.tip/cms 2>/dev/null"'
        scp -o 'StrictHostKeyChecking=no' cms evan@140.82.14.80:~/cms.tip
        ssh -o 'StrictHostKeyChecking=no' evan@140.82.14.80 'bash -c "sudo systemctl restart cms.tip"'
      else 
        echo "not deploying"
      fi