fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

ci: add shellcheck step (#316)

+14 -55
+11 -1
.github/workflows/ci.yml
··· 18 18 - name: test 19 19 run: go test ./... 20 20 21 + shellcheck: 22 + name: shellcheck 23 + runs-on: ubuntu-latest 24 + steps: 25 + - uses: actions/checkout@v2 26 + - name: Run ShellCheck 27 + uses: ludeeus/action-shellcheck@1.1.0 28 + 21 29 # We build a shared docker image called "zoekt". This is not pushed, but is 22 30 # used for creating the indexserver and webserver images. 23 31 docker: 24 32 if: github.ref == 'refs/heads/master' 25 33 runs-on: ubuntu-latest 26 - needs: test 34 + needs: 35 + - "test" 36 + - "shellcheck" 27 37 steps: 28 38 - name: checkout 29 39 uses: actions/checkout@v2
-51
build-deploy.sh
··· 1 - #!/bin/bash 2 - 3 - # this script packages up all the binaries, and a script (deploy.sh) 4 - # to twiddle with the server and the binaries 5 - 6 - set -ex 7 - 8 - # Put the date first so we can sort. 9 - if [[ -z "$VERSION" ]]; then 10 - VERSION=$(date --iso-8601=minutes | tr -d ':' | sed 's|\+.*$||') 11 - if [[ -d .git ]]; then 12 - VERSION=${VERSION}-$(git show --pretty=format:%h -q) 13 - fi 14 - fi 15 - 16 - set -u 17 - 18 - out=zoekt-${VERSION} 19 - mkdir -p ${out} 20 - 21 - for d in $(find cmd -maxdepth 1 -type d) 22 - do 23 - go build -tags netgo -ldflags "-X github.com/google/zoekt.Version=$VERSION" -o ${out}/$(basename $d) github.com/google/zoekt/$d 24 - done 25 - 26 - cat <<EOF > ${out}/deploy.sh 27 - #!/bin/bash 28 - 29 - echo "Set the following in the environment." 30 - echo "" 31 - echo ' export PATH="'$PWD'/bin:$PATH' 32 - echo "" 33 - 34 - set -eux 35 - 36 - # Allow sandbox to create NS's 37 - sudo sh -c 'echo 1 > /proc/sys/kernel/unprivileged_userns_clone' 38 - 39 - # we mmap the entire index, but typically only want the file contents. 40 - sudo sh -c 'echo 1 >/proc/sys/vm/overcommit_memory' 41 - 42 - # allow bind to 80 and 443 43 - sudo setcap 'cap_net_bind_service=+ep' bin/zoekt-webserver 44 - 45 - EOF 46 - 47 - chmod 755 ${out}/* 48 - 49 - tar --owner=root --group=root -czf zoekt-deploy-${VERSION}.tar.gz ${out}/* 50 - 51 - rm -rf ${out}
+1 -1
indexbuilder.go
··· 37 37 data []byte 38 38 } 39 39 40 - // Filled by the linker (see build-deploy.sh) 40 + // Filled by the linker 41 41 var Version string 42 42 43 43 // Store character (unicode codepoint) offset (in bytes) this often.
+2 -2
testdata/gen-shards.sh
··· 11 11 12 12 rm -rf repo17 repo17_v16.00000.zoekt zoekt-builder-shard-log.tsv 13 13 14 - mv *.zoekt shards/ 14 + mv ./*.zoekt shards/ 15 15 16 16 # generate repo2.v16.0000.zoekt 17 17 go run ../cmd/zoekt-index repo2 18 18 rm zoekt-builder-shard-log.tsv 19 - mv *.zoekt shards/ 19 + mv ./*.zoekt shards/