Skip to content

Commit 7d06058

Browse files
authored
Merge branch 'master' into feature/bin-tests
2 parents d5b3d2a + 63dcc86 commit 7d06058

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737

3838
before_deploy:
3939
- make packages
40+
- echo "${TRAVIS_TAG}" > version.txt
4041
- make docker-push-latest-release
4142

4243
deploy:

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
#================================
22
# Stage 1: Build Gitbase
33
#================================
4-
FROM golang:1.11-alpine as gitbase-build
4+
FROM golang:1.11-alpine as builder
55

66
ENV GITBASE_REPO=github.com/src-d/gitbase
77
ENV GITBASE_PATH=$GOPATH/src/$GITBASE_REPO
88

9+
RUN apk add --no-cache git
10+
911
COPY . $GITBASE_PATH
1012
WORKDIR $GITBASE_PATH
11-
RUN go build -ldflags="-s -w" -o /bin/gitbase ./cmd/gitbase
13+
RUN go build -ldflags="-X main.version=$(cat version.txt || echo "undefined") -X main.build=$(date +"%m-%d-%Y_%H_%M_%S") -X main.commit=$(git rev-parse --short HEAD) -s -w" -o /bin/gitbase ./cmd/gitbase
1214

1315
#=================================
1416
# Stage 2: Start Gitbase Server
@@ -28,7 +30,7 @@ RUN chmod +x /tini
2830
ENTRYPOINT ["/tini", "--"]
2931

3032
# copy build artifacts
31-
COPY --from=gitbase-build /bin/gitbase /bin/gitbase
33+
COPY --from=builder /bin/gitbase /bin/gitbase
3234

3335
CMD /bin/gitbase server -v \
3436
--host=0.0.0.0 \

_testdata/regression.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
---
22
-
3-
ID: 'query0'
3+
ID: 'query00'
44
Name: 'All commits'
55
Statements:
66
- SELECT * FROM commits
77
-
8-
ID: 'query1'
8+
ID: 'query01'
99
Name: 'Last commit messages in HEAD for every repository'
1010
Statements:
1111
- SELECT c.commit_message FROM refs r JOIN commits c ON r.commit_hash = c.commit_hash WHERE r.ref_name = 'HEAD'
1212
-
13-
ID: 'query2'
13+
ID: 'query02'
1414
Name: 'All commit messages in HEAD history for every repository'
1515
Statements:
1616
- SELECT c.commit_message FROM commits c NATURAL JOIN ref_commits r WHERE r.ref_name = 'HEAD'
1717
-
18-
ID: 'query3'
18+
ID: 'query03'
1919
Name: 'Top 10 repositories by commit count in HEAD'
2020
Statements:
2121
- SELECT repository_id,commit_count FROM (SELECT r.repository_id,count(*) AS commit_count FROM ref_commits r WHERE r.ref_name = 'HEAD' GROUP BY r.repository_id) AS q ORDER BY commit_count DESC LIMIT 10
2222
-
23-
ID: 'query4'
23+
ID: 'query04'
2424
Name: 'Top 10 repositories by contributor count (all branches)'
2525
Statements:
2626
- SELECT repository_id,contributor_count FROM (SELECT repository_id, COUNT(DISTINCT commit_author_email) AS contributor_count FROM commits GROUP BY repository_id) AS q ORDER BY contributor_count DESC LIMIT 10
2727
-
28-
ID: 'query6'
28+
ID: 'query06'
2929
Name: 'Create pilosa index on language UDF'
3030
Statements:
3131
- CREATE INDEX language_idx ON files USING pilosa (language(file_path, blob_content)) WITH (async = false)
3232
- DROP INDEX language_idx ON files
3333
-
34-
ID: 'query8'
34+
ID: 'query08'
3535
Name: 'Query by language using the pilosa index'
3636
Statements:
3737
- CREATE INDEX language_idx ON files USING pilosa (language(file_path, blob_content)) WITH (async = false)
3838
- SELECT file_path FROM files WHERE language(file_path, blob_content) = 'Go'
3939
- DROP INDEX language_idx ON files
4040
-
41-
ID: 'query9'
41+
ID: 'query09'
4242
Name: 'Query all files from HEAD'
4343
Statements:
4444
- SELECT cf.file_path, f.blob_content FROM ref_commits r NATURAL JOIN commit_files cf NATURAL JOIN files f WHERE r.ref_name = 'HEAD' AND r.history_index = 0

0 commit comments

Comments
 (0)