-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathinit-submodules.sh
More file actions
42 lines (38 loc) · 1.23 KB
/
init-submodules.sh
File metadata and controls
42 lines (38 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# Usage: ./init-submodules.sh [--https]
REPO_URL="git@github.com:CrowdDotDev/crowd.dev.git"
if [ "$1" = "--https" ]; then
REPO_URL="https://github.com/CrowdDotDev/crowd.dev.git"
fi
# clean start on reinitializing the submodule
git submodule deinit -f submodules/crowd.dev
git rm -f submodules/crowd.dev
rm -rf .git/modules/submodules/crowd.dev
rm -rf submodules/crowd.dev
sed -i '/crowd\.dev/,+2d' .gitmodules
# create the submodule directory and add the submodule
mkdir -p submodules
git submodule add -b main "$REPO_URL" submodules/crowd.dev
git add .gitmodules submodules/crowd.dev
cd submodules/crowd.dev || exit 1
# enable sparse checkout and specify the folders
git sparse-checkout init --no-cone
git sparse-checkout set \
/services/base.tsconfig.json \
/services/libs/database \
/services/libs/telemetry \
/services/libs/snowflake \
/services/libs/temporal \
/services/libs/logging \
/services/libs/opensearch \
/services/libs/types \
/services/libs/common \
/services/libs/common_services \
/services/libs/audit-logs \
/services/libs/data-access-layer \
/services/libs/integrations \
/services/libs/slack \
/services/libs/questdb \
/services/libs/queue \
/services/libs/redis \
/services/archetypes