gitlab.com/evatix-go/core@v1.3.55/scripts/docker-run-linux.sh (about)

     1  #!/bin/bash
     2  
     3  WorkDir="$PWD/.."
     4  BinDir=$WorkDir/bin
     5  
     6  echo ""
     7  echo " ---- [Start] Running all in docker [Start]-----"
     8  echo ""
     9  echo "Work dir     : $WorkDir"
    10  echo "Binaries dir : $BinDir"
    11  
    12  # docker run --rm -it -v "PWD":/usr/src/myapp -v "$GOPATH":/go -w /usr/src/myapp golang:1.17.8
    13  
    14  rm -rf "$BinDir"/results &&
    15    mkdir -p "$BinDir"/results &&
    16    chown -R root:root "$BinDir" &&
    17    chmod -R 777 "$BinDir" &&
    18    ls -la "$BinDir" &&
    19    echo "" &&
    20    docker run --rm -it -v "$WorkDir":/usr/src/myapp -v "$GOPATH":/go -w /usr/src/myapp golang:1.17.8 bash -c '
    21  ./bin/cli-linux-amd64 2>&1 | tee bin/results/linux-amd64.out && cat bin/results/linux-amd64.out
    22  ' &&
    23    echo "Running complete" &&
    24    echo "" &&
    25    echo "Output" &&
    26    echo "" &&
    27    echo "" &&
    28    echo "ls -la $BinDir/results" &&
    29    cat "$BinDir/results/linux-amd64.out" &&
    30    ls -lah "$BinDir/results" &&
    31    echo "$\"Path\":" &&
    32    echo "export PATH=\$PATH:\"$BinDir\"" &&
    33    echo "running : ${BinDir}/cli-linux-amd64" &&
    34    echo "" &&
    35    echo " ---- [End] Running in docker [end]-----" &&
    36    echo ""