storj.io/minio@v0.0.0-20230509071714-0cbc90f649b1/mint/run/core/awscli/run.sh (about)

     1  #!/bin/bash
     2  #
     3  #  Mint (C) 2017 Minio, Inc.
     4  #
     5  #  Licensed under the Apache License, Version 2.0 (the "License");
     6  #  you may not use this file except in compliance with the License.
     7  #  You may obtain a copy of the License at
     8  #
     9  #      http://www.apache.org/licenses/LICENSE-2.0
    10  #
    11  #  Unless required by applicable law or agreed to in writing, software
    12  #  distributed under the License is distributed on an "AS IS" BASIS,
    13  #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  #  See the License for the specific language governing permissions and
    15  #  limitations under the License.
    16  #
    17  
    18  # handle command line arguments
    19  if [ $# -ne 2 ]; then
    20      echo "usage: run.sh <OUTPUT-LOG-FILE> <ERROR-LOG-FILE>"
    21      exit 1
    22  fi
    23  
    24  output_log_file="$1"
    25  error_log_file="$2"
    26  
    27  # configure awscli
    28  aws configure set aws_access_key_id "$ACCESS_KEY"
    29  aws configure set aws_secret_access_key "$SECRET_KEY"
    30  aws configure set default.region "$SERVER_REGION"
    31  
    32  # run tests for virtual style if provided
    33  if [ "$ENABLE_VIRTUAL_STYLE" -eq 1 ]; then
    34     # Setup endpoint scheme
    35     endpoint="http://$DOMAIN:$SERVER_PORT"
    36     if [ "$ENABLE_HTTPS" -eq 1 ]; then
    37         endpoint="https://$DOMAIN:$SERVER_PORT"
    38     fi
    39     dnsmasq --address="/$DOMAIN/$SERVER_IP" --user=root
    40     echo -e "nameserver 127.0.0.1\n$(cat /etc/resolv.conf)" > /etc/resolv.conf
    41     aws configure set default.s3.addressing_style virtual
    42     ./test.sh "$endpoint"  1>>"$output_log_file" 2>"$error_log_file"
    43     aws configure set default.s3.addressing_style path
    44  fi
    45  
    46  endpoint="http://$SERVER_ENDPOINT"
    47  if [ "$ENABLE_HTTPS" -eq 1 ]; then
    48      endpoint="https://$SERVER_ENDPOINT"
    49  fi
    50  # run path style tests
    51  ./test.sh "$endpoint"  1>>"$output_log_file" 2>"$error_log_file"