Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
96006a9c
Commit
96006a9c
authored
Jun 27, 2019
by
Guillaume Pasero
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/ci_handle_forks' into ci_alpha_fixes
Conflicts: .gitlab-ci.yml
parents
adaeb8f1
1624d75e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
9 deletions
+17
-9
.gitlab-ci.yml
.gitlab-ci.yml
+5
-2
CI/cdash_handler.py
CI/cdash_handler.py
+8
-4
CI/check_twin_pipelines.py
CI/check_twin_pipelines.py
+4
-3
No files found.
.gitlab-ci.yml
View file @
96006a9c
...
...
@@ -219,8 +219,11 @@ deploy:
stage
:
deploy
extends
:
.general
only
:
-
develop
-
/^release-[0-9]+\.[0-9]+$/
refs
:
-
develop
-
/^release-[0-9]+\.[0-9]+$/
variables
:
-
$CI_PROJECT_NAMESPACE == "orfeotoolbox"
before_script
:
# Provision efficiently the local LFS cache before checkout
-
git lfs fetch origin $CI_COMMIT_SHA
...
...
CI/cdash_handler.py
View file @
96006a9c
...
...
@@ -253,16 +253,19 @@ if __name__ == "__main__":
token
=
sys
.
argv
[
4
]
refn
=
sys
.
argv
[
5
]
else
:
if
not
CheckEnvParameters
([
'CI_COMMIT_SHA'
,
'CI_PROJECT_ID'
,
'CI_PROJECT_DIR'
,
'K8S_SECRET_API_TOKEN'
,
'CI_COMMIT_REF_NAME'
]):
if
not
CheckEnvParameters
([
'CI_COMMIT_SHA'
,
'CI_PROJECT_ID'
,
'CI_PROJECT_DIR'
,
'CI_COMMIT_REF_NAME'
]):
sys
.
exit
(
1
)
sha1
=
os
.
environ
[
'CI_COMMIT_SHA'
]
proj
=
os
.
environ
[
'CI_PROJECT_ID'
]
pdir
=
os
.
environ
[
'CI_PROJECT_DIR'
]
token
=
os
.
environ
[
'K8S_SECRET_API_TOKEN'
]
if
'CI_MERGE_REQUEST_REF_PATH'
in
os
.
environ
.
keys
():
refn
=
os
.
environ
[
'CI_MERGE_REQUEST_REF_PATH'
]
else
:
refn
=
os
.
environ
[
'CI_COMMIT_REF_NAME'
]
if
CheckEnvParameters
([
'K8S_SECRET_API_TOKEN'
]):
token
=
os
.
environ
[
'K8S_SECRET_API_TOKEN'
]
else
:
token
=
None
handler
=
Handler
()
build_dir
=
os
.
path
.
join
(
pdir
,
"build/"
)
if
trace
:
...
...
@@ -277,8 +280,9 @@ if __name__ == "__main__":
else
:
cdash_url
=
handler
.
GetBuildUrl
()
(
state
,
error
)
=
handler
.
GetLogStatus
(
os
.
path
.
join
(
pdir
,
"log"
)
)
if
trace
:
print
(
"cdash_url is: "
+
cdash_url
)
print
(
"CDash build URL : "
+
cdash_url
)
if
token
is
None
:
sys
.
exit
(
0
)
gitlab_url
=
"https://gitlab.orfeo-toolbox.org/api/v4/projects/"
gitlab_url
+=
proj
+
"/statuses/"
+
sha1
params
=
urllib
.
parse
.
urlencode
({
'name'
:
'cdash:'
+
handler
.
site
,
'state'
:
state
,
\
...
...
CI/check_twin_pipelines.py
View file @
96006a9c
...
...
@@ -66,9 +66,10 @@ if __name__ == "__main__":
# are we in a merge_request pipeline ?
if
'CI_MERGE_REQUEST_IID'
in
env
.
keys
():
if
not
CheckEnvParameters
([
'K8S_SECRET_API_TOKEN'
]):
print
(
"Make sure you have set a valid acces token for Gitlab API"
)
print
(
"The K8S_SECRET_API_TOKEN environment variable should be set in 'Settings -> CI/CD -> Variables'"
)
sys
.
exit
(
1
)
print
(
"WARNING: Make sure you have set a valid acces token for Gitlab API."
\
+
"The K8S_SECRET_API_TOKEN environment variable should be set in 'Settings -> CI/CD -> Variables'"
\
+
"Without this token, some feature of the CI platform will be disabled."
)
sys
.
exit
(
0
)
if
not
CheckEnvParameters
([
'CI_PROJECT_ID'
,
'CI_PIPELINE_ID'
]):
sys
.
exit
(
1
)
mrInfo
=
GitlabRequest
(
'merge_requests/'
+
env
[
'CI_MERGE_REQUEST_IID'
],
token
=
env
[
'K8S_SECRET_API_TOKEN'
])
...
...
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