Skip to content
GitLab
Next
Projects
Groups
Snippets
Help
Loading...
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gitlab-runner
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1,985
Issues
1,985
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
213
Merge Requests
213
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GitLab.org
gitlab-runner
Commits
775b150a
Commit
775b150a
authored
Apr 29, 2015
by
Kamil Trzciński
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Default concurrent value is set to number of CPUs
parent
cb9c7348
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
10 deletions
+38
-10
CHANGELOG.md
CHANGELOG.md
+2
-1
commands/delete.go
commands/delete.go
+1
-1
commands/multi.go
commands/multi.go
+2
-2
commands/setup.go
commands/setup.go
+2
-1
commands/verify.go
commands/verify.go
+1
-1
common/config.go
common/config.go
+9
-4
helpers/defaults.go
helpers/defaults.go
+21
-0
No files found.
CHANGELOG.md
View file @
775b150a
v 0.
2.1
v 0.
3.0
-
Added repo slug to build path
-
Build path includes repository hostname
-
Support TLS connection with Docker
-
Default concurrent limit is set to number of CPUs
v 0.2.0
-
Added delete and verify commands
...
...
commands/delete.go
View file @
775b150a
...
...
@@ -17,7 +17,7 @@ func runDelete(c *cli.Context) {
log
.
Fatalln
(
"Failed to delete runner"
)
}
config
:=
&
common
.
Config
{}
config
:=
common
.
NewConfig
()
err
:=
config
.
LoadConfig
(
c
.
String
(
"config"
))
if
err
!=
nil
{
return
...
...
commands/multi.go
View file @
775b150a
...
...
@@ -217,14 +217,14 @@ func (mr *MultiRunner) startWorkers(startWorker chan int, stopWorker chan bool,
}
func
(
mr
*
MultiRunner
)
loadConfig
()
error
{
newConfig
:=
common
.
Config
{}
newConfig
:=
common
.
NewConfig
()
err
:=
newConfig
.
LoadConfig
(
mr
.
configFile
)
if
err
!=
nil
{
return
err
}
mr
.
healthy
=
nil
mr
.
config
=
&
newConfig
mr
.
config
=
newConfig
return
nil
}
...
...
commands/setup.go
View file @
775b150a
...
...
@@ -18,7 +18,7 @@ import (
type
SetupContext
struct
{
*
cli
.
Context
configFile
string
config
common
.
Config
config
*
common
.
Config
reader
*
bufio
.
Reader
}
...
...
@@ -168,6 +168,7 @@ func (s *SetupContext) askRunner() common.RunnerConfig {
func
runSetup
(
c
*
cli
.
Context
)
{
s
:=
SetupContext
{
Context
:
c
,
config
:
common
.
NewConfig
(),
configFile
:
c
.
String
(
"config"
),
reader
:
bufio
.
NewReader
(
os
.
Stdin
),
}
...
...
commands/verify.go
View file @
775b150a
...
...
@@ -8,7 +8,7 @@ import (
)
func
runVerify
(
c
*
cli
.
Context
)
{
config
:=
&
common
.
Config
{}
config
:=
common
.
NewConfig
()
err
:=
config
.
LoadConfig
(
c
.
String
(
"config"
))
if
err
!=
nil
{
log
.
Fatalln
(
err
)
...
...
common/config.go
View file @
775b150a
...
...
@@ -11,6 +11,7 @@ import (
log
"github.com/Sirupsen/logrus"
"github.com/ayufan/gitlab-ci-multi-runner/helpers"
"github.com/ayufan/gitlab-ci-multi-runner/ssh"
"runtime"
)
type
DockerConfig
struct
{
...
...
@@ -73,6 +74,14 @@ func (c *RunnerConfig) UniqueID() string {
return
c
.
URL
+
c
.
Token
}
func
NewConfig
()
*
Config
{
return
&
Config
{
BaseConfig
:
BaseConfig
{
Concurrent
:
runtime
.
NumCPU
(),
},
}
}
func
(
c
*
Config
)
LoadConfig
(
configFile
string
)
error
{
info
,
err
:=
os
.
Stat
(
configFile
)
if
err
!=
nil
{
...
...
@@ -83,10 +92,6 @@ func (c *Config) LoadConfig(configFile string) error {
return
err
}
if
c
.
Concurrent
==
0
{
c
.
Concurrent
=
1
}
c
.
ModTime
=
info
.
ModTime
()
return
nil
}
...
...
helpers/defaults.go
0 → 100644
View file @
775b150a
package
helpers
func
IsEmpty
(
data
*
string
)
bool
{
return
data
==
nil
||
*
data
==
""
}
func
StringOrDefault
(
data
*
string
,
def
string
)
string
{
if
IsEmpty
(
data
)
{
return
def
}
else
{
return
*
data
}
}
func
NonZeroOrDefault
(
data
*
int
,
def
int
)
int
{
if
data
==
nil
||
*
data
<=
0
{
return
def
}
else
{
return
*
data
}
}
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