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
Léo-Paul Géneau
gitlab-ce
Commits
abfceb1e
Commit
abfceb1e
authored
Sep 15, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup changes
parent
4a5c2172
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
41 deletions
+8
-41
app/models/merge_request.rb
app/models/merge_request.rb
+1
-12
db/migrate/20160907131111_add_environment_type_to_environments.rb
...te/20160907131111_add_environment_type_to_environments.rb
+0
-20
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+5
-4
lib/gitlab/ci/config/node/environment.rb
lib/gitlab/ci/config/node/environment.rb
+2
-5
No files found.
app/models/merge_request.rb
View file @
abfceb1e
...
@@ -744,21 +744,10 @@ class MergeRequest < ActiveRecord::Base
...
@@ -744,21 +744,10 @@ class MergeRequest < ActiveRecord::Base
@pipeline
||=
source_project
.
pipeline_for
(
source_branch
,
diff_head_sha
)
@pipeline
||=
source_project
.
pipeline_for
(
source_branch
,
diff_head_sha
)
end
end
def
all_commits_sha
merge_request_diffs
.
map
(
&
:commits
).
flatten
.
map
(
&
:sha
).
sort
.
uniq
end
def
latest_pipelines
@latest_pipelines
||=
if
diff_head_sha
&&
source_project
source_project
.
pipelines
.
order
(
id: :desc
).
where
(
sha:
commits_sha
,
ref:
source_branch
)
end
end
def
all_pipelines
def
all_pipelines
@all_pipelines
||=
@all_pipelines
||=
if
diff_head_sha
&&
source_project
if
diff_head_sha
&&
source_project
source_project
.
pipelines
.
order
(
id: :desc
).
where
(
sha:
all_
commits_sha
,
ref:
source_branch
)
source_project
.
pipelines
.
order
(
id: :desc
).
where
(
sha:
commits_sha
,
ref:
source_branch
)
end
end
end
end
...
...
db/migrate/20160907131111_add_environment_type_to_environments.rb
View file @
abfceb1e
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
AddEnvironmentTypeToEnvironments
<
ActiveRecord
::
Migration
class
AddEnvironmentTypeToEnvironments
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
DOWNTIME
=
false
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
# DOWNTIME_REASON = ''
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
# existing transaction. When using "add_concurrent_index" make sure that this
# method is the _only_ method called in the migration, any other changes
# should go in a separate migration. This ensures that upon failure _only_ the
# index creation fails and can be retried or reverted easily.
#
# To disable transactions uncomment the following line and remove these
# comments:
# disable_ddl_transaction!
def
change
def
change
add_column
:environments
,
:environment_type
,
:string
add_column
:environments
,
:environment_type
,
:string
end
end
...
...
doc/ci/yaml/README.md
View file @
abfceb1e
...
@@ -577,9 +577,9 @@ The `deploy to production` job will be marked as doing deployment to
...
@@ -577,9 +577,9 @@ The `deploy to production` job will be marked as doing deployment to
Introduced in GitLab 8.12.
Introduced in GitLab 8.12.
`environment`
can also represent a configuration hash with
`name`
and
`url`
.
`environment`
can also represent a configuration hash with
`name`
and
`url`
.
These parameters can use any of
defined CI variables (including predefined, secure variables and .gitlab-ci.yml
variables).
These parameters can use any of
the defined CI variables (including predefined, secure variables and
`.gitlab-ci.yml`
variables).
The common use case is to create
a
dynamic environments for branches and use them as review apps.
The common use case is to create dynamic environments for branches and use them as review apps.
---
---
...
@@ -594,9 +594,10 @@ deploy as review app:
...
@@ -594,9 +594,10 @@ deploy as review app:
url: https://$CI_BUILD_REF_NAME.review.example.com/
url: https://$CI_BUILD_REF_NAME.review.example.com/
```
```
The
`deploy
to production`
job will be marked as doing
deployment to
The
`deploy
as review app`
job will be marked as
deployment to
`production
`
environment.
dynamically created
`review-apps/branch-name
`
environment.
This environment should be accessible under
`https://branch-name.review.example.com/`
.
### artifacts
### artifacts
...
...
lib/gitlab/ci/config/node/environment.rb
View file @
abfceb1e
...
@@ -36,14 +36,11 @@ module Gitlab
...
@@ -36,14 +36,11 @@ module Gitlab
end
end
def
name
def
name
case
@config
.
type
value
[
:name
]
when
String
then
@config
when
Hash
then
@config
[
:name
]
end
end
end
def
url
def
url
@config
[
:url
]
if
hash
?
value
[
:url
]
end
end
def
value
def
value
...
...
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