From 78e8956015edb622777012797c263368918094a6 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 7 Feb 2017 22:55:04 +0100 Subject: Frontend to support both Git and Subversion --- db/install.sql | 4 +++- frontend/Package.php | 3 ++- frontend/index.php | 47 +++++++++++++++++++++++++++++++++-------------- 3 files changed, 38 insertions(+), 16 deletions(-) diff --git a/db/install.sql b/db/install.sql index fbcf340..5c7c24e 100644 --- a/db/install.sql +++ b/db/install.sql @@ -10,8 +10,10 @@ CREATE TABLE `package` ( `author_id` tinyint(3) UNSIGNED NOT NULL, `name` varchar(63) NOT NULL, `url` varchar(2047) NOT NULL, - `git_url` varchar(2047) NOT NULL, `desc` text NOT NULL, + `fetch_url` varchar(2047) NOT NULL, + `fetch_dir` varchar(255) NOT NULL, + `fetch_type` varchar(6) NOT NULL, `time_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; diff --git a/frontend/Package.php b/frontend/Package.php index 0b2afed..89a268e 100644 --- a/frontend/Package.php +++ b/frontend/Package.php @@ -2,7 +2,8 @@ class Package extends Model { public static $table = 'package', - $fillable_columns = ['author_id', 'name', 'url', 'git_url', 'desc']; + $fillable_columns = ['author_id', 'name', 'url', 'desc', + 'fetch_url', 'fetch_dir', 'fetch_type']; public function getAuthor() { return new Author($this->pdo, $this->author_id); diff --git a/frontend/index.php b/frontend/index.php index 21d8a8a..c0bcfe3 100644 --- a/frontend/index.php +++ b/frontend/index.php @@ -47,8 +47,11 @@ if (isset($_SESSION['logged_in_id'])) { [ $_author->id , $_POST['create_pkg_name'] , $_POST['create_pkg_url'] - , $_POST['create_pkg_git_url'] - , $_POST['create_pkg_desc']]); + , $_POST['create_pkg_desc'] + , $_POST['create_pkg_fetch_url'] + , $_POST['create_pkg_fetch_dir'] + , $_POST['create_pkg_fetch_type'] + ]); echo 'Your package has been created.'; } catch (Exception $e) { echo '

' . $e->getMessage() . '.

'; @@ -118,7 +121,7 @@ if (isset($_SESSION['logged_in_id'])) : Name URL - Git URL + Fetching schedule Description &endash;"; echo " - {$pkg->git_url} + {$pkg->fetch_type} from {$pkg->fetch_url} in /{$pkg->fetch_dir} {$pkg->desc} "; } @@ -147,31 +150,47 @@ if (isset($_SESSION['logged_in_id'])) : Name - Shown publicly. + Shown publicly. Should be matched by [a-zA-Z0-9_.-]+. URL - Shown publicly. + Shown publicly. For more information. - Git URL - + Fetch URL + -

Your git repository. It should not require authorisation.

-

On scheduled intervals, we will clone the repository and + Your repository. It should not require authorisation.
+ On scheduled intervals, we will fetch your code from here and search for tags that look like a version number, e.g. v1.0.2. + The exact regex is v(\d+)\.(\d+)\.(\d+).
For those versions that are not yet found in the database, we will checkout the tag and run make TARGET.tar.gz for all targets (currently linux32, linux64, mac, win32 and win64). - We will then copy tose files to /repo/PACKAGE/VERSION/PLATFORM.tar.gz.

+ We will then copy tose files to /repo/PACKAGE/VERSION/PLATFORM.tar.gz.
+ Versions that already exist in our database will not be updated when your repository changes; versions are stable. - Description - - + Fetch dir + + Before make-ing the release as described above, we will change directory to this directory. + + + Fetch type + + + How should we clone / checkout your code? + + + Description + + Describe your library. Keep it at reasonable length. -- cgit v1.2.3