BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
698a0c47
Unverified
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
pipeline.rb
app/models/ci/pipeline.rb
+11
-0
build_spec.rb
spec/models/ci/build_spec.rb
+4
-1
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