forked from pixie-io/pixie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to collect and upload lsif data from Jenkins
Summary: TSIA. This will collect and upload lsif data for `go` and `typescript` Test Plan: Jenkins Reviewers: zasgar, michelle, #engineering Reviewed By: zasgar, #engineering Differential Revision: https://phab.corp.pixielabs.ai/D6868 GitOrigin-RevId: f6ddce9
- Loading branch information
Showing
3 changed files
with
94 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,4 +66,5 @@ compile_commands.json | |
clang_tidy.log | ||
|
||
# LSIF data for code intel | ||
dump.lsif | ||
*.dump.lsif | ||
dump.lsif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/bash -ex | ||
|
||
SOURCEGRAPH_ENDPOINT="https://cs.corp.pixielabs.ai" | ||
|
||
GIT_COMMIT="" | ||
SOURCEGRAPH_ACCESS_TOKEN="" | ||
|
||
# Print out the usage information and exit. | ||
usage() { | ||
echo "Usage $0 [-t <sourcegraph_token>] [-c <git_commit>]" 1>&2; | ||
exit 1; | ||
} | ||
|
||
parse_args() { | ||
local OPTIND | ||
# Process the command line arguments. | ||
while getopts "c:t:h" opt; do | ||
case ${opt} in | ||
c) | ||
GIT_COMMIT=$OPTARG | ||
;; | ||
t) | ||
SOURCEGRAPH_ACCESS_TOKEN=$OPTARG | ||
;; | ||
:) | ||
echo "Invalid option: $OPTARG requires an argument" 1>&2 | ||
;; | ||
h) | ||
usage | ||
;; | ||
*) | ||
usage | ||
;; | ||
esac | ||
done | ||
shift $((OPTIND -1)) | ||
} | ||
|
||
# Parse the input arguments. | ||
parse_args "$@" | ||
|
||
export SRC_ENDPOINT="${SOURCEGRAPH_ENDPOINT}" | ||
export SRC_ACCESS_TOKEN="${SOURCEGRAPH_ACCESS_TOKEN}" | ||
|
||
pushd "$(bazel info workspace)" | ||
|
||
LSIF_GO_OUT="go.dump.lsif" | ||
|
||
/opt/pixielabs/bin/lsif-go \ | ||
--verbose \ | ||
--no-animation \ | ||
--output="${LSIF_GO_OUT}" | ||
|
||
/opt/pixielabs/bin/src lsif upload \ | ||
-repo=github.com/pixie-labs/pixielabs \ | ||
-file="${LSIF_GO_OUT}" \ | ||
-commit="${GIT_COMMIT}" \ | ||
-ignore-upload-failure \ | ||
-no-progress | ||
|
||
LSIF_TS_OUT="ts.dump.lsif" | ||
|
||
lsif-tsc --out "${LSIF_TS_OUT}" -p src/ui | ||
|
||
/opt/pixielabs/bin/src lsif upload \ | ||
-repo=github.com/pixie-labs/pixielabs \ | ||
-file="${LSIF_TS_OUT}" \ | ||
-commit="${GIT_COMMIT}" \ | ||
-ignore-upload-failure \ | ||
-no-progress | ||
|
||
popd |