Browse Source

added markdown file to list all cmd to build and update Tracim_frontend

Skylsmoi 6 years ago
parent
commit
0a6f5ff309
1 changed files with 126 additions and 0 deletions
  1. 126 0
      all_cmd.md

+ 126 - 0
all_cmd.md View File

@@ -0,0 +1,126 @@
1
+
2
+# First Install Tracim
3
+
4
+## tracim_frontend_lib
5
+A generic repo containing generic components for tracim_frontend_lib and apps
6
+#### get the source of tracim_frontend_lib
7
+```
8
+git clone git@github.com:tracim/tracim_frontend_lib.git
9
+```
10
+#### install tracim_frontend_lib
11
+```
12
+cd tracim_frontend_lib
13
+npm i
14
+```
15
+#### build tracim_frontend_lib and add the "eslint-disabled" and "eslint-enable" on top and bottom of builded file
16
+```
17
+npm run build && echo '/* eslint-disable */' | cat - dist/tracim_lib.js > temp && mv temp dist/tracim_lib.js && printf '\n/* eslint-enable */\n' >> dist/tracim_lib.js
18
+```
19
+##### For Dev Only : Create a npm link for tracim_frontend_lib
20
+```
21
+npm link
22
+```
23
+note: link is called tracim_lib, it will be changed
24
+
25
+## tracim_frontend
26
+The main repository
27
+#### get the source of tracim_frontend
28
+```
29
+git clone git@github.com:tracim/tracim_frontend.git
30
+```
31
+#### install tracim_frontend
32
+```
33
+cd tracim_frontend
34
+npm i
35
+```
36
+#### For Dev Only : Link tracim_frontend to tracim_frontend_lib with npm
37
+```
38
+npm link tracim_lib
39
+```
40
+This will replace the remote dependency tracim_lib in package.json by local dependency tracim_frontend_lib allowing auto propagation of tracim_frontend_lib updates without having to increment the version number
41
+#### build tracim_frontend
42
+```
43
+npm run build
44
+```
45
+
46
+## tracim Apps
47
+For EACH apps do: (here is tracim_frontend_app_pagehtml as an exemple)
48
+#### get the source
49
+```
50
+git clone git@github.com:tracim/tracim_frontend_app_pagehtml.git
51
+```
52
+#### install tracim_frontend_app_pagehtml
53
+```
54
+cd tracim_frontend_app_pagehtml
55
+npm i
56
+```
57
+#### For Dev Only : Link tracim_frontend_app_pagehtml to tracim_frontend_lib with npm
58
+```
59
+npm link tracim_lib
60
+```
61
+This will replace the remote dependency tracim_lib in package.json by local dependency tracim_frontend_lib allowing auto propagation of tracim_frontend_lib updates without having to increment the version number
62
+#### build tracim_frontend
63
+```
64
+npm run build
65
+```
66
+#### copy the builded source to tracim_frontend
67
+```
68
+cp dist/pageHtml.app.js __tracim_frontend repo__/dist/app
69
+```
70
+
71
+
72
+
73
+
74
+# Update All Tracim
75
+### For Development
76
+```
77
+cd tracim_frontend_lib
78
+git pull origin develop
79
+npm i
80
+npm run build && echo '/* eslint-disable */' | cat - dist/tracim_lib.js > temp && mv temp dist/tracim_lib.js && printf '\n/* eslint-enable */\n' >> dist/tracim_lib.js
81
+# the npm link will then update the lib in tracim_frontend and in all apps repositories
82
+cd ..
83
+./update_all_apps_develop.sh # this will update the repo app's, build the source and copy the result to tracim_frontend
84
+cd tracim_frontend
85
+git pull origin develop
86
+npm i
87
+npm run servdev-dashboard
88
+```
89
+#### update_all_apps_develop.sh :
90
+```
91
+#!/bin/bash
92
+echo '=== Start build all apps
93
+'
94
+declare -a listApp=('pageHtml' 'thread')
95
+
96
+for app in "${listApp[@]}"
97
+do
98
+  echo "= building of ${app}
99
+"
100
+  cd "folder of app"
101
+  git pull origin develop
102
+  npm i
103
+  npm run build
104
+  if cp ~/repo/tracim_app/${app}/dist/${app}.app.js ~/repo/tracim_frontend/dist/app ; then
105
+    echo "- ${app}.app.js copy successful"
106
+  else
107
+    echo "=> ${app}.app.js copy failed"
108
+  fi
109
+done
110
+
111
+echo '
112
+=== End build'
113
+```
114
+
115
+
116
+
117
+
118
+### For Production
119
+No need to build tracim_frontend_lib, each repo will get the last version with `npm i`. Assuming tracim_frontend_lib version in package.json has been updated accordingly.
120
+```
121
+./update_all_apps_master.sh # this will update the app's repo, build the source and copy the result to tracim_frontend
122
+cd tracim_frontend
123
+git pull origin master
124
+npm i
125
+npm run build
126
+```