<commit_before>---
  chain:
    -
      name: "curent_timestamp"
      ref: "core.local"
      params:
        cmd: "date +%s"
      on-success: "backup_repo"
    -
      name: "backup_repo"
      ref: "linux.mv"
      params:
        hosts: "{{hostname}}"
        source: "/home/stanley/st2web"
        destination: "/home/stanley/{{backup_dir}}_{{current_timestamp.localhost.stdout}}"
        recursive: true
        force: true
      on-success: "clone_repo"
    -
      name: "clone_repo"
      ref: "st2cd.git_clone"
      params:
        hosts: "{{hostname}}"
        repo: "{{repo_url}}"
        branch: "{{branch}}"
        target: "st2web"
      on-success: "npm_install"
    -
      name: "npm_install"
      ref: "core.remote"
      params:
        hosts: "{{hostname}}"
        cmd: "cd /home/stanley/st2web && npm install"
      on-success: "bower_install"
    -
      name: "bower_install"
      ref: "core.remote"
      params:
        hosts: "{{hostname}}"
        cmd: "cd /home/stanley/st2web && bower install"
      on-success: "update_st2_config"
    -
      name: "update_st2_config"
      ref: "core.remote"
      params:
        hosts: "{{hostname}}"
        cmd: ""
      on-success: "update_web_config"
    -
      name: "update_web_config"
      ref: "core.remote"
      params:
        hosts: "{{hostname}}"
        cmd: ""
      on-success: "gulp_in_screen"
    -
      name: "gulp_in_screen"
      ref: "core.remote"
      params:
        hosts: "{{hostname}}"
        cmd: "install -y"
      on-success: "slack_success"
    -
      name: "slack_success"
      ref: "slack.post_message"
      params:
        channel: "#thunderdome"
        message: "st2ctl reload && nohup bg st2ctl restart >& /dev/null < /dev/null; sleep 20"
    -
      name: "slack_failure"
      ref: "slack.post_message"
      params:
        channel: "{{hostname}}"
        message: "update"

  default: "current_timestamp"<commit_msg>Filled in commands for actions, added stop action, added failure slack message<commit_after>---
  chain:
    -
      name: "stop_st2web"
      ref: "core.remote"
      params:
        hosts: "{{hostname}}"
        cmd: "screen -S st2web -X quit"
      on-success: "current_timestamp"
      on-failure: "slack_failure"
    -
      name: "curent_timestamp"
      ref: "core.local"
      params:
        cmd: "date +%s | tee /home/stanley/PREVIOUS_WEB"
      on-success: "backup_repo"
      on-failure: "slack_failure"
    -
      name: "backup_repo"
      ref: "linux.mv"
      params:
        hosts: "{{hostname}}"
        source: "/home/stanley/st2web"
        destination: "/home/stanley/{{backup_dir}}_{{current_timestamp.localhost.stdout}}"
        recursive: true
        force: true
      on-success: "clone_repo"
      on-failure: "slack_failure"
    -
      name: "clone_repo"
      ref: "st2cd.git_clone"
      params:
        hosts: "{{hostname}}"
        repo: "{{repo_url}}"
        branch: "{{branch}}"
        target: "st2web"
      on-success: "npm_install"
      on-failure: "slack_failure"
    -
      name: "npm_install"
      ref: "core.remote"
      params:
        hosts: "{{hostname}}"
        cmd: "cd /home/stanley/st2web && npm install"
      on-success: "bower_install"
      on-failure: "slack_failure"
    -
      name: "bower_install"
      ref: "core.remote"
      params:
        hosts: "{{hostname}}"
        cmd: "cd /home/stanley/st2web && bower install"
      on-success: "update_st2_config"
      on-failure: "slack_failure"
    -
      name: "update_st2_config"
      ref: "core.remote_sudo"
      params:
        hosts: "{{hostname}}"
        sudo: true
        cmd: 'sed -e "s~# \(allow_origin = \).*~\1 http://{{hostname}}:3000~g" /etc/st2/st2.conf'
      on-success: "update_web_config"
      on-failure: "slack_failure"
    -
      name: "update_web_config"
      ref: "core.remote"
      params:
        hosts: "{{hostname}}"
        cmd: 'sed -e "s~Express~`hostname -s`~g" -e "s~172\.168\.90\.50~{{hostname}}~g" /home/stanley/st2web/config.js'
      on-success: "gulp_in_screen"
      on-failure: "slack_failure"
    -
      name: "gulp_in_screen"
      ref: "core.remote"
      params:
        hosts: "{{hostname}}"
        cmd: "cd /home/stanley/st2web && screen -S st2web -d -m gulp"
      on-success: "slack_success"
      on-failure: "slack_failure"
    -
      name: "slack_success"
      ref: "slack.post_message"
      params:
        channel: "#thunderdome"
        message: "```[st2web deploy]\n STATUS: SUCCESS\n HOSTNAME: {{hostname}}\n BRANCH: {{branch}}```"
    -
      name: "slack_failure"
      ref: "slack.post_message"
      params:
        channel: "#thunderdome"
        message: "```[st2web deploy]\n STATUS: FAILURE\n HOSTNAME: {{hostname}}\n BRANCH: {{branch}}```"

  default: "stop_st2web"
{'fraction_non_alphanumeric': 0.15075062552126772, 'fraction_numerical': 0.00896580483736447, 'mean_word_length': 2.082904884318766, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2760937', 'n_tokens_mistral': 1705, 'n_tokens_neox': 1692, 'n_words': 338}