summaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'frontend')
-rw-r--r--frontend/Package.php3
-rw-r--r--frontend/index.php47
2 files changed, 35 insertions, 15 deletions
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 '<p class="error">' . $e->getMessage() . '.</p>';
@@ -118,7 +121,7 @@ if (isset($_SESSION['logged_in_id'])) :
<tr>
<th>Name</th>
<th>URL</th>
- <th>Git URL</th>
+ <th>Fetching schedule</th>
<th>Description</th>
</tr>
<?php
@@ -131,7 +134,7 @@ if (isset($_SESSION['logged_in_id'])) :
else
echo "<td>&endash;</td>";
echo "
- <td><a href='{$pkg->git_url}'>{$pkg->git_url}</a></td>
+ <td>{$pkg->fetch_type} from {$pkg->fetch_url} in <tt>/{$pkg->fetch_dir}</tt></td>
<td>{$pkg->desc}</td>
</tr>";
}
@@ -147,31 +150,47 @@ if (isset($_SESSION['logged_in_id'])) :
<tr>
<th>Name</th>
<td><input name="create_pkg_name"/></td>
- <td>Shown publicly.</td>
+ <td>Shown publicly. Should be matched by <tt>[a-zA-Z0-9_.-]+</tt>.</td>
</tr>
<tr>
<th>URL</th>
<td><input type="url" name="create_pkg_url"/></td>
- <td>Shown publicly.</td>
+ <td>Shown publicly. For more information.</td>
</tr>
<tr>
- <th>Git URL</th>
- <td><input type="url" name="create_pkg_git_url"/></td>
+ <th>Fetch URL</th>
+ <td><input type="url" name="create_pkg_fetch_url"/></td>
<td>
- <p>Your git repository. It should not require authorisation.</p>
- <p>On scheduled intervals, we will clone the repository and
+ Your repository. It should not require authorisation.<br/>
+ On scheduled intervals, we will fetch your code from here and
search for tags that look like a version number, e.g. <tt>v1.0.2</tt>.
+ The exact regex is <tt>v(\d+)\.(\d+)\.(\d+)</tt>.<br/>
For those versions that are not yet found in the database,
we will checkout the tag and run <tt>make TARGET.tar.gz</tt> for all targets
(currently <tt>linux32</tt>, <tt>linux64</tt>, <tt>mac</tt>, <tt>win32</tt> and <tt>win64</tt>).
- We will then copy tose files to <tt>/repo/PACKAGE/VERSION/PLATFORM.tar.gz</tt>.</p>
+ We will then copy tose files to <tt><?=$_SERVER['HTTP_HOST']?>/repo/PACKAGE/VERSION/PLATFORM.tar.gz</tt>.<br/>
+ Versions that already exist in our database will not be updated when your repository changes; versions are stable.
</td>
</tr>
<tr>
- <th>Description</th>
- <td colspan="2">
- <textarea name="create_pkg_desc" cols="60" rows="6"></textarea>
+ <th>Fetch dir</th>
+ <td><input type="url" name="create_pkg_fetch_dir"/></td>
+ <td>Before <tt>make</tt>-ing the release as described above, we will change directory to this directory.</td>
+ </tr>
+ <tr>
+ <th>Fetch type</th>
+ <td>
+ <select name="create_pkg_fetch_type">
+ <option value="git">Git</option>
+ <option value="svn">Subversion</option>
+ </select>
</td>
+ <td>How should we clone / checkout your code?</td>
+ </tr>
+ <tr>
+ <th>Description</th>
+ <td><textarea name="create_pkg_desc" cols="40" rows="6"></textarea></td>
+ <td>Describe your library. Keep it at reasonable length.</td>
</tr>
<tr>
<th></th>