Skip to content

Commit 185136c

Browse files
author
Pawan Rawal
committed
Add v0.8.2 to docs and add bulkloader to the list of binaries.
1 parent ea1fa3f commit 185136c

File tree

8 files changed

+35
-13
lines changed

8 files changed

+35
-13
lines changed

cmd/bulkloader/loader.go

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ type options struct {
3232
SkipMapPhase bool
3333
CleanupTmp bool
3434
NumShufflers int
35+
Version bool
3536

3637
MapShards int
3738
ReduceShards int

cmd/bulkloader/main.go

+4
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,17 @@ func main() {
4545
flag.IntVar(&opt.NumShufflers, "shufflers", 1, "Number of shufflers to run concurrently.")
4646
flag.IntVar(&opt.MapShards, "map_shards", 1, "Number of map output shards.")
4747
flag.IntVar(&opt.ReduceShards, "reduce_shards", 1, "Number of shuffle output shards.")
48+
flag.BoolVar(&opt.Version, "version", false, "Prints the version of bulkloader.")
4849

4950
flag.Parse()
5051
if len(flag.Args()) != 0 {
5152
flag.Usage()
5253
fmt.Fprintf(os.Stderr, "No free args allowed, but got: %v\n", flag.Args())
5354
os.Exit(1)
5455
}
56+
if opt.Version {
57+
x.PrintVersionOnly()
58+
}
5559
if opt.RDFDir == "" || opt.SchemaFile == "" {
5660
flag.Usage()
5761
fmt.Fprint(os.Stderr, "RDF and schema file(s) must be specified.\n")

cmd/dgraph/main.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ func setupConfigOpts() {
168168
}
169169
// Lets check version flag before we SetConfiguration because we validate AllottedMemory in
170170
// SetConfiguration.
171-
x.PrintVersionOnly()
171+
if x.Config.Version {
172+
x.PrintVersionOnly()
173+
}
172174

173175
dgraph.SetConfiguration(config)
174176
}

cmd/dgraphloader/main.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ var (
6161
tlsSystemCACerts = flag.Bool("tls.use_system_ca", false, "Include System CA into CA Certs.")
6262
tlsMinVersion = flag.String("tls.min_version", "TLS11", "TLS min version.")
6363
tlsMaxVersion = flag.String("tls.max_version", "TLS12", "TLS max version.")
64+
version = flag.Bool("version", false, "Prints the version of Dgraphloader")
6465
)
6566

6667
// Reads a single line from a buffered reader. The line is read into the
@@ -251,7 +252,9 @@ func fileList(files string) []string {
251252

252253
func main() {
253254
flag.Parse()
254-
x.Init()
255+
if *version {
256+
x.PrintVersionOnly()
257+
}
255258
runtime.SetBlockProfileRate(*blockRate)
256259

257260
interruptChan := make(chan os.Signal)

contrib/compile.sh

+5
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,9 @@ cd $dgraph_cmd/dgraphloader && \
2525
go build -ldflags \
2626
"-X $release=$release_version -X $branch=$gitBranch -X $commitSHA1=$lastCommitSHA1 -X '$commitTime=$lastCommitTime'" .;
2727

28+
echo "bulkloader"
29+
cd $dgraph_cmd/bulkloader && \
30+
go build -ldflags \
31+
"-X $release=$release_version -X $branch=$gitBranch -X $commitSHA1=$lastCommitSHA1 -X '$commitTime=$lastCommitTime'" .;
32+
2833

contrib/releases/build.sh

+12-4
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,25 @@ uiDir="main.uiDir"
4848
echo -e "\033[1;33mBuilding binaries\033[0m"
4949
echo "dgraph"
5050
cd $dgraph_cmd/dgraph && \
51-
go build -v -ldflags \
51+
go build -ldflags \
5252
"-X $release=$release_version -X $branch=$gitBranch -X $commitSHA1=$lastCommitSHA1 -X '$commitTime=$lastCommitTime' -X $uiDir=$ui" .;
5353
echo "dgraphloader"
5454
cd $dgraph_cmd/dgraphloader && \
55-
go build -v -ldflags \
55+
go build -ldflags \
5656
"-X $release=$release_version -X $branch=$gitBranch -X $commitSHA1=$lastCommitSHA1 -X '$commitTime=$lastCommitTime'" .;
57+
echo "bulkloader"
58+
cd $dgraph_cmd/bulkloader && \
59+
go build -ldflags \
60+
"-X $release=$release_version -X $branch=$gitBranch -X $commitSHA1=$lastCommitSHA1 -X '$commitTime=$lastCommitTime'" .;
61+
5762

5863
echo -e "\n\033[1;33mCopying binaries to tmp folder\033[0m"
5964
cd $tmp_dir;
6065
mkdir dgraph && pushd &> /dev/null dgraph;
6166
# Stripping the binaries.
62-
strip $dgraph_cmd/dgraph/dgraph $dgraph_cmd/dgraphloader/dgraphloader;
63-
cp $dgraph_cmd/dgraph/dgraph $dgraph_cmd/dgraphloader/dgraphloader .;
67+
strip $dgraph_cmd/dgraph/dgraph $dgraph_cmd/dgraphloader/dgraphloader \
68+
$dgraph_cmd/bulkloader/bulkloader;
69+
cp $dgraph_cmd/dgraph/dgraph $dgraph_cmd/dgraphloader/dgraphloader $dgraph_cmd/bulkloader/bulkloader .;
6470

6571
echo -e "\n\033[1;34mSize of files after strip: $(du -sh)\033[0m"
6672

@@ -76,6 +82,8 @@ checksum=$($digest_cmd dgraph | awk '{print $1}')
7682
echo "$checksum /usr/local/bin/dgraph" >> $checksum_file
7783
checksum=$($digest_cmd dgraphloader | awk '{print $1}')
7884
echo "$checksum /usr/local/bin/dgraphloader" >> $checksum_file
85+
checksum=$($digest_cmd bulkloader | awk '{print $1}')
86+
echo "$checksum /usr/local/bin/bulkloader" >> $checksum_file
7987

8088
echo -e "\n\033[1;33mCreating tar file\033[0m"
8189
tar_file=dgraph-"$platform"-amd64-$release_version

wiki/scripts/build.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ HOST=https://docs.dgraph.io
1919
# append '(latest)' to the version string, and build script can place the
2020
# artifact in an appropriate location
2121
VERSIONS_ARRAY=(
22-
'v0.8.1'
22+
'v0.8.2'
2323
'master'
24+
'v0.8.1'
2425
'v0.8.0'
2526
'v0.7.7'
2627
'v0.7.6'

x/init.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,15 @@ Branch : %v`,
9191

9292
// PrintVersionOnly prints version and other helpful information if --version.
9393
func PrintVersionOnly() {
94-
if Config.Version {
95-
printBuildDetails()
96-
fmt.Println("Copyright 2017 Dgraph Labs, Inc.")
97-
fmt.Println(`
94+
printBuildDetails()
95+
fmt.Println("Copyright 2017 Dgraph Labs, Inc.")
96+
fmt.Println(`
9897
Licensed under AGPLv3.
9998
For Dgraph official documentation, visit https://docs.dgraph.io.
10099
For discussions about Dgraph , visit https://discuss.dgraph.io.
101100
To say hi to the community , visit https://dgraph.slack.com.
102101
`)
103-
os.Exit(0)
104-
}
102+
os.Exit(0)
105103
}
106104

107105
func Version() string {

0 commit comments

Comments
 (0)