Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
G
Gitlab Runner
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
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
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Web - Open
Gitlab Runner
Commits
bb1f5bc9
Commit
bb1f5bc9
authored
Feb 17, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Docker containers before starting build
parent
44a84e07
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
8 deletions
+22
-8
CHANGELOG.md
CHANGELOG.md
+3
-0
README.md
README.md
+4
-4
VERSION
VERSION
+1
-1
executors/docker/executor_docker.go
executors/docker/executor_docker.go
+14
-3
No files found.
CHANGELOG.md
View file @
bb1f5bc9
v 0.1.6
-
Remove Docker containers before starting job
v 0.1.5
-
Added Parallels executor which can use snapshots for fast revert (only OSX supported)
-
Refactored sources
...
...
README.md
View file @
bb1f5bc9
...
...
@@ -35,10 +35,10 @@ This project was made as Go learning opportunity. The initial release was create
1.
Simply download one of this binaries for your system:
```
bash
sudo
wget
-O
/usr/local/bin/gitlab-ci-multi-runner https://github.com/ayufan/gitlab-ci-multi-runner/releases/download/v0.1.
5
/gitlab-ci-multi-runner-linux-386
sudo
wget
-O
/usr/local/bin/gitlab-ci-multi-runner https://github.com/ayufan/gitlab-ci-multi-runner/releases/download/v0.1.
5
/gitlab-ci-multi-runner-linux-amd64
sudo
wget
-O
/usr/local/bin/gitlab-ci-multi-runner https://github.com/ayufan/gitlab-ci-multi-runner/releases/download/v0.1.
5
/gitlab-ci-multi-runner-darwin-386
sudo
wget
-O
/usr/local/bin/gitlab-ci-multi-runner https://github.com/ayufan/gitlab-ci-multi-runner/releases/download/v0.1.
5
/gitlab-ci-multi-runner-darwin-amd64
sudo
wget
-O
/usr/local/bin/gitlab-ci-multi-runner https://github.com/ayufan/gitlab-ci-multi-runner/releases/download/v0.1.
6
/gitlab-ci-multi-runner-linux-386
sudo
wget
-O
/usr/local/bin/gitlab-ci-multi-runner https://github.com/ayufan/gitlab-ci-multi-runner/releases/download/v0.1.
6
/gitlab-ci-multi-runner-linux-amd64
sudo
wget
-O
/usr/local/bin/gitlab-ci-multi-runner https://github.com/ayufan/gitlab-ci-multi-runner/releases/download/v0.1.
6
/gitlab-ci-multi-runner-darwin-386
sudo
wget
-O
/usr/local/bin/gitlab-ci-multi-runner https://github.com/ayufan/gitlab-ci-multi-runner/releases/download/v0.1.
6
/gitlab-ci-multi-runner-darwin-amd64
```
1.
Give it permissions to execute:
...
...
VERSION
View file @
bb1f5bc9
0.1.
5
0.1.
6
executors/docker/executor_docker.go
View file @
bb1f5bc9
...
...
@@ -115,8 +115,13 @@ func (s *DockerExecutor) createService(service, version string) (*docker.Contain
return
nil
,
err
}
containerName
:=
s
.
Build
.
ProjectUniqueName
()
+
"-"
+
service
// this will fail potentially some builds if there's name collision
s
.
removeContainer
(
containerName
)
createContainerOpts
:=
docker
.
CreateContainerOptions
{
Name
:
s
.
Build
.
ProjectUniqueName
()
+
"-"
+
servic
e
,
Name
:
containerNam
e
,
Config
:
&
docker
.
Config
{
Image
:
serviceImage
.
ID
,
Env
:
s
.
Config
.
Environment
,
...
...
@@ -182,8 +187,13 @@ func (s *DockerExecutor) createContainer(image *docker.Image, cmd []string) (*do
hostname
=
s
.
Build
.
ProjectUniqueName
()
}
containerName
:=
s
.
Build
.
ProjectUniqueName
()
// this will fail potentially some builds if there's name collision
s
.
removeContainer
(
containerName
)
create_container_opts
:=
docker
.
CreateContainerOptions
{
Name
:
s
.
Build
.
ProjectUniqueName
()
,
Name
:
containerName
,
Config
:
&
docker
.
Config
{
Hostname
:
hostname
,
Image
:
image
.
ID
,
...
...
@@ -239,7 +249,7 @@ func (s *DockerExecutor) createContainer(image *docker.Image, cmd []string) (*do
return
container
,
nil
}
func
(
s
*
DockerExecutor
)
removeContainer
(
id
string
)
{
func
(
s
*
DockerExecutor
)
removeContainer
(
id
string
)
error
{
remove_container_opts
:=
docker
.
RemoveContainerOptions
{
ID
:
id
,
RemoveVolumes
:
true
,
...
...
@@ -247,6 +257,7 @@ func (s *DockerExecutor) removeContainer(id string) {
}
err
:=
s
.
client
.
RemoveContainer
(
remove_container_opts
)
s
.
Debugln
(
"Removed container"
,
id
,
"with"
,
err
)
return
err
}
func
(
s
*
DockerExecutor
)
Prepare
(
config
*
common
.
RunnerConfig
,
build
*
common
.
Build
)
error
{
...
...
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