File tree 2 files changed +34
-2
lines changed
2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ _site
104
104
105
105
# react stuff
106
106
node_modules /
107
+ checksum.txt
107
108
108
109
lerna-debug.log
109
110
npm-debug.log *
Original file line number Diff line number Diff line change @@ -92,9 +92,40 @@ mv common/common.zip react_frontend/src/common.zip
92
92
# Prepare the frontend
93
93
nvm install 17
94
94
nvm use 17
95
+
96
+ # Checking if the frontend needs compilation
95
97
cd react_frontend/
96
- yarn install
97
- yarn build
98
+ DIRECTORY_TO_MONITOR=" ."
99
+
100
+ new_checksum=$( find " $DIRECTORY_TO_MONITOR " \( -path " */node_modules" -o \
101
+ -path " */__pycache__" -o \
102
+ -path " */migrations" -o \
103
+ -name " yarn.lock" -o \
104
+ -name " checksum.txt" \) -prune \
105
+ -o -type f -exec md5sum {} + | \
106
+ sort | \
107
+ md5sum | \
108
+ awk ' {print $1}' )
109
+
110
+ existing_checksum_file=" $DIRECTORY_TO_MONITOR /checksum.txt"
111
+
112
+ if [ -f " $existing_checksum_file " ]; then
113
+ existing_checksum=$( cat " $existing_checksum_file " )
114
+ if [ " $existing_checksum " != " $new_checksum " ]; then
115
+ echo " $new_checksum " > " $existing_checksum_file "
116
+ yarn install
117
+ yarn dev &
118
+ sleep 10
119
+ else
120
+ echo " No Compilation needed"
121
+ fi
122
+ else
123
+ echo " $new_checksum " > " $existing_checksum_file "
124
+ yarn install
125
+ yarn dev &
126
+ sleep 10
127
+ fi
128
+
98
129
cd ..
99
130
100
131
# Prepare the compose file
You can’t perform that action at this time.
0 commit comments