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
468e6871
Commit
468e6871
authored
Dec 20, 2023
by
张思远
Browse files
Options
Browse Files
Download
Plain Diff
a
parents
7d052820
86113a3e
Pipeline
#153
canceled with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
7 deletions
+70
-7
.gitlab-ci.yml
.gitlab-ci.yml
+23
-0
t.bat
t.bat
+7
-2
test.txt
test.txt
+3
-2
webhook.php
webhook.php
+37
-3
No files found.
.gitlab-ci.yml
0 → 100644
View file @
468e6871
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
View file @
468e6871
<<<<<<< HEAD
cd %1
git pull
\ No newline at end of file
git pull
=======
%username%
pause
>>>>>>> 86113a3e1937102c4b42424a70135869c24d5425
test.txt
View file @
468e6871
git pull test success
\ No newline at end of file
git pull test success
test runner
\ No newline at end of file
webhook.php
View file @
468e6871
<?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
;
\ No newline at end of file
$cmd
=
't.bat '
.
$dir
.
' '
.
$web_url
;
$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