version: 2
jobs:
  build:
    docker:
      - image: circleci/openjdk:8
    steps:
      - checkout
      - setup_remote_docker

      - run: ssh-keygen -t ecdsa -f id_rsa_test -N ''
      - run: docker-compose up -d
      - run: docker-compose ps

      - restore_cache:
          key: v1-gradle-{{ checksum "build.gradle" }}
          key: v1-gradle-
      - run: ./gradlew checkstyle
      - run: ./gradlew check --full-stacktrace
      - save_cache:
          paths:
            - "~/.gradle"
            - "~/.m2"
          key: v1-gradle-{{ checksum "build.gradle" }}

      - deploy:
          name: Push Gem to RubyGems.org and bump up
          command: |
            if [ "${CIRCLE_BRANCH}" == "release" ]; then
              curl -f -u $RUBYGEMS_USER:$RUBYGEMS_PASSWORD https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
              git config --global user.email "shiketaudonko41@gmail.com"
              git config --global user.name "kamatama41"
              git checkout master
              git reset --hard origin/master
              ./gradlew release -Prelease.useAutomaticVersion=true
            fi

version: 2
jobs:
  build:
    docker:
      - image: circleci/openjdk:8
    working_directory: ~/embulk-input-remote
    steps:
      - checkout
      - setup_remote_docker

      - run: ssh-keygen -t ecdsa -f id_rsa_test -N ''
      - run: docker-compose up -d
      - run: docker-compose ps

      - restore_cache:
          key: v1-gradle-{{ checksum "build.gradle" }}
          key: v1-gradle-
      - run: ./gradlew checkstyle
      - run: ./gradlew check --full-stacktrace
      - save_cache:
          paths:
            - "~/.gradle"
            - "~/.m2"
          key: v1-gradle-{{ checksum "build.gradle" }}

      - deploy:
          name: Push Gem to RubyGems.org and bump up
          command: |
            if [ "${CIRCLE_BRANCH}" == "release" ]; then
              curl -f -u $RUBYGEMS_USER:$RUBYGEMS_PASSWORD https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
              git config --global user.email "shiketaudonko41@gmail.com"
              git config --global user.name "kamatama41"
              git checkout master
              git reset --hard origin/master
              ./gradlew release -Prelease.useAutomaticVersion=true
            fi

Set working_directory to pass tests. It is needed to run docker containers with proper name.
Set working_directory to pass tests.
It is needed to run docker containers with proper name.
