Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Imldeployment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
Imldeployment
Commits
fdaf8ab6
Commit
fdaf8ab6
authored
8 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
add missing permission for build button; fix ajax poll
parent
6b23e22d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config/inc_roles.php
+1
-0
1 addition, 0 deletions
config/inc_roles.php
public_html/deployment/pages/act_build.php
+14
-10
14 additions, 10 deletions
public_html/deployment/pages/act_build.php
public_html/webservice/getfile.php
+29
-0
29 additions, 0 deletions
public_html/webservice/getfile.php
with
44 additions
and
10 deletions
config/inc_roles.php
+
1
−
0
View file @
fdaf8ab6
...
...
@@ -23,6 +23,7 @@ return array(
// see $oProject->renderLink() and $oProject->[äction]
"project-action-default"
,
"project-action-accept"
,
// see project->canAcceptPhase (used for build button)
"project-action-accept-preview"
,
"project-action-build"
,
"project-action-cleanup"
,
...
...
This diff is collapsed.
Click to expand it.
public_html/deployment/pages/act_build.php
+
14
−
10
View file @
fdaf8ab6
...
...
@@ -119,6 +119,8 @@ if (!array_key_exists("confirm", $aParams)) {
// the ajax polling request reads tmpfile
// read produced content from tempfile
// remark: this part was moved to ../webservice/getfile.php
/*
if (array_key_exists("ajax", $aParams)) {
$sLine = "<h2 class=\"warning\">" . t("page-build-info-processing") . "</h2>";
$sProcesses = t("page-build-info-load") . ": "
...
...
@@ -136,31 +138,34 @@ if (!array_key_exists("confirm", $aParams)) {
}
die();
}
*/
// html code after pressing build button:
// initiate one request to start the build and one to fetch preocess output
// $sTmpFile = basename(tempnam("", "out_".$aParams["prj"]."_".$aParams["action"])."_");
$s
Tmp
File
=
$aParams
[
"prj"
]
.
"_"
.
$aParams
[
"action"
];
$s
Ajax
File
=
$aParams
[
"prj"
]
.
"_"
.
$aParams
[
"action"
];
$sDivname
=
"outAjax"
;
$sUrl
=
"/deployment/?"
$sUrl
StartAction
=
"/deployment/?"
.
"&prj="
.
$aParams
[
"prj"
]
.
"&action="
.
$aParams
[
"action"
]
.
"&confirm="
.
$aParams
[
"confirm"
]
.
"&branchname="
.
$aParams
[
"branchname"
]
.
"&ajax="
.
$sTmpFile
.
"&ajax="
.
$sAjaxFile
.
"&run=1"
;
$sUrlStartAction
=
$sUrl
.
"&run=1"
;
$sOut
.
=
'<div id="'
.
$sDivname
.
'"></div>'
$sUrlFile
=
"/webservice/getfile.php?"
.
"&ajax="
.
$sAjaxFile
;
$sOut
.
=
'<div id="'
.
$sDivname
.
'"></div>'
.
'<script>
var iRepeat=3000;
//
ini
t build process
//
star
t build process
$.post( "'
.
$sUrlStartAction
.
'", function( data ) {
$( "#'
.
$sDivname
.
'" ).html( data );
iRepeat=false; // stop polling
iRepeat=false; // stop polling
if build is finished
});
// polling result
so far
...
// polling result
during progress
...
function AjaxPolling(sUrl, sDivname){
if (!iRepeat) return false;
$.post( sUrl, function( data ) {
...
...
@@ -174,7 +179,7 @@ if (!array_key_exists("confirm", $aParams)) {
}
// init polling
AjaxPolling("'
.
$sUrl
.
'", "'
.
$sDivname
.
'");
AjaxPolling("'
.
$sUrl
File
.
'", "'
.
$sDivname
.
'");
</script>'
;
}
...
...
@@ -183,4 +188,3 @@ $sOut.= '<div id="navbuttom">' . aPrjHome() . '</div>';
// -- Ausgabe
echo
$sOut
;
?>
This diff is collapsed.
Click to expand it.
public_html/webservice/getfile.php
0 → 100644
+
29
−
0
View file @
fdaf8ab6
<?php
/*
* script to be used as ajax poll request to get current status of an action
*/
if
(
array_key_exists
(
"ajax"
,
$_GET
))
{
// see pages/act_build.php
$sOutDir
=
sys_get_temp_dir
();
// ... is /tmp
$sTmpFile
=
$sOutDir
.
"/"
.
preg_replace
(
'/[^a-z0-9\-\_]/'
,
'_'
,
$_GET
[
"ajax"
]);
// ----------------------------------------------------------------------
$sProcesses
=
"<h2 class=
\"
warning
\"
>please wait ...</h2>"
.
shell_exec
(
"uptime"
)
.
"<br><pre>"
.
shell_exec
(
"ps -f | egrep -v '/(apache|httpd)' | fgrep -v 'ps -f' | fgrep -v grep"
)
.
"</pre>"
;
$sOut
=
file_exists
(
$sTmpFile
)
?
file_get_contents
(
$sTmpFile
)
:
"waiting for "
.
$sTmpFile
;
// ----------------------------------------------------------------------
// output
// ----------------------------------------------------------------------
echo
$sProcesses
.
'<div style="margin-left: 3em; border-left: 5px dotted #eee; padding-left: 1em;">'
.
$sOut
.
'</div><div style="clear: both;"></div>'
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment