<commit_before>version: 2

jobs:
  build:
    working_directory: ~/reviewdog
    docker:
      - image: golang:latest
        environment:
          REVIEWDOG_VERSION: "0.9.11"
    steps:
      - checkout
      - run:
          name: System information
          command: 'echo "Golang $(go version)"'
      - run: 'curl -fSL https://github.com/reviewdog/reviewdog/releases/download/$REVIEWDOG_VERSION/reviewdog_linux_amd64 -o reviewdog && chmod +x ./reviewdog'
      - run: 'go get golang.org/x/lint/golint'
      - run: 'golint ./... || true | ./reviewdog -f=golint -name=golint-circleci -reporter=github-pr-review'
  deploy:
    working_directory: ~/reviewdog/doghouse/appengine/
    docker:
      - image: mercari/appengine-go:1.11
        environment:
          GAE_DEPLOY_ACCOUNT: <EMAIL>
          GAE_DEPLOY_PROJECT: review-dog
          GAE_KEYRING_NAME: reviewdog-doghouse-deploy
          GAE_KEY_NAME: secret-env
    steps:
      - checkout:
          path: ~/reviewdog
      - run:
          name: System information
          command: 'echo "Golang $(go version)"'
      - run:
          name: gloud command information
          command: 'gcloud version'
      - run:
          name: Activate Service Account
          command: |-
            echo $GAE_DEPLOY_KEY_FILE > service_account_key.json
            gcloud auth activate-service-account "$GAE_DEPLOY_ACCOUNT" --key-file=service_account_key.json --project "$GAE_DEPLOY_PROJECT"
      - run:
          name: Decrypt keys
          command: |-
            gcloud kms decrypt --location=global \
              --keyring="$GAE_KEYRING_NAME" \
              --key="$GAE_KEY_NAME" \
              --ciphertext-file=secret/encrypted-reviewdog.private-key.pem.bin \
              --plaintext-file=secret/reviewdog.private-key.pem
            gcloud kms decrypt --location=global \
              --keyring="$GAE_KEYRING_NAME" \
              --key="$GAE_KEY_NAME" \
              --ciphertext-file=secret/encrypted-secret.yaml.bin \
              --plaintext-file=secret/secret.yaml
      - run:
          name: Deploy
          command: |-
            gcloud --quiet --project $GAE_DEPLOY_PROJECT app deploy app.yaml
      - run:
          name: Cleanup
          command: |-
            rm service_account_key.json
            rm secret/reviewdog.private-key.pem<commit_msg>[debug] diagnostics<commit_after>version: 2

jobs:
  build:
    working_directory: ~/reviewdog
    docker:
      - image: golang:latest
        environment:
          REVIEWDOG_VERSION: "0.9.11"
    steps:
      - checkout
      - run:
          name: System information
          command: 'echo "Golang $(go version)"'
      - run: 'curl -fSL https://github.com/reviewdog/reviewdog/releases/download/$REVIEWDOG_VERSION/reviewdog_linux_amd64 -o reviewdog && chmod +x ./reviewdog'
      - run: 'go get golang.org/x/lint/golint'
      - run: 'golint ./... || true | ./reviewdog -f=golint -name=golint-circleci -reporter=github-pr-review'
  deploy:
    working_directory: ~/reviewdog/doghouse/appengine/
    docker:
      - image: mercari/appengine-go:1.11
        environment:
          GAE_DEPLOY_ACCOUNT: <EMAIL>
          GAE_DEPLOY_PROJECT: review-dog
          GAE_KEYRING_NAME: reviewdog-doghouse-deploy
          GAE_KEY_NAME: secret-env
    steps:
      - checkout:
          path: ~/reviewdog
      - run:
          name: System information
          command: 'echo "Golang $(go version)"'
      - run:
          name: gloud command information
          command: 'gcloud version'
      - run:
          name: Activate Service Account
          command: |-
            echo $GAE_DEPLOY_KEY_FILE > service_account_key.json
            gcloud auth activate-service-account "$GAE_DEPLOY_ACCOUNT" --key-file=service_account_key.json --project "$GAE_DEPLOY_PROJECT"
      - run:
          name: Decrypt keys
          command: |-
            gcloud kms decrypt --location=global \
              --keyring="$GAE_KEYRING_NAME" \
              --key="$GAE_KEY_NAME" \
              --ciphertext-file=secret/encrypted-reviewdog.private-key.pem.bin \
              --plaintext-file=secret/reviewdog.private-key.pem
            gcloud kms decrypt --location=global \
              --keyring="$GAE_KEYRING_NAME" \
              --key="$GAE_KEY_NAME" \
              --ciphertext-file=secret/encrypted-secret.yaml.bin \
              --plaintext-file=secret/secret.yaml
      - run:
          name: Deploy
          command: |-
            gcloud info --run-diagnostics
            gcloud --quiet --project $GAE_DEPLOY_PROJECT app deploy app.yaml
      - run:
          name: Cleanup
          command: |-
            rm service_account_key.json
            rm secret/reviewdog.private-key.pem
{'fraction_non_alphanumeric': 0.10939483707151926, 'fraction_numerical': 0.004231908590774439, 'mean_word_length': 1.8475903614457831, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1028536', 'n_tokens_mistral': 1517, 'n_tokens_neox': 1466, 'n_words': 273}