fix scf update

pull/41/head
qkqpttgf 2020-04-02 11:17:45 +08:00 committed by GitHub
parent 925ff9fe90
commit 2dc44a92d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -370,13 +370,14 @@ function SetbaseConfig($Envs, $function_name, $Region, $Namespace, $SecretId, $S
return post2url('https://'.$host, $data.'&Signature='.urlencode($signStr));
}
function updateProgram($function_name, $Region, $Namespace, $SecretId, $SecretKey, $source = '')
function updateProgram($function_name, $Region, $Namespace, $SecretId, $SecretKey, $source)
{
WaitSCFStat();
$meth = 'POST';
$host = 'scf.tencentcloudapi.com';
$tmpdata['Action'] = 'UpdateFunctionCode';
$tmpdata['Code.GitUrl'] = $source;
$tmpdata['Code.GitUrl'] = $source['url'];
$tmpdata['Code.GitBranch'] = $source['branch'];
$tmpdata['CodeSource'] = 'Git';
$tmpdata['FunctionName'] = $function_name;
$tmpdata['Handler'] = 'index.main_handler';
@ -410,8 +411,8 @@ namespace:' . $_SERVER['namespace'] . '<br>
function OnekeyUpate($auth = 'qkqpttgf', $project = 'OneManager-php', $branch = 'master')
{
//'https://github.com/qkqpttgf/OneManager-php/tree/v2-MultiDisk';
$source = 'https://github.com/' . $auth . '/' . $project . '/tree/' . $branch;
$source['url'] = 'https://github.com/' . $auth . '/' . $project;
$source['branch'] = $branch;
return json_decode(updateProgram($_SERVER['function_name'], $_SERVER['Region'], $_SERVER['namespace'], getConfig('SecretId'), getConfig('SecretKey'), $source), true)['Response'];
}