You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This script is used to build the upgradable integration_openproject app. It performs the following steps:
6
+
# 1. Copy the build files to a separate folder named publish, excluding unnecessary files and directories.
7
+
# 2. Get the current version of the app and update it to a new version by incrementing the major version number.
8
+
# 3. Sign the app files using self-signed certificate.
9
+
# 4. Archive the app into a .tar.gz file.
10
+
# 5. Sign the archive.
11
+
# NOTE: Before running this script, ensure that the Nextcloud instance is running and integration_openproject app is built.
12
+
13
+
# Required environment variables:
14
+
# 1. NEXTCLOUD_PATH (Absolute path to Nextcloud where occ command is available, e.g. /var/www/html)
15
+
# 2. INTEGRATION_OPENPROJECT_DIR (Absolute path to the directory containing the integration_openproject repository, e.g. /var/www/html/build-app-shared)
16
+
17
+
set -e -o pipefail
18
+
19
+
# helper functions
20
+
log_error() {
21
+
echo -e "\e[31m$1\e[0m"
22
+
}
23
+
24
+
log_info() {
25
+
echo -e "\e[37m$1\e[0m"
26
+
}
27
+
28
+
log_success() {
29
+
echo -e "\e[32m$1\e[0m"
30
+
}
31
+
32
+
if [[ -z"$NEXTCLOUD_PATH" ]] || [[ -z"$INTEGRATION_OPENPROJECT_DIR" ]];then
if [[ !-d"$INTEGRATION_OPENPROJECT_DIR/$APP_ID" ]];then
41
+
log_error "Folder does not exist: $INTEGRATION_OPENPROJECT_DIR/$APP_ID"
42
+
exit 1
43
+
fi
44
+
45
+
mkdir -p publish
46
+
47
+
# copy app files to a separate folder
48
+
log_info "Copying necessary app files to publish directory..."
49
+
rsync -a \
50
+
--exclude=server \
51
+
--exclude=dev \
52
+
--exclude=.git \
53
+
--exclude=appinfo/signature.json \
54
+
--exclude='*.swp' \
55
+
--exclude=build \
56
+
--exclude=.gitignore \
57
+
--exclude=.travis.yml \
58
+
--exclude=.scrutinizer.yml \
59
+
--exclude=CONTRIBUTING.md \
60
+
--exclude=composer.phar \
61
+
--exclude=js/node_modules \
62
+
--exclude=node_modules \
63
+
--exclude=src \
64
+
--exclude=translationfiles \
65
+
--exclude='webpack.*' \
66
+
--exclude=stylelint.config.js \
67
+
--exclude=.eslintrc.js \
68
+
--exclude=.github \
69
+
--exclude=.gitlab-ci.yml \
70
+
--exclude=crowdin.yml \
71
+
--exclude=tools \
72
+
--exclude=.tx \
73
+
--exclude=.l10nignore \
74
+
--exclude=l10n/.tx \
75
+
--exclude=l10n/l10n.pl \
76
+
--exclude=l10n/templates \
77
+
--exclude='l10n/*.sh' \
78
+
--exclude='l10n/[a-z][a-z]' \
79
+
--exclude='l10n/[a-z][a-z]_[A-Z][A-Z]' \
80
+
--exclude=l10n/no-php \
81
+
--exclude=makefile \
82
+
--exclude=screenshots \
83
+
--exclude='phpunit*xml' \
84
+
--exclude=tests \
85
+
--exclude=ci \
86
+
--exclude=vendor/bin \
87
+
$APP_ID publish/
88
+
89
+
cd publish
90
+
91
+
# get current version of integration_openproject and update to new version
92
+
current_version=$(php ${NEXTCLOUD_PATH}/occ app:list --output=json | jq -r ".enabled.$APP_ID")|| { log_error "Failed to get current version of $APP_ID app.";exit 1; }
93
+
IFS=. read -r a b c <<<"$current_version"
94
+
NEXT_APP_VERSION="$((a+1)).$b.$c"
95
+
96
+
# Save the new tag to a file for later use in the workflow
0 commit comments