version: 2
jobs:
  build:
    docker:
    - image: maven:3.5.0-jdk-8
    working_directory: ~/app
    steps:
    - checkout

    - restore_cache:
        keys:
        - v1-{{ checksum "pom.xml" }}
        - v1-
        paths:
        - ~/.m2

    - run:
        name: Echo Test Variable
        command: |
          echo ${test_variable}

    - run:
        name: Create test properties file
        command: |
          mkdir -p target/test-classes
          cd target/test-classes
          if [ ! -f gplaymusic.properties ]; then
              printf "auth.username=${auth_username}" >> gplaymusic.properties
              printf "auth.password=${auth_password}" >> gplaymusic.properties
              printf "auth.android_id=${auth_android_id}" >> gplaymusic.properties
              printf "auth.token=${auth_token}" >> gplaymusic.properties
          fi

    - run:
        command: mvn test
        name: Running unit tests
        when: always
    - deploy:
        command: |
          mkdir -p target/junit/
          find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} target/junit/ \;
        name: Copy test artifacts
    - store_test_results:
        path: target/junit/
    - store_artifacts:
        path: target/junit/

    - deploy:
        command: mvn site -P report
        name: Building reports
    - store_artifacts:
        path: target/site/

    - save_cache:
        key: v1-{{ checksum "pom.xml" }}
        paths:
        - ~/.m2
version: 2
jobs:
  build:
    docker:
    - image: maven:3.5.0-jdk-8
    working_directory: ~/app
    steps:
    - checkout

    - restore_cache:
        keys:
        - v1-{{ checksum "pom.xml" }}
        - v1-
        paths:
        - ~/.m2

    - run:
        name: Create test properties file
        command: |
          mkdir -p target/test-classes
          cd target/test-classes
          if [ ! -f gplaymusic.properties ]; then
              printf "auth.username=${auth_username}\n" >> gplaymusic.properties
              printf "auth.password=${auth_password}\n" >> gplaymusic.properties
              printf "auth.android_id=${auth_android_id}\n" >> gplaymusic.properties
              printf "auth.token=${auth_token}\n" >> gplaymusic.properties
          fi

    - run:
        command: mvn test
        name: Running unit tests
        when: always
    - deploy:
        command: |
          mkdir -p target/junit/
          find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} target/junit/ \;
        name: Copy test artifacts
    - store_test_results:
        path: target/junit/
    - store_artifacts:
        path: target/junit/

    - deploy:
        command: mvn site -P report
        name: Building reports
    - store_artifacts:
        path: target/site/

    - save_cache:
        key: v1-{{ checksum "pom.xml" }}
        paths:
        - ~/.m2
Add missing line breaks to property file creation
Add missing line breaks to property file creation

