Skip to content

Commit 0fc2390

Browse files
committed
add ncp-previews
Signed-off-by: nachoparker <nacho@ownyourbits.com> add ncp-previews Signed-off-by: nachoparker <nacho@ownyourbits.com>
1 parent f23d6c6 commit 0fc2390

36 files changed

+2848
-12
lines changed

bin/ncp/CONFIG/nc-init.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,15 @@ EOF
148148
ncc app:install notes
149149
ncc app:install tasks
150150
ncc app:install news
151-
ncc app:install previewgenerator
152151

153152
ncc app:enable calendar
154153
ncc app:enable contacts
155154
ncc app:enable notes
156155
ncc app:enable tasks
157156
ncc app:enable news
157+
158+
# ncp-previewgenerator
159+
cp -r /var/www/ncp-previewgenerator /var/www/nextcloud/apps/previewgenerator
158160
ncc app:enable previewgenerator
159161

160162
# previews

bin/ncp/CONFIG/nc-previews-auto.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ configure()
2929
cat > /usr/local/bin/nc-previews <<EOF
3030
#!/bin/bash
3131
echo -e "\n[ nc-previews-auto ]" >> /var/log/ncp.log
32-
ionice -c3 nice -n20 /usr/local/bin/ncc preview:pre-generate -n -vvv 2>&1 >>/var/log/ncp.log &
32+
(
33+
for i in \$(seq 1 \$(nproc)); do
34+
ionice -c3 nice -n20 /usr/local/bin/ncc preview:pre-generate -n -vvv &
35+
done
36+
wait
37+
) 2>&1 >>/var/log/ncp.log &
38+
3339
PID=\$!
3440
[[ "$RUNTIME" != 0 ]] && {
3541
for i in \$(seq 1 1 $RUNTIME); do

bin/ncp/TOOLS/nc-previews.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111

1212
configure()
1313
{
14+
pgrep -af preview:pre-generate &>/dev/null || pgrep -af preview:generate-all &>/dev/null && {
15+
echo "nc-previews is already running"
16+
return 1
17+
}
18+
1419
[[ "$CLEAN" == "yes" ]] && {
1520
local datadir
1621
datadir=$( ncc config:system:get datadirectory ) || {
@@ -23,9 +28,19 @@ configure()
2328
ncc files:scan-app-data -n
2429
}
2530
26-
[[ "$INCREMENTAL" == "yes" ]] && { ncc preview:pre-generate -n -vvv; return $?; }
31+
[[ "$INCREMENTAL" == "yes" ]] && {
32+
for i in $(seq 1 $(nproc)); do
33+
ncc preview:pre-generate -n -vvv &
34+
done
35+
wait
36+
return
37+
}
2738
28-
ncc preview:generate-all -n -v -p "$PATH1"
39+
for i in $(seq 1 $(nproc)); do
40+
[[ "$PATH1" != "" ]] && PATH_ARG=(-p "$PATH1")
41+
ncc preview:generate-all -n -v ${PATH_ARG[@]} &
42+
done
43+
wait
2944
}
3045
3146
install() { :; }

changelog.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11

2-
[v1.17.1](https://github.com/nextcloud/nextcloudpi/commit/b50801a) (2019-09-29) nc-backup: exclude group folders in dataless backup
2+
[v1.18.0](https://github.com/nextcloud/nextcloudpi/commit/c140109) (2019-10-27) add ncp-previews
33

4-
[v1.17.0](https://github.com/nextcloud/nextcloudpi/commit/05e78cc) (2019-09-28) upgrade to NC16.0.5
4+
[v1.17.1 ](https://github.com/nextcloud/nextcloudpi/commit/c63cb27) (2019-09-29) nc-backup: exclude group folders in dataless backup
5+
6+
[v1.17.0 ](https://github.com/nextcloud/nextcloudpi/commit/05e78cc) (2019-09-28) upgrade to NC16.0.5
57

68
[v1.16.9 ](https://github.com/nextcloud/nextcloudpi/commit/46b2187) (2019-09-28) fix apt stuck in interactive conf file dialog
79

docker/nextcloudpi/Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ SHELL ["/bin/bash", "-c"]
1313
ENV DOCKERBUILD 1
1414

1515
RUN mkdir -p /tmp/ncp-build
16-
COPY bin/ /tmp/ncp-build/bin/
17-
COPY etc /tmp/ncp-build/etc/
18-
COPY ncp.sh update.sh /tmp/ncp-build/
19-
COPY ncp-web /tmp/ncp-build/ncp-web/
20-
COPY ncp-app /tmp/ncp-build/ncp-app/
21-
COPY docker /tmp/ncp-build/docker/
16+
COPY bin/ /tmp/ncp-build/bin/
17+
COPY etc /tmp/ncp-build/etc/
18+
COPY ncp.sh update.sh /tmp/ncp-build/
19+
COPY ncp-web /tmp/ncp-build/ncp-web/
20+
COPY ncp-app /tmp/ncp-build/ncp-app/
21+
COPY ncp-previewgenerator /tmp/ncp-build/ncp-previewgenerator/
22+
COPY docker /tmp/ncp-build/docker/
2223

2324
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt \
2425

ncp-previewgenerator/.travis.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
language: php
2+
php:
3+
- 7
4+
- 7.1
5+
- 7.2
6+
7+
env:
8+
global:
9+
- CORE_BRANCH=master
10+
- APP_NAME=previewgenerator
11+
matrix:
12+
- DB=sqlite
13+
14+
branches:
15+
only:
16+
- master
17+
- /^stable\d+(\.\d+)?$/
18+
19+
before_install:
20+
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
21+
- . ./before_install.sh $APP_NAME $CORE_BRANCH $DB
22+
23+
# Add some output debugging information
24+
- cd ../server
25+
- ./occ check
26+
- ./occ status
27+
- ./occ app:list
28+
- ./occ app:enable $APP_NAME
29+
30+
script:
31+
- cd apps/$APP_NAME/
32+
33+
# Test the app
34+
- sh -c "find . -name \*.php -exec php -l \"{}\" \;;"
35+
- cd ../../
36+
#- sh -c "./occ app:check-code $APP_NAME -c private -c strong-comparison;"
37+
#- sh -c "./occ app:check-code $APP_NAME -c deprecation;"
38+
- cd apps/$APP_NAME/
39+
40+
# Run phpunit tests
41+
- cd tests/
42+
- sh -c "phpunit --configuration phpunit.xml"
43+
44+
after_success:
45+
- bash <(curl -s https://codecov.io/bash)

ncp-previewgenerator/CHANGELOG.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
## 2.1.0 - 2019-03-05
2+
### Added
3+
- Nextcloud 16 support
4+
5+
## 2.0.0 - 2018-11-08
6+
7+
- PHP 7.x required
8+
- Nextcloud 14 only
9+
- Moved to migrations for DB handling
10+
- Added path option to generate command (thanks to @adduxa)
11+
- Nextcloud 15 compatible
12+
13+
## 1.0.9 - 2017-12-29
14+
15+
### Fixes
16+
17+
### Added
18+
- Show timestamp in occ commands [#88](https://github.com/rullzer/previewgenerator/pull/88)
19+
- Add Composer Classmap for file (NC13) [#90](https://github.com/rullzer/previewgenerator/pull/90)
20+
- Respect .nomedia [#92](https://github.com/rullzer/previewgenerator/pull/92)
21+
- Use PID to check for already running process [#93](https://github.com/rullzer/previewgenerator/pull/93)
22+
23+
## 1.0.8 - 2017-12-21
24+
25+
### Fixes
26+
- Do not add file if it already is in the table [#86](https://github.com/rullzer/previewgenerator/pull/86)
27+
28+
### Added
29+
- Allow to specify sizes to be generated [#87](https://github.com/rullzer/previewgenerator/pull/86)
30+
31+
## 1.0.7 - 2017-09-26
32+
33+
### Fixes
34+
- Updated/Fixed README
35+
- [#55](https://github.com/rullzer/previewgenerator/pull/55) @Eeems
36+
- [#58](https://github.com/rullzer/previewgenerator/pull/58) @MichaIng
37+
- [#67](https://github.com/rullzer/previewgenerator/pull/67) @sndrr
38+
- Avoid folder processing on pre-generate [#73](https://github.com/rullzer/previewgenerator/pull/73) @Seik
39+
40+
### Added
41+
- Make NC13 Compatible [#63](https://github.com/rullzer/previewgenerator/pull/63)
42+
43+
## 1.0.6 - 2017-05-05
44+
45+
### Fixed
46+
- Better preview error handling [#51](https://github.com/rullzer/previewgenerator/pull/51) @icewind1991
47+
- Travis test runs [#53](https://github.com/rullzer/previewgenerator/pull/53)
48+
49+
### Added
50+
- README.md [#52](https://github.com/rullzer/previewgenerator/pull/52)
51+
- CHANGELOG.md [#52](https://github.com/rullzer/previewgenerator/pull/52)
52+
53+
## 1.0.5 - 2017-03-17
54+
55+
### Added
56+
- Generate more preview sizes
57+
- Add --force command to break lock
58+
59+
## 1.0.4 - 2017-03-14
60+
61+
### Fixed
62+
- Lock timeout was 30 hours instead of minutes
63+
64+
## 1.0.3 - 2017-03-14
65+
66+
### Added
67+
- Do not use app with encryption
68+
- Check for already running command
69+
70+
## 1.0.2 - 2017-03-08
71+
72+
### Added
73+
- More verbose output of commands
74+
- Hack around preview generation errors by not trying the file again in the next run
75+
76+
## 1.0.1 - 2016-12-08
77+
78+
### Fixed
79+
- Pimp info.xml
80+
81+
## 1.0.0 – 2016-12-07
82+
Initial release

0 commit comments

Comments
 (0)