Condition for executing CI stage


Currently, when changing processing based on branch, it is necessary to respond with command.

      - type: deploy
        shell: /bin/bash
        command: |
          if [ "${CIRCLE_BRANCH}" == "staging" ];
            then ansible-playbook site.yml -i staging;

For example, it seems that conditions can be specified as follows.

      - type: deploy
        shell: /bin/bash
        command: ansible-playbook site.yml -i staging
        test: "[ "${CIRCLE_BRANCH}" == "staging" ]"

Since I often take branches as a condition, I think that it is also acceptable to have a branch name.


@shibayan, Can you share your Circle config to get ansible running? I have been struggling to get Ansible set up correctly in 2.0

closed #3