machine:
    java:
        version: oraclejdk8
    post:
        - pyenv global 2.7.9 3.5.0 3.4.3 2.6.8
    environment:
        GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'

dependencies:
    override:
        - ./gradlew downloadDependencies --console plain

test:
    override:
        - ./gradlew build --console plain --max-workers 1 -Prelease=true

    post:
        - mkdir -p $CIRCLE_TEST_REPORTS/junit/
        - find . -type f -regex ".*/test-results/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;

deployment:
    master:
        branch: master
        commands:
            - ./gradlew versionBump -Prelease=true --console plain
            - ./gradlew artifactoryPublish distributeBuild -Prelease=true --max-workers 1 --console plain

machine:
    java:
        version: oraclejdk8
    post:
        - pyenv global 2.7.9 3.5.0 3.4.3 2.6.8
        - chmod --recursive a-w ~/.pyenv/versions #Builds fail when we have write permissions, so disableing it
    environment:
        GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'

dependencies:
    override:
        - ./gradlew downloadDependencies --console plain

test:
    override:
        - ./gradlew build --console plain --max-workers 1 -Prelease=true

    post:
        - mkdir -p $CIRCLE_TEST_REPORTS/junit/
        - find . -type f -regex ".*/test-results/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;

deployment:
    master:
        branch: master
        commands:
            - ./gradlew versionBump -Prelease=true --console plain
            - ./gradlew artifactoryPublish distributeBuild -Prelease=true --max-workers 1 --console plain

Disable write permissions on python venv
Disable write permissions on python venv

Without this it looks like there's an issue with the install of python
when we try to build a virtual env. I tested this by running the last
build in a ssh mode and ran this as quick as I could in the build.
