Update alifc.php
parent
67fd66dc46
commit
3259eb1db2
|
@ -247,12 +247,12 @@ function updateEnvironment($Envs, $accountId, $region, $service_name, $function_
|
||||||
$tmp_env = array_filter($tmp_env, 'array_value_isnot_null'); // remove null. 清除空值
|
$tmp_env = array_filter($tmp_env, 'array_value_isnot_null'); // remove null. 清除空值
|
||||||
ksort($tmp_env);
|
ksort($tmp_env);
|
||||||
|
|
||||||
$tmpdata['functionName'] = $function_name;
|
$tmpdata['functionName'] = $tmp['functionName'];
|
||||||
$tmpdata['description'] = 'Onedrive index and manager in Ali FC.';
|
$tmpdata['description'] = $tmp['description'];
|
||||||
$tmpdata['memorySize'] = 128;
|
$tmpdata['memorySize'] = $tmp['memorySize'];
|
||||||
$tmpdata['timeout'] = 30;
|
$tmpdata['timeout'] = $tmp['timeout'];
|
||||||
$tmpdata['runtime'] = 'php7.2';
|
$tmpdata['runtime'] = $tmp['runtime'];
|
||||||
$tmpdata['handler'] = 'index.handler';
|
$tmpdata['handler'] = $tmp['handler'];
|
||||||
$tmpdata['environmentVariables'] = $tmp_env;
|
$tmpdata['environmentVariables'] = $tmp_env;
|
||||||
$tmpdata['code']['zipFile'] = base64_encode( file_get_contents($fcClient->getFunctionCode($service_name, $function_name)['data']['url']) );
|
$tmpdata['code']['zipFile'] = base64_encode( file_get_contents($fcClient->getFunctionCode($service_name, $function_name)['data']['url']) );
|
||||||
return $fcClient->updateFunction($service_name, $function_name, $tmpdata);
|
return $fcClient->updateFunction($service_name, $function_name, $tmpdata);
|
||||||
|
@ -298,15 +298,15 @@ function updateProgram($accountId, $region, $service_name, $function_name, $Acce
|
||||||
"accessKeySecret" => $AccessKeySecret
|
"accessKeySecret" => $AccessKeySecret
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$tmp_env = getfunctioninfo($accountId, $region, $service_name, $function_name, $AccessKeyID, $AccessKeySecret)['data']['environmentVariables'];
|
$tmp = getfunctioninfo($accountId, $region, $service_name, $function_name, $AccessKeyID, $AccessKeySecret)['data'];
|
||||||
|
|
||||||
$tmpdata['functionName'] = $function_name;
|
$tmpdata['functionName'] = $tmp['functionName'];
|
||||||
$tmpdata['description'] = 'Onedrive index and manager in Ali FC.';
|
$tmpdata['description'] = $tmp['description'];
|
||||||
$tmpdata['memorySize'] = 128;
|
$tmpdata['memorySize'] = $tmp['memorySize'];
|
||||||
$tmpdata['timeout'] = 30;
|
$tmpdata['timeout'] = $tmp['timeout'];
|
||||||
$tmpdata['runtime'] = 'php7.2';
|
$tmpdata['runtime'] = $tmp['runtime'];
|
||||||
$tmpdata['handler'] = 'index.handler';
|
$tmpdata['handler'] = $tmp['handler'];
|
||||||
$tmpdata['environmentVariables'] = $tmp_env;
|
$tmpdata['environmentVariables'] = $tmp['environmentVariables'];
|
||||||
$tmpdata['code']['zipFile'] = base64_encode( file_get_contents($source) );
|
$tmpdata['code']['zipFile'] = base64_encode( file_get_contents($source) );
|
||||||
|
|
||||||
return $fcClient->updateFunction($service_name, $function_name, $tmpdata);
|
return $fcClient->updateFunction($service_name, $function_name, $tmpdata);
|
||||||
|
@ -336,7 +336,7 @@ function setConfigResponse($response)
|
||||||
function OnekeyUpate($auth = 'qkqpttgf', $project = 'OneManager-php', $branch = 'master')
|
function OnekeyUpate($auth = 'qkqpttgf', $project = 'OneManager-php', $branch = 'master')
|
||||||
{
|
{
|
||||||
$source = '/tmp/code.zip';
|
$source = '/tmp/code.zip';
|
||||||
$outPath = "/tmp/";
|
$outPath = '/tmp/';
|
||||||
|
|
||||||
// 从github下载对应tar.gz,并解压
|
// 从github下载对应tar.gz,并解压
|
||||||
$url = 'https://github.com/' . $auth . '/' . $project . '/tarball/' . $branch . '/';
|
$url = 'https://github.com/' . $auth . '/' . $project . '/tarball/' . $branch . '/';
|
||||||
|
|
Loading…
Reference in New Issue