Skip to content

Commit 3d626fb

Browse files
committed
run git clone for plugins and adapters in parallel, CI still might clash
1 parent e38fa29 commit 3d626fb

File tree

4 files changed

+47
-15
lines changed

4 files changed

+47
-15
lines changed

adapters/install-adapters.sh

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
1-
ADAPTERS="adminforth-completion-adapter-open-ai-chat-gpt adminforth-email-adapter-aws-ses adminforth-google-oauth-adapter adminforth-github-oauth-adapter"
1+
#!/usr/bin/env bash
2+
ADAPTERS="adminforth-completion-adapter-open-ai-chat-gpt adminforth-email-adapter-aws-ses adminforth-google-oauth-adapter adminforth-github-oauth-adapter adminforth-facebook-oauth-adapter adminforth-keycloak-oauth-adapter"
23

3-
# for each plugin
4-
for adapter in $ADAPTERS; do
4+
# for each
5+
install_adapter() {
6+
adapter=$1
57

68
if [ -d "$adapter/.git" ]; then
79
echo "Repository for $adapter exists. Pulling latest changes..."
810
cd "$adapter"
911
git pull
1012
else
1113
echo "Repository for $adapter does not exist. Cloning..."
12-
git clone [email protected]:devforth/$adapter.git
13-
cd $adapter
14+
git clone [email protected]:devforth/$adapter.git "$adapter"
15+
cd "$adapter"
1416
fi
15-
17+
1618
npm ci
1719
cd ..
18-
done
20+
}
21+
22+
do_npm_ci() {
23+
adapter=$1
24+
cd "$adapter"
25+
npm ci
26+
cd ..
27+
}
1928

29+
export -f install_adapter
30+
export -f do_npm_ci
2031

32+
echo $ADAPTERS | tr ' ' '\n' | xargs -P 0 -I {} bash -c 'install_adapter "$@"' _ {}
33+
34+
echo $ADAPTERS | tr ' ' '\n' | while read adapter; do
35+
do_npm_ci "$adapter"
36+
done

adminforth/documentation/docs/tutorial/03-Customization/03-virtualColumns.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ columns: [
138138
...
139139
]
140140
```
141+
141142
This way, when admin selects, for example, "Luxury" option for "Apartment Type" filter, it will be replace with a more complex "or" filter.
142143
143144
### Custom SQL queries with `insecureRawSQL`

adminforth/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"docs": "typedoc",
2222
"--comment_postinstall": "postinstall executed after package installed in other project package and when we do npm ci in the package",
2323
"postinstall": "if test -d ./dist/spa/; then cd ./dist/spa/ && npm ci && echo 'installed spa dependencies'; fi",
24-
"install-plugins": "cd ../plugins && sh install-plugins.sh",
25-
"install-adapters": "cd ../adapters && sh install-adapters.sh"
24+
"install-plugins": "cd ../plugins && bash install-plugins.sh",
25+
"install-adapters": "cd ../adapters && bash install-adapters.sh"
2626
},
2727
"release": {
2828
"plugins": [

plugins/install-plugins.sh

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,38 @@
1+
#!/usr/bin/env bash
12
PLUGINS="adminforth-audit-log adminforth-email-password-reset adminforth-foreign-inline-list \
23
adminforth-i18n adminforth-import-export adminforth-text-complete adminforth-open-signup \
34
adminforth-rich-editor adminforth-two-factors-auth adminforth-upload adminforth-oauth \
45
adminforth-list-in-place-edit adminforth-inline-create"
56

6-
# for each plugin
7-
for plugin in $PLUGINS; do
7+
# Function to install a plugin
8+
install_plugin() {
9+
plugin=$1
810

911
if [ -d "$plugin/.git" ]; then
1012
echo "Repository for $plugin exists. Pulling latest changes..."
1113
cd "$plugin"
1214
git pull
1315
else
1416
echo "Repository for $plugin does not exist. Cloning..."
15-
git clone [email protected]:devforth/$plugin.git
16-
cd $plugin
17+
git clone [email protected]:devforth/$plugin.git "$plugin"
18+
cd "$plugin"
1719
fi
18-
20+
21+
cd ..
22+
}
23+
24+
do_npm_ci() {
25+
plugin=$1
26+
cd "$plugin"
1927
npm ci
2028
cd ..
21-
done
29+
}
30+
31+
export -f install_plugin
32+
export -f do_npm_ci
2233

34+
echo $PLUGINS | tr ' ' '\n' | xargs -P 0 -I {} bash -c 'install_plugin "$@"' _ {}
2335

36+
echo $PLUGINS | tr ' ' '\n' | while read plugin; do
37+
do_npm_ci "$plugin"
38+
done

0 commit comments

Comments
 (0)