github.com/turbot/steampipe@v1.7.0-rc.0.0.20240517123944-7cef272d4458/tests/acceptance/run-linux-arm.sh (about)

     1  #!/bin/bash -e
     2  
     3  #function that makes the script exit, if any command fails
     4  exit_if_failed () {
     5  if [ $? -ne 0 ]
     6  then
     7    exit 1
     8  fi
     9  }
    10  
    11  echo "Check arch and export GOROOT & GOPATH"
    12  uname -m
    13  export GOROOT=/usr/local/go
    14  export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
    15  echo ""
    16  
    17  echo "Check go version"
    18  go version
    19  exit_if_failed
    20  echo ""
    21  
    22  echo "remove existing .steampipe install dir(if any)"
    23  rm -rf ~/.steampipe
    24  
    25  echo "Checkout to cloned steampipe repo"
    26  cd steampipe
    27  pwd
    28  echo ""
    29  
    30  echo "git reset"
    31  git reset
    32  exit_if_failed
    33  echo ""
    34  
    35  echo "git restore all changed files(if any)"
    36  git restore .
    37  exit_if_failed
    38  echo ""
    39  
    40  echo "git pull origin main"
    41  git checkout main
    42  git pull origin main
    43  exit_if_failed
    44  echo ""
    45  
    46  echo "delete all existing local branches"
    47  git branch | grep -v "main" | xargs git branch -D
    48  exit_if_failed
    49  echo ""
    50  
    51  echo "git fetch"
    52  git fetch
    53  exit_if_failed
    54  echo ""
    55  
    56  echo "git checkout <branch>"
    57  input=$1
    58  echo $input
    59  git checkout $input
    60  git branch --list
    61  exit_if_failed
    62  echo ""
    63  
    64  echo "build steampipe and set PATH"
    65  go build -o ~/bin/steampipe
    66  exit_if_failed
    67  export PATH=$PATH:/home/ubuntu/bin
    68  steampipe -v
    69  exit_if_failed
    70  echo ""
    71  
    72  echo "install steampipe and test pre-requisites"
    73  steampipe service start
    74  steampipe plugin install chaos chaosdynamic --progress=false
    75  steampipe service stop
    76  exit_if_failed
    77  echo ""
    78  
    79  echo "run acceptance tests"
    80  ./tests/acceptance/run.sh
    81  exit_if_failed
    82  echo ""
    83  
    84  echo "Hallelujah!"
    85  exit 0