Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 63ef2cc

Browse files
author
the-djmaze
committed
Create Nextcloud release builder for #96
1 parent bdca1f4 commit 63ef2cc

File tree

5 files changed

+50
-5
lines changed

5 files changed

+50
-5
lines changed

build/nextcloud.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
echo "\x1b[33;1m === Nextcloud === \x1b[0m\n";
3+
4+
$nc_destination = "{$destPath}snappymail-{$package->version}-nextcloud.tar";
5+
6+
@unlink($nc_destination);
7+
@unlink("{$nc_destination}.gz");
8+
9+
$nc_tar = new PharData($nc_destination);
10+
11+
$nc_tar->buildFromDirectory('./integrations/nextcloud', "@integrations/nextcloud/snappymail/@");
12+
13+
$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator('snappymail/v'), RecursiveIteratorIterator::SELF_FIRST);
14+
foreach ($files as $file) {
15+
if (is_file($file)) {
16+
$file = str_replace('\\', '/', $file);
17+
$nc_tar->addFile($file, "snappymail/app/{$file}");
18+
}
19+
}
20+
/*
21+
$nc_tar->addFile('data/.htaccess');
22+
$nc_tar->addFromString('data/VERSION', $package->version);
23+
$nc_tar->addFile('data/README.md');
24+
*/
25+
$nc_tar->addFile('_include.php', 'snappymail/app/_include.php');
26+
$nc_tar->addFile('.htaccess', 'snappymail/app/.htaccess');
27+
28+
$index = file_get_contents('index.php');
29+
$index = str_replace('0.0.0', $package->version, $index);
30+
$nc_tar->addFromString('snappymail/app/index.php', $index);
31+
$nc_tar->addFile('README.md', 'snappymail/app/README.md');
32+
33+
$data = file_get_contents('dev/serviceworker.js');
34+
$nc_tar->addFromString('snappymail/app/serviceworker.js', $data);
35+
36+
$nc_tar->compress(Phar::GZ);
37+
unlink($nc_destination);
38+
$nc_destination .= '.gz';
39+
40+
echo "{$nc_destination} created\n";

integrations/nextcloud/snappymail/VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

integrations/nextcloud/snappymail/appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
<id>snappymail</id>
44
<name>SnappyMail</name>
55
<summary>SnappyMail Webmail</summary>
6-
<description>Simple, modern and fast web-based email client. After enabling in Nextcloud, go to Nextcloud admin panel, "Additionnal settings" and you will see a "SnappyMail webmail" section. There, click on the link to go to the SnappyMail admin panel. The default user/password is admin/12345. This version is based on SnappyMail 2.6.0 (2021-07).</description>
76
<version>2.18.5</version>
87
<licence>agpl</licence>
98
<author>SnappyMail, RainLoop Team, Nextgen-Networks, Tab Fitts, Nathan Kinkade, Pierre-Alain Bandinelli</author>
9+
<description>Simple, modern and fast web-based email client. After enabling in Nextcloud, go to Nextcloud admin panel, "Additionnal settings" and you will see a "SnappyMail webmail" section. There, click on the link to go to the SnappyMail admin panel.</description>
1010
<namespace>SnappyMail</namespace>
1111
<documentation>
1212
<user>https://github.com/the-djmaze/snappymail/blob/master/integrations/nextcloud/snappymail/README.md</user>

integrations/nextcloud/snappymail/appinfo/version

Lines changed: 0 additions & 1 deletion
This file was deleted.

release.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?php
33
chdir(__DIR__);
44

5-
$options = getopt('', ['aur','docker','plugins','set-version','skip-gulp','debian','sign']);
5+
$options = getopt('', ['aur','docker','plugins','set-version','skip-gulp','debian','nextcloud','sign']);
66

77
if (isset($options['plugins'])) {
88
require(__DIR__ . '/build/plugins.php');
@@ -27,7 +27,6 @@
2727
$file = __DIR__ . '/.docker/release/files/usr/local/include/application.ini';
2828
file_put_contents($file, preg_replace('/current = "[0-9.]+"/', "current = \"{$package->version}\"", file_get_contents($file)));
2929
// nextcloud
30-
file_put_contents(__DIR__ . '/integrations/nextcloud/snappymail/VERSION', $package->version);
3130
$file = __DIR__ . '/integrations/nextcloud/snappymail/appinfo/info.xml';
3231
file_put_contents($file, preg_replace('/<version>[^<]*</', "<version>{$package->version}<", file_get_contents($file)));
3332
// virtualmin
@@ -175,6 +174,10 @@ function __get_custom_data_full_path()
175174

176175
echo "{$zip_destination} created\n{$tar_destination} created\n";
177176

177+
if (isset($options['nextcloud'])) {
178+
require(__DIR__ . '/build/nextcloud.php');
179+
}
180+
178181
rename("snappymail/v/{$package->version}", 'snappymail/v/0.0.0');
179182

180183
file_put_contents("{$destPath}core.json", '{
@@ -252,6 +255,10 @@ function b2sum($file) {
252255
echo "\x1b[33;1m === PGP Sign === \x1b[0m\n";
253256
passthru('gpg --local-user 1016E47079145542F8BA133548208BA13290F3EB --armor --detach-sign '.escapeshellarg($tar_destination), $return_var);
254257
passthru('gpg --local-user 1016E47079145542F8BA133548208BA13290F3EB --armor --detach-sign '.escapeshellarg($zip_destination), $return_var);
258+
if (isset($options['nextcloud'])) {
259+
passthru('gpg --local-user 1016E47079145542F8BA133548208BA13290F3EB --armor --detach-sign '
260+
.escapeshellarg("{$destPath}snappymail-{$package->version}-nextcloud.tar.gz"), $return_var);
261+
}
255262
if (isset($options['debian'])) {
256263
passthru('gpg --local-user 1016E47079145542F8BA133548208BA13290F3EB --armor --detach-sign '
257264
. escapeshellarg(__DIR__ . "/build/dist/releases/webmail/{$package->version}/" . basename(DEB_DEST_DIR.'.deb')), $return_var);

0 commit comments

Comments
 (0)