Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
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
Jérome Perrin
gitlab-ce
Commits
901c994b
Commit
901c994b
authored
Oct 03, 2016
by
Z.J. van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deployment refs in own folder, new method for creating refs
parent
8fd91794
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
4 deletions
+18
-4
app/models/deployment.rb
app/models/deployment.rb
+2
-2
app/models/environment.rb
app/models/environment.rb
+1
-1
app/models/repository.rb
app/models/repository.rb
+4
-0
doc/ci/environments.md
doc/ci/environments.md
+1
-1
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+10
-0
No files found.
app/models/deployment.rb
View file @
901c994b
...
...
@@ -30,7 +30,7 @@ class Deployment < ActiveRecord::Base
end
def
create_ref
project
.
repository
.
fetch_ref
(
project
.
repository
.
path_to_repo
,
ref
,
ref_path
)
project
.
repository
.
create_ref
(
ref
,
ref_path
)
end
def
manual_actions
...
...
@@ -80,6 +80,6 @@ class Deployment < ActiveRecord::Base
private
def
ref_path
"
#{
environment
.
ref_path
}#{
id
}
"
File
.
join
(
environment
.
ref_path
,
'deployments'
,
id
.
to_s
)
end
end
app/models/environment.rb
View file @
901c994b
...
...
@@ -49,6 +49,6 @@ class Environment < ActiveRecord::Base
end
def
ref_path
"refs/environments/
#{
Shellwords
.
shellescape
(
name
)
}
/
"
"refs/environments/
#{
Shellwords
.
shellescape
(
name
)
}
"
end
end
app/models/repository.rb
View file @
901c994b
...
...
@@ -997,6 +997,10 @@ class Repository
Gitlab
::
Popen
.
popen
(
args
,
path_to_repo
)
end
def
create_ref
(
ref
,
ref_path
)
fetch_ref
(
path_to_repo
,
ref
,
ref_path
)
end
def
update_branch_with_hooks
(
current_user
,
branch
)
update_autocrlf_option
...
...
doc/ci/environments.md
View file @
901c994b
...
...
@@ -20,7 +20,7 @@ Since 8.13, a reference in the git repository is saved for each deployment. So
knowing what the state is of your current environments is only a
`git fetch`
away.
In your git config, append the
`[remote "<your-remote>"] block with an extra
In your git config, append the
`[remote "<your-remote>"]
`
block with an extra
fetch line:
```
...
...
spec/models/repository_spec.rb
View file @
901c994b
...
...
@@ -320,6 +320,16 @@ describe Repository, models: true do
end
end
describe
'#create_ref'
do
it
'redirects the call to fetch_ref'
do
ref
,
ref_path
=
'1'
,
'2'
expect
(
repository
).
to
receive
(
:fetch_ref
).
with
(
repository
.
path_to_repo
,
ref
,
ref_path
)
repository
.
create_ref
(
ref
,
ref_path
)
end
end
describe
"#changelog"
do
before
do
repository
.
send
(
:cache
).
expire
(
:changelog
)
...
...
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