Skip to content

Commit fc8815d

Browse files
Config format V2 (#42)
1 parent 4b51a8d commit fc8815d

File tree

111 files changed

+2956
-743
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+2956
-743
lines changed

.gitignore

Lines changed: 152 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,166 @@
1-
# Created by https://www.toptal.com/developers/gitignore/api/nextjs
2-
# Edit at https://www.toptal.com/developers/gitignore?templates=nextjs
1+
# Created by https://www.toptal.com/developers/gitignore/api/yarn,node
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=yarn,node
33

4-
### NextJS ###
5-
# dependencies
6-
/node_modules
7-
/.pnp
8-
.pnp.js
4+
### Node ###
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
lerna-debug.log*
12+
.pnpm-debug.log*
913

10-
# testing
11-
/coverage
14+
# Diagnostic reports (https://nodejs.org/api/report.html)
15+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
1216

13-
# next.js
14-
/.next/
15-
/out/
17+
# Runtime data
18+
pids
19+
*.pid
20+
*.seed
21+
*.pid.lock
1622

17-
# production
18-
/build
23+
# Directory for instrumented libs generated by jscoverage/JSCover
24+
lib-cov
1925

20-
# misc
21-
.DS_Store
22-
*.pem
26+
# Coverage directory used by tools like istanbul
27+
coverage
28+
*.lcov
2329

24-
# debug
25-
npm-debug.log*
26-
yarn-debug.log*
27-
yarn-error.log*
28-
.pnpm-debug.log*
30+
# nyc test coverage
31+
.nyc_output
32+
33+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
34+
.grunt
35+
36+
# Bower dependency directory (https://bower.io/)
37+
bower_components
2938

30-
# local env files
31-
.env*.local
39+
# node-waf configuration
40+
.lock-wscript
3241

33-
# vercel
34-
.vercel
42+
# Compiled binary addons (https://nodejs.org/api/addons.html)
43+
build/Release
3544

36-
# typescript
45+
# Dependency directories
46+
node_modules/
47+
jspm_packages/
48+
49+
# Snowpack dependency directory (https://snowpack.dev/)
50+
web_modules/
51+
52+
# TypeScript cache
3753
*.tsbuildinfo
38-
next-env.d.ts
3954

40-
# End of https://www.toptal.com/developers/gitignore/api/nextjs
55+
# Optional npm cache directory
56+
.npm
57+
58+
# Optional eslint cache
59+
.eslintcache
60+
61+
# Optional stylelint cache
62+
.stylelintcache
63+
64+
# Microbundle cache
65+
.rpt2_cache/
66+
.rts2_cache_cjs/
67+
.rts2_cache_es/
68+
.rts2_cache_umd/
69+
70+
# Optional REPL history
71+
.node_repl_history
72+
73+
# Output of 'npm pack'
74+
*.tgz
75+
76+
# Yarn Integrity file
77+
.yarn-integrity
78+
79+
# dotenv environment variable files
80+
.env
81+
.env.development.local
82+
.env.test.local
83+
.env.production.local
84+
.env.local
85+
86+
# parcel-bundler cache (https://parceljs.org/)
87+
.cache
88+
.parcel-cache
89+
90+
# Next.js build output
91+
.next
92+
out
93+
94+
# Nuxt.js build / generate output
95+
.nuxt
96+
dist
97+
98+
# Gatsby files
99+
.cache/
100+
# Comment in the public line in if your project uses Gatsby and not Next.js
101+
# https://nextjs.org/blog/next-9-1#public-directory-support
102+
# public
103+
104+
# vuepress build output
105+
.vuepress/dist
106+
107+
# vuepress v2.x temp and cache directory
108+
.temp
109+
110+
# Docusaurus cache and generated files
111+
.docusaurus
112+
113+
# Serverless directories
114+
.serverless/
115+
116+
# FuseBox cache
117+
.fusebox/
118+
119+
# DynamoDB Local files
120+
.dynamodb/
121+
122+
# TernJS port file
123+
.tern-port
124+
125+
# Stores VSCode versions used for testing VSCode extensions
126+
.vscode-test
127+
128+
# yarn v2
129+
.yarn/cache
130+
.yarn/unplugged
131+
.yarn/build-state.yml
132+
.yarn/install-state.gz
133+
.pnp.*
134+
135+
### Node Patch ###
136+
# Serverless Webpack directories
137+
.webpack/
138+
139+
# Optional stylelint cache
140+
141+
# SvelteKit build / generate output
142+
.svelte-kit
143+
144+
### yarn ###
145+
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
146+
147+
.yarn/*
148+
!.yarn/releases
149+
!.yarn/patches
150+
!.yarn/plugins
151+
!.yarn/sdks
152+
!.yarn/versions
153+
154+
# if you are NOT using Zero-installs, then:
155+
# comment the following lines
156+
!.yarn/cache
157+
158+
# and uncomment the following lines
159+
# .pnp.*
160+
161+
# End of https://www.toptal.com/developers/gitignore/api/yarn,node
41162

42163
.sourcebot
43164
/bin
44-
/config.json
165+
/config.json
166+
.DS_Store

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"files.associations": {
3+
"*.json": "jsonc",
4+
"index.json": "json"
5+
}
6+
}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- [**Breaking Change**] Added index schema v2. This new schema brings many quality of life features like clearer syntax, ability to specify individual `repos`, `projects`, `groups`, and `orgs`, and the ability to easily `exclude` repositories.
1213
- Added a `SOURCEBOT_VERSION` build argument to the Docker image. ([#41](https://github.com/sourcebot-dev/sourcebot/pull/41))
1314
- Added the `sourcebot_version` property to all PostHog events for versioned telemetry. ([#41](https://github.com/sourcebot-dev/sourcebot/pull/41)
1415

Dockerfile

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,29 @@ RUN CGO_ENABLED=0 GOOS=linux go build -o /cmd/ ./cmd/...
1414
FROM node-alpine AS web-builder
1515
RUN apk add --no-cache libc6-compat
1616
WORKDIR /app
17+
1718
COPY package.json yarn.lock* ./
19+
COPY ./packages/web ./packages/web
1820

1921
# Fixes arm64 timeouts
2022
RUN yarn config set registry https://registry.npmjs.org/
2123
RUN yarn config set network-timeout 1200000
22-
RUN yarn --frozen-lockfile
23-
COPY . .
24+
RUN yarn workspace @sourcebot/web install --frozen-lockfile
2425
ENV NEXT_TELEMETRY_DISABLED=1
2526
# @see: https://phase.dev/blog/nextjs-public-runtime-variables/
2627
ARG NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED=BAKED_NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED
2728
ARG NEXT_PUBLIC_SOURCEBOT_VERSION=BAKED_NEXT_PUBLIC_SOURCEBOT_VERSION
28-
RUN yarn run build
29+
RUN yarn workspace @sourcebot/web build
30+
31+
# ------ Build Backend ------
32+
FROM node-alpine AS backend-builder
33+
WORKDIR /app
34+
35+
COPY package.json yarn.lock* ./
36+
COPY ./schemas ./schemas
37+
COPY ./packages/backend ./packages/backend
38+
RUN yarn workspace @sourcebot/backend install --frozen-lockfile
39+
RUN yarn workspace @sourcebot/backend build
2940

3041
# ------ Runner ------
3142
FROM node-alpine AS runner
@@ -40,8 +51,8 @@ ARG SOURCEBOT_VERSION=unknown
4051
ENV SOURCEBOT_VERSION=$SOURCEBOT_VERSION
4152
RUN echo "Sourcebot Version: $SOURCEBOT_VERSION"
4253

43-
ENV GITHUB_HOSTNAME=github.com
44-
ENV GITLAB_HOSTNAME=gitlab.com
54+
# Valid values are: debug, info, warn, error
55+
ENV SOURCEBOT_LOG_LEVEL=info
4556

4657
# @note: This is also set in .env
4758
ENV NEXT_PUBLIC_POSTHOG_KEY=phc_VFn4CkEGHRdlVyOOw8mfkoj1DKVoG6y1007EClvzAnS
@@ -50,7 +61,7 @@ ENV NEXT_PUBLIC_POSTHOG_KEY=phc_VFn4CkEGHRdlVyOOw8mfkoj1DKVoG6y1007EClvzAnS
5061
# ENV SOURCEBOT_TELEMETRY_DISABLED=1
5162

5263
# Configure dependencies
53-
RUN apk add --no-cache git ca-certificates bind-tools tini jansson wget supervisor uuidgen curl
64+
RUN apk add --no-cache git ca-certificates bind-tools tini jansson wget supervisor uuidgen curl perl
5465

5566
# Configure zoekt
5667
COPY vendor/zoekt/install-ctags-alpine.sh .
@@ -68,12 +79,17 @@ COPY --from=zoekt-builder \
6879
/usr/local/bin/
6980

7081
# Configure the webapp
71-
COPY --from=web-builder /app/public ./public
72-
RUN mkdir .next
73-
COPY --from=web-builder /app/.next/standalone ./
74-
COPY --from=web-builder /app/.next/static ./.next/static
82+
COPY --from=web-builder /app/packages/web/public ./packages/web/public
83+
COPY --from=web-builder /app/packages/web/.next/standalone ./
84+
COPY --from=web-builder /app/packages/web/.next/static ./packages/web/.next/static
85+
86+
# Configure the backend
87+
COPY --from=backend-builder /app/node_modules ./node_modules
88+
COPY --from=backend-builder /app/packages/backend ./packages/backend
7589

7690
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
91+
COPY prefix-output.sh ./prefix-output.sh
92+
RUN chmod +x ./prefix-output.sh
7793
COPY entrypoint.sh ./entrypoint.sh
7894
RUN chmod +x ./entrypoint.sh
7995

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,17 @@ ui:
99
zoekt:
1010
mkdir -p bin
1111
go build -C vendor/zoekt -o $(PWD)/bin ./cmd/...
12+
export PATH=$(PWD)/bin:$(PATH)
13+
export CTAGS_COMMANDS=ctags
1214

1315
clean:
14-
rm -rf bin node_modules .next .sourcebot
16+
rm -rf \
17+
bin \
18+
node_modules \
19+
packages/web/node_modules \
20+
packages/web/.next \
21+
packages/backend/dist \
22+
packages/backend/node_modules \
23+
.sourcebot
1524

1625
.PHONY: bin

0 commit comments

Comments
 (0)