From 5515b5bc9a26963b51a4c84b8db0f709fd0517cb Mon Sep 17 00:00:00 2001
From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com>
Date: Mon, 20 Dec 2021 10:42:11 +0800
Subject: [PATCH] add git source: HIT
---
platform/Heroku.php | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/platform/Heroku.php b/platform/Heroku.php
index 2fc2c05..b8887b3 100644
--- a/platform/Heroku.php
+++ b/platform/Heroku.php
@@ -340,10 +340,15 @@ function_name:' . $_SERVER['function_name'] . '
';
}
-function OnekeyUpate($auth = 'qkqpttgf', $project = 'OneManager-php', $branch = 'master')
+function OnekeyUpate($GitSource = 'Github', $auth = 'qkqpttgf', $project = 'OneManager-php', $branch = 'master')
{
- //'https://github.com/qkqpttgf/OneManager-php/tarball/master/';
- $source = 'https://github.com/' . $auth . '/' . $project . '/tarball/' . urlencode($branch) . '/';
+ if ($GitSource=='Github') {
+ //'https://github.com/qkqpttgf/OneManager-php/tarball/master/';
+ $source = 'https://github.com/' . $auth . '/' . $project . '/tarball/' . urlencode($branch) . '/';
+ } elseif ($GitSource=='HITGitlab') {
+ $source = 'https://git.hit.edu.cn/' . $auth . '/' . $project . '/-/archive/' . urlencode($branch) . '/' . $project . '-' . urlencode($branch) . '.tar.gz';
+ } else return ['stat'=>403, 'body'=>json_encode(['id'=>'Error', 'message'=>'Git Source input Error!'])];
+
return updateHerokuapp(getConfig('HerokuappId'), getConfig('APIKey'), $source);
}