# Copyright 2018 Bitwise IO, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------------------------------------------------------

version: "2.1"

services:

  xo-tp-rust:
    build:
      context: ..
      dockerfile: ./examples/xo_rust/Dockerfile
      args:
        - http_proxy
        - https_proxy
        - no_proxy
    image: sawtooth-xo-tp-rust$INSTALL_TYPE:$ISOLATION_ID
    volumes:
      - $SAWTOOTH_SDK_RUST:/project/sawtooth-sdk-rust
    expose:
      - 4004
    environment:
      - RUST_BACKTRACE=1
    command: xo-tp-rust -C tcp://test-tp-xo-rust:4004 -vv
    stop_signal: SIGKILL

  test-tp-xo-rust:
    build:
      context: ..
      dockerfile: ./tests/python-sdk-tests.dockerfile
      args:
        - http_proxy
        - https_proxy
        - no_proxy
    image: python-sdk-tests:$ISOLATION_ID
    volumes:
      - $SAWTOOTH_SDK_RUST:/project/sawtooth-sdk-rust
    expose:
      - 4004
    command: nose2-3
        -c /project/sawtooth-sdk-rust/tests/nose2.cfg
        -v
        -s /project/sawtooth-sdk-rust/tests
        test_tp_xo --log-capture
    stop_signal: SIGKILL
    environment:
      TEST_BIND: "tcp://eth0:4004"
