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
698a0c47
Commit
698a0c47
authored
May 01, 2018
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a CI_COMMIT_MESSAGE predefined variable
parent
bdc20840
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+11
-0
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+4
-1
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+1
-1
No files found.
app/models/ci/pipeline.rb
View file @
698a0c47
...
...
@@ -284,6 +284,14 @@ module Ci
commit
.
try
(
:title
)
end
def
git_commit_full_title
commit
.
try
(
:full_title
)
end
def
git_commit_description
commit
.
try
(
:description
)
end
def
short_sha
Ci
::
Pipeline
.
truncate_sha
(
sha
)
end
...
...
@@ -491,6 +499,9 @@ module Ci
.
append
(
key:
'CI_PIPELINE_ID'
,
value:
id
.
to_s
)
.
append
(
key:
'CI_CONFIG_PATH'
,
value:
ci_yaml_file_path
)
.
append
(
key:
'CI_PIPELINE_SOURCE'
,
value:
source
.
to_s
)
.
append
(
key:
'CI_COMMIT_MESSAGE'
,
value:
git_commit_message
)
.
append
(
key:
'CI_COMMIT_TITLE'
,
value:
git_commit_full_title
)
.
append
(
key:
'CI_COMMIT_DESCRIPTION'
,
value:
git_commit_description
)
end
def
queued_duration
...
...
spec/models/ci/build_spec.rb
View file @
698a0c47
...
...
@@ -1518,7 +1518,10 @@ describe Ci::Build do
{
key:
'CI_PROJECT_VISIBILITY'
,
value:
'private'
,
public:
true
},
{
key:
'CI_PIPELINE_ID'
,
value:
pipeline
.
id
.
to_s
,
public:
true
},
{
key:
'CI_CONFIG_PATH'
,
value:
pipeline
.
ci_yaml_file_path
,
public:
true
},
{
key:
'CI_PIPELINE_SOURCE'
,
value:
pipeline
.
source
,
public:
true
}
{
key:
'CI_PIPELINE_SOURCE'
,
value:
pipeline
.
source
,
public:
true
},
{
key:
'CI_COMMIT_MESSAGE'
,
value:
pipeline
.
git_commit_message
,
public:
true
},
{
key:
'CI_COMMIT_TITLE'
,
value:
pipeline
.
git_commit_title
,
public:
true
},
{
key:
'CI_COMMIT_DESCRIPTION'
,
value:
pipeline
.
git_commit_description
,
public:
true
}
]
end
...
...
spec/models/ci/pipeline_spec.rb
View file @
698a0c47
...
...
@@ -173,7 +173,7 @@ describe Ci::Pipeline, :mailer do
it
'includes all predefined variables in a valid order'
do
keys
=
subject
.
map
{
|
variable
|
variable
[
:key
]
}
expect
(
keys
).
to
eq
%w[CI_PIPELINE_ID CI_CONFIG_PATH CI_PIPELINE_SOURCE]
expect
(
keys
).
to
eq
%w[CI_PIPELINE_ID CI_CONFIG_PATH CI_PIPELINE_SOURCE
CI_COMMIT_MESSAGE CI_COMMIT_TITLE CI_COMMIT_DESCRIPTION
]
end
end
...
...
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