Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
dfd98d09
Commit
dfd98d09
authored
Dec 06, 2010
by
Devon H. O'Dell
Committed by
Andrew Gerrand
Dec 06, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder: Allow buildroot to be passed as command-line argument
R=adg CC=golang-dev
https://golang.org/cl/3473041
parent
dbcf79b4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
misc/dashboard/builder/main.go
misc/dashboard/builder/main.go
+9
-8
No files found.
misc/dashboard/builder/main.go
View file @
dfd98d09
...
@@ -37,6 +37,7 @@ type BenchRequest struct {
...
@@ -37,6 +37,7 @@ type BenchRequest struct {
}
}
var
(
var
(
buildroot
=
flag
.
String
(
"buildroot"
,
path
.
Join
(
os
.
TempDir
(),
"gobuilder"
),
"Directory under which to build"
)
dashboard
=
flag
.
String
(
"dashboard"
,
"godashboard.appspot.com"
,
"Go Dashboard Host"
)
dashboard
=
flag
.
String
(
"dashboard"
,
"godashboard.appspot.com"
,
"Go Dashboard Host"
)
runBenchmarks
=
flag
.
Bool
(
"bench"
,
false
,
"Run benchmarks"
)
runBenchmarks
=
flag
.
Bool
(
"bench"
,
false
,
"Run benchmarks"
)
buildRelease
=
flag
.
Bool
(
"release"
,
false
,
"Build and upload binary release archives"
)
buildRelease
=
flag
.
Bool
(
"release"
,
false
,
"Build and upload binary release archives"
)
...
@@ -45,8 +46,7 @@ var (
...
@@ -45,8 +46,7 @@ var (
)
)
var
(
var
(
buildroot
=
path
.
Join
(
os
.
TempDir
(),
"gobuilder"
)
goroot
string
goroot
=
path
.
Join
(
buildroot
,
"goroot"
)
releaseRegexp
=
regexp
.
MustCompile
(
`^release\.[0-9\-]+`
)
releaseRegexp
=
regexp
.
MustCompile
(
`^release\.[0-9\-]+`
)
benchRequests
vector
.
Vector
benchRequests
vector
.
Vector
)
)
...
@@ -61,6 +61,7 @@ func main() {
...
@@ -61,6 +61,7 @@ func main() {
if
len
(
flag
.
Args
())
==
0
{
if
len
(
flag
.
Args
())
==
0
{
flag
.
Usage
()
flag
.
Usage
()
}
}
goroot
=
path
.
Join
(
*
buildroot
,
"goroot"
)
builders
:=
make
([]
*
Builder
,
len
(
flag
.
Args
()))
builders
:=
make
([]
*
Builder
,
len
(
flag
.
Args
()))
for
i
,
builder
:=
range
flag
.
Args
()
{
for
i
,
builder
:=
range
flag
.
Args
()
{
b
,
err
:=
NewBuilder
(
builder
)
b
,
err
:=
NewBuilder
(
builder
)
...
@@ -69,13 +70,13 @@ func main() {
...
@@ -69,13 +70,13 @@ func main() {
}
}
builders
[
i
]
=
b
builders
[
i
]
=
b
}
}
if
err
:=
os
.
RemoveAll
(
buildroot
);
err
!=
nil
{
if
err
:=
os
.
RemoveAll
(
*
buildroot
);
err
!=
nil
{
log
.
Exitf
(
"Error removing build root (%s): %s"
,
buildroot
,
err
)
log
.
Exitf
(
"Error removing build root (%s): %s"
,
*
buildroot
,
err
)
}
}
if
err
:=
os
.
Mkdir
(
buildroot
,
mkdirPerm
);
err
!=
nil
{
if
err
:=
os
.
Mkdir
(
*
buildroot
,
mkdirPerm
);
err
!=
nil
{
log
.
Exitf
(
"Error making build root (%s): %s"
,
buildroot
,
err
)
log
.
Exitf
(
"Error making build root (%s): %s"
,
*
buildroot
,
err
)
}
}
if
err
:=
run
(
nil
,
buildroot
,
"hg"
,
"clone"
,
hgUrl
,
goroot
);
err
!=
nil
{
if
err
:=
run
(
nil
,
*
buildroot
,
"hg"
,
"clone"
,
hgUrl
,
goroot
);
err
!=
nil
{
log
.
Exit
(
"Error cloning repository:"
,
err
)
log
.
Exit
(
"Error cloning repository:"
,
err
)
}
}
// if specified, build revision and return
// if specified, build revision and return
...
@@ -236,7 +237,7 @@ func (b *Builder) buildCommit(c Commit) (err os.Error) {
...
@@ -236,7 +237,7 @@ func (b *Builder) buildCommit(c Commit) (err os.Error) {
log
.
Println
(
b
.
name
,
"building"
,
c
.
num
)
log
.
Println
(
b
.
name
,
"building"
,
c
.
num
)
// create place in which to do work
// create place in which to do work
workpath
:=
path
.
Join
(
buildroot
,
b
.
name
+
"-"
+
strconv
.
Itoa
(
c
.
num
))
workpath
:=
path
.
Join
(
*
buildroot
,
b
.
name
+
"-"
+
strconv
.
Itoa
(
c
.
num
))
err
=
os
.
Mkdir
(
workpath
,
mkdirPerm
)
err
=
os
.
Mkdir
(
workpath
,
mkdirPerm
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment