Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
NFV - Network Functions Virtualisation
SOL005
Commits
bf4834b4
Commit
bf4834b4
authored
Oct 04, 2019
by
Michele Carignani
Browse files
Remove deprecated scripts
parent
c8731658
Pipeline
#1617
running with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
scripts/add_change_comment.py
deleted
100644 → 0
View file @
c8731658
"""
Add comments on gerrit
"""
import
os
import
sys
import
jnk_grt_comment
as
jgc
import
glob
CHANGE
=
os
.
environ
.
get
(
'GERRIT_CHANGE_NUMBER'
)
or
None
PATCH
=
os
.
environ
.
get
(
'GERRIT_PATCHSET_NUMBER'
)
or
None
URL
=
os
.
environ
.
get
(
'BUILD_URL'
)
or
None
# print glob.glob("**/*-API.yaml")
if
not
(
CHANGE
and
PATCH
and
URL
):
print
"No Gerrit change information found. Exiting"
sys
.
exit
()
print
"START Comment on Gerrit change ---"
jgc
.
comment_openapis_artifacts
(
CHANGE
,
PATCH
,
URL
)
print
"DONE Comment on Gerrit change ---
\n
"
scripts/jnk_grt_comment.py
deleted
100644 → 0
View file @
c8731658
#!/env/python2.7
"""
Comments on gerrit
"""
import
os.path
import
subprocess
import
glob
def
mk_swg_ui_link
(
artifact
,
build_uri
):
"""
creates the link to the swagger ui
"""
swg_ui
=
"https://forge.etsi.org/swagger/ui"
return
swg_ui
+
"/?url="
+
build_uri
+
"/artifact/"
+
artifact
+
"/*view*/"
def
mk_swg_ui_comment
(
files
,
bu
):
"""
creates the link to the swagger ui
"""
msg
=
"Review links for the built OpenAPIS:"
for
artifact
in
glob
.
glob
(
files
):
msg
+=
"
\n
* "
+
os
.
path
.
basename
(
artifact
)
+
": "
+
mk_swg_ui_link
(
artifact
,
bu
)
return
msg
def
mk_grt_comment_cmd
(
change
,
payload
):
"""
creates the link to the swagger ui
"""
command
=
"ssh -p 29418 forge.etsi.org
\"
gerrit review --message '"
+
payload
+
"' "
+
change
+
"
\"
"
print
command
return
command
def
send_gerrit_comment
(
change
,
patchset
):
"""
creates the link to the swagger ui
"""
cmd
=
mk_grt_comment_cmd
(
change
,
patchset
)
print
"Executing: "
+
cmd
subprocess
.
call
(
cmd
,
shell
=
True
)
def
jenkins_gerrit_comment
(
change_num
,
patch_num
,
comment
):
send_gerrit_comment
(
change_num
+
","
+
patch_num
,
comment
)
def
comment_openapis_artifacts
(
cn
,
pn
,
bu
):
comment
=
mk_swg_ui_comment
(
"**/*-API.yaml"
,
bu
)
# print "comment: "+comment
jenkins_gerrit_comment
(
str
(
cn
),
str
(
pn
),
comment
)
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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