<commit_before>image: xtity/deploy-phoenix
env:
  - MIX_ENV=test
script:
  - mix clean
  - yes | mix local.hex && yes | mix local.rebar
  - mix deps.get
  # - mix test
  # - mix compile
  # - mix dialyzer
deploy:
  bash:
    script:
      - MIX_ENV=prod mix deps.get
      - npm install && brunch build
      # - MIX_ENV=prod PORT=4000 mix release
      - MIX_ENV=prod mix release
      # - yes | mix local.hex && yes | mix local.rebar && mix do deps.get && MIX_ENV=prod mix compile.protocols
      # - mix compile.protocols
      - tar -cvzf ../build.tar.gz .
      - ssh <EMAIL>
      # - ssh <EMAIL> "if [ ! -e /usr/local/src/phoenix/app/deploy_phoenix/rel/deploy_phoenix/releases/$(cat VERSION) ]; then
      #     mkdir -p /usr/local/src/phoenix/app/deploy_phoenix/rel/deploy_phoenix/releases/$(cat VERSION);
      #   fi;"
      # - scp -r rel/deploy_phoenix/*.tar.gz <EMAIL>:/usr/local/src/phoenix/app/deploy_phoenix/rel/deploy_phoenix/
      # - scp -r rel/deploy_phoenix/*.tar.gz <EMAIL>:/usr/local/src/phoenix/app/deploy_phoenix/deploy/
      - ssh <EMAIL> "
          cd /usr/local/src/phoenix/deploy_phoenix/;
          if [ -e /usr/local/src/phoenix/deploy_phoenix/deploy ]; then
            rm -rf /usr/local/src/phoenix/deploy_phoenix/deploy;
          fi;
          mkdir deploy;
        "
      - scp -r ../build.tar.gz <EMAIL>:/usr/local/src/phoenix/deploy_phoenix/deploy/
      - ssh <EMAIL> "
          cd /usr/local/src/phoenix/deploy_phoenix;
          tar -xvzf deploy/build.tar.gz -C deploy/;
          rm -rf deploy/build.tar.gz
          rm -rf bk;
          cp -a current bk;
          mv -f deploy current;
        "
      # - ssh <EMAIL> "if [ ! -e /usr/local/src/phoenix/app/deploy_phoenix/rel/deploy_phoenix/releases/$(cat VERSION) ]; then
    # when:
    #   branch: master

# publish:
#   github:
#     artifacts:
#       - release
#     repo: deploy_phoenix
#     script:
#       - make release
#     tag: v$(cat VERSION)
#     token: $$github_token
#     user: xtity
    # when:<commit_msg>test drone 3<commit_after>image: xtity/deploy-phoenix
env:
  - MIX_ENV=test
script:
  - mix clean
  - yes | mix local.hex && yes | mix local.rebar
  - mix deps.get
  # - mix test
  # - mix compile
  # - mix dialyzer
deploy:
  bash:
    script:
      - MIX_ENV=prod mix deps.get
      - npm install && brunch build
      # - MIX_ENV=prod PORT=4000 mix release
      - MIX_ENV=prod mix release
      # - yes | mix local.hex && yes | mix local.rebar && mix do deps.get && MIX_ENV=prod mix compile.protocols
      # - mix compile.protocols
      - tar -cvz ../build.tar.gz .
      - ssh <EMAIL>
      # - ssh <EMAIL> "if [ ! -e /usr/local/src/phoenix/app/deploy_phoenix/rel/deploy_phoenix/releases/$(cat VERSION) ]; then
      #     mkdir -p /usr/local/src/phoenix/app/deploy_phoenix/rel/deploy_phoenix/releases/$(cat VERSION);
      #   fi;"
      # - scp -r rel/deploy_phoenix/*.tar.gz <EMAIL>:/usr/local/src/phoenix/app/deploy_phoenix/rel/deploy_phoenix/
      # - scp -r rel/deploy_phoenix/*.tar.gz <EMAIL>:/usr/local/src/phoenix/app/deploy_phoenix/deploy/
      - ssh <EMAIL>@<EMAIL> "
          cd /usr/local/src/phoenix/deploy_phoenix/;
          if [ -e /usr/local/src/phoenix/deploy_phoenix/deploy ]; then
            rm -rf /usr/local/src/phoenix/deploy_phoenix/deploy;
          fi;
          mkdir /usr/local/src/phoenix/deploy_phoenix/deploy;
        "
      - scp -r ../build.tar.gz <EMAIL>:/usr/local/src/phoenix/deploy_phoenix/deploy/
      - ssh <EMAIL> "
          cd /usr/local/src/phoenix/deploy_phoenix/deploy;
          tar -xvz build.tar.gz;
          rm -rf build.tar.gz;
          cd /usr/local/src/phoenix/deploy_phoenix;
          rm -rf bk;
          cp -a current bk;
          mv -f deploy current;
        "
      # - ssh <EMAIL> "if [ ! -e /usr/local/src/phoenix/app/deploy_phoenix/rel/deploy_phoenix/releases/$(cat VERSION) ]; then
    # when:
    #   branch: master

# publish:
#   github:
#     artifacts:
#       - release
#     repo: deploy_phoenix
#     script:
#       - make release
#     tag: v$(cat VERSION)
#     token: $$github_token
#     user: xtity
    # when:
{'fraction_non_alphanumeric': 0.13977713178294573, 'fraction_numerical': 0.002180232558139535, 'mean_word_length': 2.0029090909090908, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '1711614', 'n_tokens_mistral': 1595, 'n_tokens_neox': 1569, 'n_words': 291}