<commit_before>---
stages:
  - name: 'Build & Run Unit Tests'
    inputs:
      - type: git
        branch: master
    triggers:
      - type: commit
    properties:
      - name: SLACK_WEBHOOK_PATH
        value: 'https://hooks.slack.com/services/{key}'
        type: text
      - name: SLACK_MESSAGE
        value: 'DevOps Tutorial App - All tests passed.'
        type: text
    jobs:
      - name: Changelog
        type: builder
        build_type: shell
        script: |-
          #!/bin/bash
          # This script just dumps the changes included in this build into a file named changelog.txt
          # This change log can be used later to be included in notifications
          git log ${GIT_COMMIT}..HEAD --graph --oneline > changelog.txt
          cat changelog.txt
      - name: Karma-UnitTest
        type: tester
        script: |-
          #!/bin/bash
          npm install
          node ./node_modules/gulp/bin/gulp dev-karma
        enable_tests: true
        test_file_pattern: 'test/*.xml'
      - name: Mocha-UnitTest
        type: tester
        script: |-
          #!/bin/bash
          npm install
          node ./node_modules/gulp/bin/gulp dev-mocha
        enable_tests: true
        test_file_pattern: xunit.xml
      - name: Mocha-Api-UnitTest
        type: tester
        script: |-
          #!/bin/bash
          npm install
          node ./node_modules/mocha/bin/mocha --recursive --reporter xunit-file test/api/
        enable_tests: true
        test_file_pattern: xunit.xml
      - name: Lint
        type: tester
        script: |-
          #!/bin/bash
          npm install
          node ./node_modules/gulp/bin/gulp lint
        enable_tests: true
        test_file_pattern: 'test/*.xml'
      - name: Slack Notification
        type: tester
        script: |-
          #!/bin/bash
          curl -X POST --data-urlencode 'payload={"text": "${SLACK_MESSAGE}"}' ${SLACK_WEBHOOK_PATH}
  - name: Deploy to Test
    inputs:
      - type: job
        stage: 'Build & Run Unit Tests'
        job: Changelog
    triggers:
      - type: stage
    jobs:
      - name: Deploy
        type: deployer
        target:
          url: '${CF_TARGET_URL}'
          organization: '${CF_ORGANIZATION}'
          space: '${CF_SPACE}'
          application: '${CF_APP}'
        script: |-
          #!/bin/bash
          cf push "${CF_APP}-test-blue" -n "${CF_APP}-test"
          cf delete "${CF_APP}-test-green" --f
          cf rename "${CF_APP}-test-blue" "${CF_APP}-test-green"
      - name: Notify
        type: builder
  - name: 'Run Tests - Performance & Scale'
    inputs:
      - type: job
        stage: Deploy to Test
        job: Notify
    triggers:
      - type: stage
    properties:
      - name: NEW_RELIC_LICENSE_KEY
        value: xxx
        type: text
      - name: SPEED_CURVE_LICENSE_KEY
        value: ''
        type: text
    jobs:
      - name: SpeedCurve
        type: tester
        script: |-
          #!/bin/bash
          curl "https://api.speedcurve.com/v1/deploy" -u ${SPEED_CURVE_LICENSE_KEY}:x --request POST --data note=${CF_APP}-${BUILD_NUMBER}
        enable_tests: true
        test_file_pattern: test/speedcurve.xml
      - name: New Relic
        type: builder
        build_type: shell
        script: |-
          #!/bin/bash
          if [ ${NEW_RELIC_LICENSE_KEY} == 'xxx' ];
          then
            echo "NewRelic is disabled. Please specify your NewRelic API key.";
          else
            npm install newrelic
            cp node_modules/newrelic/newrelic.js ./
            mkdir .newrelic
            echo ${NEW_RELIC_LICENSE_KEY} > .newrelic/key;
          fi
  - name: Push to Prod
    inputs:
      - type: job
        stage: 'Run Tests - Performance & Scale'
        job: New Relic
    triggers:
      - type: stage
    properties:
      - name: APP_URL
        value: ''
        type: text
      - name: SAUCE_USERNAME
        value: ''
        type: text
      - name: SAUCE_ACCESS_KEY
        value: ''
        type: text
      - name: LOAD_IMPACT_LICENSE_KEY
        value: ''
        type: text
      - name: LOAD_IMPACT_TEST_URL
        value: 'https://api.loadimpact.com/v2/test-configs/{id}/start'
        type: text
      - name: SLACK_WEBHOOK_PATH
        value: 'https://hooks.slack.com/services/{key}'
        type: text
      - name: SLACK_MESSAGE
        value: 'DevOps Tutorial App - Deployment done.'
        type: text
    jobs:<commit_msg>Slack improvements<commit_after>---
stages:
  - name: 'Build & Run Unit Tests'
    inputs:
      - type: git
        branch: master
    triggers:
      - type: commit
    properties:
      - name: SLACK_WEBHOOK_PATH
        value: 'https://hooks.slack.com/services/{key}'
        type: text
      - name: SLACK_MESSAGE
        value: '${CF_APP} - All tests passed.'
        type: text
    jobs:
      - name: Changelog
        type: builder
        build_type: shell
        script: |-
          #!/bin/bash
          # This script just dumps the changes included in this build into a file named changelog.txt
          # This change log can be used later to be included in notifications
          git log ${GIT_COMMIT}..HEAD --graph --oneline > changelog.txt
          cat changelog.txt
      - name: Karma-UnitTest
        type: tester
        script: |-
          #!/bin/bash
          npm install
          node ./node_modules/gulp/bin/gulp dev-karma
        enable_tests: true
        test_file_pattern: 'test/*.xml'
      - name: Mocha-UnitTest
        type: tester
        script: |-
          #!/bin/bash
          npm install
          node ./node_modules/gulp/bin/gulp dev-mocha
        enable_tests: true
        test_file_pattern: xunit.xml
      - name: Mocha-Api-UnitTest
        type: tester
        script: |-
          #!/bin/bash
          npm install
          node ./node_modules/mocha/bin/mocha --recursive --reporter xunit-file test/api/
        enable_tests: true
        test_file_pattern: xunit.xml
      - name: Lint
        type: tester
        script: |-
          #!/bin/bash
          npm install
          node ./node_modules/gulp/bin/gulp lint
        enable_tests: true
        test_file_pattern: 'test/*.xml'
      - name: Slack Notification
        type: tester
        script: |-
          #!/bin/bash
          curl -X POST --data-urlencode 'payload={"text": "${SLACK_MESSAGE}"}' ${SLACK_WEBHOOK_PATH}
  - name: Deploy to Test
    inputs:
      - type: job
        stage: 'Build & Run Unit Tests'
        job: Changelog
    triggers:
      - type: stage
    jobs:
      - name: Deploy
        type: deployer
        target:
          url: '${CF_TARGET_URL}'
          organization: '${CF_ORGANIZATION}'
          space: '${CF_SPACE}'
          application: '${CF_APP}'
        script: |-
          #!/bin/bash
          cf push "${CF_APP}-test-blue" -n "${CF_APP}-test"
          cf delete "${CF_APP}-test-green" --f
          cf rename "${CF_APP}-test-blue" "${CF_APP}-test-green"
      - name: Notify
        type: builder
  - name: 'Run Tests - Performance & Scale'
    inputs:
      - type: job
        stage: Deploy to Test
        job: Notify
    triggers:
      - type: stage
    properties:
      - name: NEW_RELIC_LICENSE_KEY
        value: xxx
        type: text
      - name: SPEED_CURVE_LICENSE_KEY
        value: ''
        type: text
    jobs:
      - name: SpeedCurve
        type: tester
        script: |-
          #!/bin/bash
          curl "https://api.speedcurve.com/v1/deploy" -u ${SPEED_CURVE_LICENSE_KEY}:x --request POST --data note=${CF_APP}-${BUILD_NUMBER}
      - name: New Relic
        type: builder
        build_type: shell
        script: |-
          #!/bin/bash
          if [ ${NEW_RELIC_LICENSE_KEY} == 'xxx' ];
          then
            echo "NewRelic is disabled. Please specify your NewRelic API key.";
          else
            npm install newrelic
            cp node_modules/newrelic/newrelic.js ./
            mkdir .newrelic
            echo ${NEW_RELIC_LICENSE_KEY} > .newrelic/key;
          fi
  - name: Push to Prod
    inputs:
      - type: job
        stage: 'Run Tests - Performance & Scale'
        job: New Relic
    triggers:
      - type: stage
    properties:
      - name: APP_URL
        value: ''
        type: text
      - name: SAUCE_USERNAME
        value: ''
        type: text
      - name: SAUCE_ACCESS_KEY
        value: ''
        type: text
      - name: LOAD_IMPACT_LICENSE_KEY
        value: ''
        type: text
      - name: LOAD_IMPACT_TEST_URL
        value: 'https://api.loadimpact.com/v2/test-configs/{id}/start'
        type: text
      - name: SLACK_WEBHOOK_PATH
        value: 'https://hooks.slack.com/services/{key}'
        type: text
      - name: SLACK_MESSAGE
        value: '${CF_APP} - Deployment done.'
        type: text
    jobs:
{'fraction_non_alphanumeric': 0.10650618825933916, 'fraction_numerical': 0.0004541841716816169, 'mean_word_length': 1.5799648506151143, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 9}, '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': '5246898', 'n_tokens_mistral': 2767, 'n_tokens_neox': 2709, 'n_words': 690}