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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
28f157b8
Commit
28f157b8
authored
Jan 09, 2020
by
Aidin Abedi
Committed by
Grzegorz Bizon
Jan 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CI variable to provide GitLab base URL
parent
9de12ecd
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
0 deletions
+13
-0
app/models/project.rb
app/models/project.rb
+1
-0
changelogs/unreleased/22327-add-ci-server-url.yml
changelogs/unreleased/22327-add-ci-server-url.yml
+5
-0
doc/ci/variables/README.md
doc/ci/variables/README.md
+5
-0
doc/ci/variables/predefined_variables.md
doc/ci/variables/predefined_variables.md
+1
-0
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+1
-0
No files found.
app/models/project.rb
View file @
28f157b8
...
@@ -1932,6 +1932,7 @@ class Project < ApplicationRecord
...
@@ -1932,6 +1932,7 @@ class Project < ApplicationRecord
Gitlab
::
Ci
::
Variables
::
Collection
.
new
Gitlab
::
Ci
::
Variables
::
Collection
.
new
.
append
(
key:
'CI'
,
value:
'true'
)
.
append
(
key:
'CI'
,
value:
'true'
)
.
append
(
key:
'GITLAB_CI'
,
value:
'true'
)
.
append
(
key:
'GITLAB_CI'
,
value:
'true'
)
.
append
(
key:
'CI_SERVER_URL'
,
value:
Gitlab
.
config
.
gitlab
.
url
)
.
append
(
key:
'CI_SERVER_HOST'
,
value:
Gitlab
.
config
.
gitlab
.
host
)
.
append
(
key:
'CI_SERVER_HOST'
,
value:
Gitlab
.
config
.
gitlab
.
host
)
.
append
(
key:
'CI_SERVER_NAME'
,
value:
'GitLab'
)
.
append
(
key:
'CI_SERVER_NAME'
,
value:
'GitLab'
)
.
append
(
key:
'CI_SERVER_VERSION'
,
value:
Gitlab
::
VERSION
)
.
append
(
key:
'CI_SERVER_VERSION'
,
value:
Gitlab
::
VERSION
)
...
...
changelogs/unreleased/22327-add-ci-server-url.yml
0 → 100644
View file @
28f157b8
---
title
:
Add CI variable to provide GitLab base URL
merge_request
:
22327
author
:
Aidin Abedi
type
:
added
doc/ci/variables/README.md
View file @
28f157b8
...
@@ -290,6 +290,7 @@ export CI_RUNNER_ID="10"
...
@@ -290,6 +290,7 @@ export CI_RUNNER_ID="10"
export
CI_RUNNER_DESCRIPTION
=
"my runner"
export
CI_RUNNER_DESCRIPTION
=
"my runner"
export
CI_RUNNER_TAGS
=
"docker, linux"
export
CI_RUNNER_TAGS
=
"docker, linux"
export
CI_SERVER
=
"yes"
export
CI_SERVER
=
"yes"
export
CI_SERVER_URL
=
"https://example.com"
export
CI_SERVER_HOST
=
"example.com"
export
CI_SERVER_HOST
=
"example.com"
export
CI_SERVER_NAME
=
"GitLab"
export
CI_SERVER_NAME
=
"GitLab"
export
CI_SERVER_REVISION
=
"70606bf"
export
CI_SERVER_REVISION
=
"70606bf"
...
@@ -673,6 +674,8 @@ Running on runner-8a2f473d-project-1796893-concurrent-0 via runner-8a2f473d-mach
...
@@ -673,6 +674,8 @@ Running on runner-8a2f473d-project-1796893-concurrent-0 via runner-8a2f473d-mach
++
CI_PROJECT_DIR
=
/builds/gitlab-examples/ci-debug-trace
++
CI_PROJECT_DIR
=
/builds/gitlab-examples/ci-debug-trace
++
export
CI_SERVER
=
yes
++
export
CI_SERVER
=
yes
++
CI_SERVER
=
yes
++
CI_SERVER
=
yes
++
export
CI_SERVER_URL
=
https://example.com:3000
++
CI_SERVER_URL
=
https://example.com:3000
++
export
'CI_SERVER_HOST=example.com'
++
export
'CI_SERVER_HOST=example.com'
++
CI_SERVER_HOST
=
'example.com'
++
CI_SERVER_HOST
=
'example.com'
++
export
'CI_SERVER_NAME=GitLab CI'
++
export
'CI_SERVER_NAME=GitLab CI'
...
@@ -709,6 +712,8 @@ Running on runner-8a2f473d-project-1796893-concurrent-0 via runner-8a2f473d-mach
...
@@ -709,6 +712,8 @@ Running on runner-8a2f473d-project-1796893-concurrent-0 via runner-8a2f473d-mach
++
CI_JOB_NAME
=
debug_trace
++
CI_JOB_NAME
=
debug_trace
++
export
CI_JOB_STAGE
=
test
++
export
CI_JOB_STAGE
=
test
++
CI_JOB_STAGE
=
test
++
CI_JOB_STAGE
=
test
++
export
CI_SERVER_URL
=
https://example.com:3000
++
CI_SERVER_URL
=
https://example.com:3000
++
export
CI_SERVER_HOST
=
example.com
++
export
CI_SERVER_HOST
=
example.com
++
CI_SERVER_HOST
=
example.com
++
CI_SERVER_HOST
=
example.com
++
export
CI_SERVER_NAME
=
GitLab
++
export
CI_SERVER_NAME
=
GitLab
...
...
doc/ci/variables/predefined_variables.md
View file @
28f157b8
...
@@ -112,6 +112,7 @@ future GitLab releases.**
...
@@ -112,6 +112,7 @@ future GitLab releases.**
|
`CI_RUNNER_TAGS`
| 8.10 | 0.5 | The defined runner tags |
|
`CI_RUNNER_TAGS`
| 8.10 | 0.5 | The defined runner tags |
|
`CI_RUNNER_VERSION`
| all | 10.6 | GitLab Runner version that is executing the current job |
|
`CI_RUNNER_VERSION`
| all | 10.6 | GitLab Runner version that is executing the current job |
|
`CI_SERVER`
| all | all | Mark that job is executed in CI environment |
|
`CI_SERVER`
| all | all | Mark that job is executed in CI environment |
|
`CI_SERVER_URL`
| 12.7 | all | The base URL of the GitLab instance, including protocol and port (like
`https://gitlab.example.com:8080`
) |
|
`CI_SERVER_HOST`
| 12.1 | all | Host component of the GitLab instance URL, without protocol and port (like
`gitlab.example.com`
) |
|
`CI_SERVER_HOST`
| 12.1 | all | Host component of the GitLab instance URL, without protocol and port (like
`gitlab.example.com`
) |
|
`CI_SERVER_NAME`
| all | all | The name of CI server that is used to coordinate jobs |
|
`CI_SERVER_NAME`
| all | all | The name of CI server that is used to coordinate jobs |
|
`CI_SERVER_REVISION`
| all | all | GitLab revision that is used to schedule jobs |
|
`CI_SERVER_REVISION`
| all | all | GitLab revision that is used to schedule jobs |
...
...
spec/models/ci/build_spec.rb
View file @
28f157b8
...
@@ -2359,6 +2359,7 @@ describe Ci::Build do
...
@@ -2359,6 +2359,7 @@ describe Ci::Build do
{
key:
'CI_BUILD_STAGE'
,
value:
'test'
,
public:
true
,
masked:
false
},
{
key:
'CI_BUILD_STAGE'
,
value:
'test'
,
public:
true
,
masked:
false
},
{
key:
'CI'
,
value:
'true'
,
public:
true
,
masked:
false
},
{
key:
'CI'
,
value:
'true'
,
public:
true
,
masked:
false
},
{
key:
'GITLAB_CI'
,
value:
'true'
,
public:
true
,
masked:
false
},
{
key:
'GITLAB_CI'
,
value:
'true'
,
public:
true
,
masked:
false
},
{
key:
'CI_SERVER_URL'
,
value:
Gitlab
.
config
.
gitlab
.
url
,
public:
true
,
masked:
false
},
{
key:
'CI_SERVER_HOST'
,
value:
Gitlab
.
config
.
gitlab
.
host
,
public:
true
,
masked:
false
},
{
key:
'CI_SERVER_HOST'
,
value:
Gitlab
.
config
.
gitlab
.
host
,
public:
true
,
masked:
false
},
{
key:
'CI_SERVER_NAME'
,
value:
'GitLab'
,
public:
true
,
masked:
false
},
{
key:
'CI_SERVER_NAME'
,
value:
'GitLab'
,
public:
true
,
masked:
false
},
{
key:
'CI_SERVER_VERSION'
,
value:
Gitlab
::
VERSION
,
public:
true
,
masked:
false
},
{
key:
'CI_SERVER_VERSION'
,
value:
Gitlab
::
VERSION
,
public:
true
,
masked:
false
},
...
...
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