Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webhook-test-zsy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张思远
webhook-test-zsy
Commits
44d9c942
Commit
44d9c942
authored
Dec 20, 2023
by
张思远
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ci test
parent
1f39dd97
Pipeline
#151
canceled with stages
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
3 deletions
+64
-3
.gitlab-ci.yml
.gitlab-ci.yml
+23
-0
t.bat
t.bat
+4
-0
webhook.php
webhook.php
+37
-3
No files found.
.gitlab-ci.yml
0 → 100644
View file @
44d9c942
build-job
:
stage
:
build
script
:
-
echo "Hello, $GITLAB_USER_LOGIN!"
test-job1
:
stage
:
test
script
:
-
echo "This job tests something"
test-job2
:
stage
:
test
script
:
-
echo "This job tests something, but takes more time than test-job1."
-
echo "After the echo commands complete, it runs the sleep command for 20 seconds"
-
echo "which simulates a test that runs 20 seconds longer than test-job1"
-
sleep 20
deploy-prod
:
stage
:
deploy
script
:
-
echo "This job deploys something from the $CI_COMMIT_BRANCH branch."
environment
:
production
t.bat
0 → 100644
View file @
44d9c942
%username%
pause
\ No newline at end of file
webhook.php
View file @
44d9c942
<?php
<?php
header
(
'Content-type:text/html;charset=utf-8'
);
$post
=
file_get_contents
(
"php://input"
);
$post
=
json_decode
(
$post
,
true
);
mkdir
(
time
(),
0755
);
$project
=
$post
[
'project'
];
$web_url
=
$project
[
'web_url'
];
$web_url
=
str_replace
(
'http://'
,
'https://'
,
$web_url
);
// echo $web_url;exit;
$dir
=
__DIR__
;
exit
;
$cmd
=
't.bat '
.
$dir
.
' '
.
$web_url
;
\ No newline at end of file
$descriptorspec
=
[
[
"pipe"
,
"r"
],
// stdin
[
"pipe"
,
"w"
],
// stdout
[
"pipe"
,
"w"
],
// stderr
];
$proc
=
proc_open
(
$cmd
,
$descriptorspec
,
$pipes
,
null
,
null
);
if
(
$proc
==
false
)
{
// do sth with HTTP response
}
else
{
$stdout
=
stream_get_contents
(
$pipes
[
1
]);
fclose
(
$pipes
[
1
]);
$stderr
=
stream_get_contents
(
$pipes
[
2
]);
fclose
(
$pipes
[
2
]);
$status
=
proc_close
(
$proc
);
// 释放proc
}
echo
'<dl>'
;
echo
'<dt>输出</dt>'
;
echo
'<dd><pre>'
.
$stdout
.
'</pre></dd>'
;
if
(
$stderr
)
{
// echo '<dt>出错了!</dt>';
echo
'<dd><pre>'
.
$stderr
.
'</pre></dd>'
;
}
echo
'</dl>'
;
exit
;
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