Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

Commit 03a2dfd

Browse files
committed
XMerge branch 'production'
2 parents 8e00ad6 + bd3a628 commit 03a2dfd

21 files changed

+305
-55
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,19 @@ $ cd ..
5757

5858
## Client installation
5959

60+
61+
### BETA: Build client via Docker.
62+
63+
*Run*:
64+
```bash
65+
$ DOCKER_BUILDKIT=1 docker build --progress=plain --file client.Dockerfile --output build .
66+
```
67+
*Run*:
68+
```bash
69+
$ ./build/staging/Zotero_VERSION/zotero)
70+
```
71+
72+
6073
### Dependencies and source code
6174

6275
For [m|l|w]: m=Mac, w=Windows, l=Linux

bin/init.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
set -eux
44

5-
sudo docker compose exec app-zotprime-dataserver bash -cux 'cd /var/www/zotero/misc && ./init-mysql.sh'
6-
sudo docker compose exec app-zotprime-dataserver bash -cux 'aws --endpoint-url "http://minio:9000" s3 mb s3://zotero'
7-
sudo docker compose exec app-zotprime-dataserver bash -cux 'aws --endpoint-url "http://minio:9000" s3 mb s3://zotero-fulltext'
8-
sudo docker compose exec app-zotprime-dataserver bash -cux 'aws --endpoint-url "http://localstack:4575" sns create-topic --name zotero'
5+
sudo docker compose exec app-zotprime-dataserver sh -cux 'cd /var/www/zotero/misc && ./init-mysql.sh'
6+
#sudo docker compose exec app-zotprime-dataserver sh -cux 'cd /var/www/zotero/misc && ./db_update.sh'
7+
#sudo docker compose exec app-zotprime-dataserver sh -cux 'cd /var/www/zotero/misc/db-updates/2021-10-16 && php ./0_addMasterGroupHasData'
8+
#sudo docker compose exec app-zotprime-dataserver sh -cux 'cd /var/www/zotero/misc/db-updates/2021-10-16 && php ./1_removeMasterGroupTimestampAndVersion'
9+
sudo docker compose exec app-zotprime-dataserver sh -cux 'aws --endpoint-url "http://minio:9000" s3 mb s3://zotero'
10+
sudo docker compose exec app-zotprime-dataserver sh -cux 'aws --endpoint-url "http://minio:9000" s3 mb s3://zotero-fulltext'
11+
sudo docker compose exec app-zotprime-dataserver sh -cux 'aws --endpoint-url "http://localstack:4575" sns create-topic --name zotero'

client.Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
FROM node:16-alpine as intermediate
3+
RUN set -eux; \
4+
apk update && apk upgrade && \
5+
apk add --update --no-cache git bash curl python3 zip perl rsync \
6+
&& rm -rf /var/cache/apk/*
7+
WORKDIR /usr/src/app
8+
COPY . .
9+
RUN git submodule update --init --recursive client/zotero-build
10+
RUN git submodule update --init --recursive client/zotero-standalone-build
11+
RUN git submodule update --init --recursive client/zotero-client
12+
WORKDIR /usr/src/app/client/
13+
RUN set -eux; \
14+
./config.sh
15+
WORKDIR /usr/src/app/client/zotero-client
16+
RUN set -eux; \
17+
npx browserslist@latest --update-db
18+
RUN set -eux; \
19+
npm install
20+
RUN set -eux; \
21+
npm run build
22+
WORKDIR /usr/src/app/client/zotero-standalone-build
23+
RUN set -eux; \
24+
/bin/bash -c './fetch_xulrunner.sh -p l'
25+
RUN set -eux; \
26+
./fetch_pdftools
27+
RUN set -eux; \
28+
./scripts/dir_build -p l
29+
30+
FROM scratch AS export-stage
31+
COPY --from=intermediate /usr/src/app/client/zotero-standalone-build/staging .

client.Dockerfile.dockerignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
clinet/zotero-clinet/.DS_Store
2+
clinet/zotero-clinet/node_modules
3+
clinet/zotero-clinet/build
4+
clinet/zotero-clinet/.signatures.json
5+
clinet/zotero-clinet/tmp
6+
clinet/zotero-build/config.sh
7+
clinet/zotero-build/node_modules
8+
clinet/zotero-standalone-build/*~
9+
clinet/zotero-standalone-build/cache
10+
clinet/zotero-standalone-build/config-custom.sh
11+
clinet/zotero-standalone-build/dist
12+
clinet/zotero-standalone-build/staging
13+
clinet/zotero-standalone-build/xulrunner
14+
clinet/zotero-standalone-build/pdftools
15+
.github
16+
bin
17+
build
18+
dataserver
19+
doc
20+
docker
21+
stream-server
22+
tinymce-clean-server
23+
Zend
24+
docker-compose.yml
25+
*.Dockerfile
26+
README.md

client/config.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/sh
22

3+
set -eux
4+
5+
sed -i "s#'http://zotero.org/'#'http://localhost:8080/'#g" zotero-client/resource/config.js
6+
sed -i "s#'zotero.org'#'localhost'#g" zotero-client/resource/config.js
37
sed -i 's#https://api.zotero.org/#http://localhost:8080/#g' zotero-client/resource/config.js
48
sed -i 's#wss://stream.zotero.org/#ws://localhost:8081/#g' zotero-client/resource/config.js
59
sed -i 's#https://www.zotero.org/#http://localhost:8080/#g' zotero-client/resource/config.js

clientbuildtest.Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
FROM node:16-alpine as intermediate
3+
4+
RUN set -eux; \
5+
apk update && apk upgrade && \
6+
apk add --update --no-cache git bash curl python3 zip perl rsync \
7+
&& rm -rf /var/cache/apk/*
8+
WORKDIR /usr/src/app
9+
RUN mkdir client
10+
RUN cd client
11+
RUN git init
12+
RUN git remote add -f origin https://github.com/uniuuu/zotprime
13+
RUN echo "client/" >> .git/info/sparse-checkout
14+
RUN git pull origin new_dev
15+
RUN git submodule update --init --recursive
16+
WORKDIR /usr/src/app/client/
17+
RUN set -eux; \
18+
./config.sh
19+
WORKDIR /usr/src/app/client/zotero-client
20+
RUN set -eux; \
21+
npx browserslist@latest --update-db
22+
RUN set -eux; \
23+
npm install
24+
RUN set -eux; \
25+
npm run build
26+
WORKDIR /usr/src/app/client/zotero-standalone-build
27+
RUN set -eux; \
28+
./fetch_xulrunner.sh -p l
29+
RUN set -eux; \
30+
./fetch_pdftools
31+
RUN set -eux; \
32+
./scripts/dir_build -p l
33+
34+
35+
FROM scratch AS export-stage
36+
COPY --from=intermediate /usr/src/app/client/zotero-standalone-build/staging/* .

0 commit comments

Comments
 (0)