github.com/wfusion/gofusion@v1.1.14/common/infra/watermill/docs/build.sh (about)

     1  #!/bin/bash
     2  set -e -x
     3  
     4  cd "$(dirname "$0")"
     5  
     6  if [[ ! -d themes/kube ]]; then
     7      mkdir -p themes/kube && pushd themes/kube
     8      git init
     9      git remote add origin https://github.com/jeblister/kube
    10      git fetch --depth 1 origin 1507abea527aecd896fdc306dfd28ee3e34f01ec
    11      git checkout FETCH_HEAD
    12      popd
    13  fi
    14  
    15  function cloneOrPull() {
    16      if [[ -d "$2" ]]
    17      then
    18          pushd $2
    19          git pull
    20          popd
    21      else
    22          git clone --single-branch $1 $2
    23      fi
    24  }
    25  
    26  if [[ "$1" == "--copy" ]]; then
    27      rm content/src-link -r || true
    28      mkdir content/src-link/
    29      cp ../message/ content/src-link/ -r
    30      cp ../pubsub/ content/src-link/ -r
    31      cp ../_examples/ content/src-link/ -r
    32      cp ../components/ content/src-link/ -r
    33  else
    34      declare -a files_to_link=(
    35          "_examples"
    36  
    37          "message/decorator.go"
    38          "message/message.go"
    39          "message/pubsub.go"
    40          "message/router.go"
    41          "message/router_context.go"
    42          "pubsub/gochannel/pubsub.go"
    43  
    44          "components/cqrs/command_bus.go"
    45          "components/cqrs/command_processor.go"
    46          "components/cqrs/command_handler.go"
    47  
    48          "components/cqrs/event_bus.go"
    49          "components/cqrs/event_processor.go"
    50          "components/cqrs/event_processor_group.go"
    51          "components/cqrs/event_handler.go"
    52  
    53          "components/cqrs/marshaler.go"
    54          "components/cqrs/cqrs.go"
    55          "components/cqrs/marshaler.go"
    56  
    57          "components/metrics/builder.go"
    58          "components/metrics/http.go"
    59  
    60          "components/fanin/fanin.go"
    61      )
    62  
    63      pushd ../
    64      for i in "${files_to_link[@]}"
    65      do
    66          DIR=$(dirname "${i}")
    67          DEST_DIR="docs/content/src-link/${DIR}"
    68  
    69          mkdir -p "${DEST_DIR}"
    70          ln -sf "$PWD/${i}" "$PWD/${DEST_DIR}"
    71      done
    72      popd
    73  fi
    74  
    75  cloneOrPull "https://github.com/ThreeDotsLabs/watermill-amqp.git" content/src-link/watermill-amqp
    76  cloneOrPull "https://github.com/ThreeDotsLabs/watermill-googlecloud.git" content/src-link/watermill-googlecloud
    77  cloneOrPull "https://github.com/ThreeDotsLabs/watermill-http.git" content/src-link/watermill-http
    78  cloneOrPull "https://github.com/ThreeDotsLabs/watermill-io.git" content/src-link/watermill-io
    79  cloneOrPull "https://github.com/ThreeDotsLabs/watermill-kafka.git" content/src-link/watermill-kafka
    80  cloneOrPull "https://github.com/ThreeDotsLabs/watermill-nats.git" content/src-link/watermill-nats
    81  cloneOrPull "https://github.com/ThreeDotsLabs/watermill-sql.git" content/src-link/watermill-sql
    82  cloneOrPull "https://github.com/ThreeDotsLabs/watermill-firestore.git" content/src-link/watermill-firestore
    83  cloneOrPull "https://github.com/ThreeDotsLabs/watermill-bolt.git" content/src-link/watermill-bolt
    84  cloneOrPull "https://github.com/ThreeDotsLabs/watermill-redisstream.git" content/src-link/watermill-redisstream
    85  
    86  
    87  python3 ./extract_middleware_godocs.py > content/src-link/middleware-defs.md
    88  
    89  hugo --gc --minify