github.com/rohankumardubey/proxyfs@v0.0.0-20210108201508-653efa9ab00e/enmesh_in_gopath.sh (about)

     1  #!/bin/bash
     2  
     3  #  This script takes a clean checkout of the ProxyFS repo, turns it into a
     4  #  working directory (e.g., enmeshes it into src/github.com/swiftstack/Proxyfs)
     5  #  It is intended for use by CI/CD systems.
     6  
     7  set -e
     8  shopt -s extglob
     9  
    10  ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
    11  SWIFTSTACK_DIR=src/github.com/swiftstack
    12  REPO_CLONE_PARENT_DIR=$ROOT_DIR/$SWIFTSTACK_DIR
    13  PROXYFS_DIR=$REPO_CLONE_PARENT_DIR/ProxyFS
    14  
    15  if [ ! -d $PROXYFS_DIR ]; then
    16      cd $ROOT_DIR
    17      mkdir -p $PROXYFS_DIR
    18      mv !(ci.sh|src) $PROXYFS_DIR
    19  
    20      # Ensure that the enmeshed dir is still usable as a git repo
    21      mv .git* $PROXYFS_DIR
    22      cp ci.sh $PROXYFS_DIR
    23  fi