# sample circle.yml for IronMan-s3
machine:
  environment:
    #our docker registry
    docker_server: dochub.ironmann.io:5000
    # The `docker_image` environment variable will be used to give a name to
    # Docker images. (Docker registy only allows 0-9a-z_)
    # To run on your laptop, use :
    #     export CIRCLE_PROJECT_REPONAME=$(basename `git rev-parse --show-toplevel`)
    docker_image: ${CIRCLE_PROJECT_REPONAME,,}  # lowercase
    docker_tag: ${CIRCLE_SHA1:0:7}
  #we package the software through docker
  services:
    - docker

checkout:
  # we let circleci checkout the project quietly in the machine
  post:
    # checkout the IronMan-ci
    - git clone git@github.com:scality/IronMan-CI.git
    # place the file gathered from IronMan-CI where needed
    - mv IronMan-CI/deployment .
    - mv IronMan-CI/ci/matryoshka*  ./tests
    # we are in the project so we just copy the files where appropriate for building the docker image
    - bash  ./deployment/checkout-local.bash
    # move the ssh key to the project dir where the Dockerfile will consume them
    # (required for npm install / npm test during the docker image construction
    # to access the private repo)
    - cp -rp ~/.ssh ./deployment/checkout/project
    - sed -i "s/\/home\/ubuntu/\~/g" ./deployment/checkout/project/.ssh/config
    - chmod 600 ./deployment/checkout/project/.ssh/config

dependencies:
  override:
    # dependencies for testing with matryoshka
    - sudo pip install docker-py pyyaml flake8

test:
  override:
    # lint the python used for testing (node linting is done by the docker file)
    - flake8 $(git ls-files '*.py')
    # functional tests
    - bash ./tests/matryoshka-balance.sh ${docker_image} :
        parallel: true


# sample circle.yml for IronMan-s3
machine:
  environment:
    docker_image: ${CIRCLE_PROJECT_REPONAME,,}  # lowercase
    docker_tag: ${CIRCLE_SHA1:0:7}
  #we package the software through docker
  services:
    - docker

checkout:
  override:
    # checkout the IronMan-ci
    - git clone git@github.com:scality/IronMan-CI.git
    # place the file gathered from IronMan-CI where needed
    - mv IronMan-CI/deployment .
    - mv IronMan-CI/ci/matryoshka*  ./tests

dependencies:
  override:
    # dependencies for testing with matryoshka
    - sudo pip install docker-py pyyaml flake8

test:
  override:
    # lint the python used for testing (node linting is done by the docker file)
    - flake8 $(git ls-files '*.py')
    # functional tests
    - bash ./tests/matryoshka-balance.sh ${docker_image} :
        parallel: true


Clone through the docker image
fix(ci): Clone through the docker image

Since the CI now clones the repo directly in the docker image, we
do not need to prepare this ourselves.
