差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| 20220427_github_setting [2022/05/11 06:51] – 133.11.144.12 | 20220427_github_setting [Unknown date] (現在) – 削除 - 外部編集 (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | ====== Windows PC Local Environment Configuration from Github repository ====== | ||
| - | download git and node.js | ||
| - | | ||
| - | < | ||
| - | |||
| - | Generating a new SSH key | ||
| - | ssh-keygen -t ed25519 -C " | ||
| - | Adding the SSH public key to the ssh-agent on GitHub suikou account setting page | ||
| - | | ||
| - | For the first time setting, clone the repository from github to your PC | ||
| - | git clone git@github.com: | ||
| - | | ||
| - | check if the website work functionally | ||
| - | < | ||
| - | npm install ejs | ||
| - | npm install i18n | ||
| - | npm install –save express-session</ | ||
| - | npm start | ||
| - | localhost: | ||
| - | | ||
| - | After changes occur, push | ||
| - | git add . | ||
| - | | ||
| - | git commit -m "your message" | ||
| - | (when you do this step, it may ask " | ||
| - | git config --global user.email " | ||
| - | git config --global user.name " | ||
| - | | ||
| - | git push origin main | ||
| - | |||
| - | Get the latest version remotely and merge to local | ||
| - | git pull | ||
| - | |||
| - | ====== Test enviroment ====== | ||
| - | port 3003 | ||
| - | |||
| - | Get the latest version remotely | ||
| - | git pull | ||
| - | |||
| - | start program | ||
| - | //Record the running logs, and monitor all file changes in the folder// | ||
| - | forever start -l forever.log -a -o out.log -e err.log --workingDir / | ||
| - | | ||
| - | Stop program | ||
| - | forever list # check the running forever program # | ||
| - | pwdx [pid] # check the program' | ||
| - | forever stop[order or pid] #stop the program # | ||
| - | lsof -i: | ||
| - | kill [pid] # kill port-occupying processes # | ||
| - | //After running ```forever stop```, the reason why ```forever start``` does not run functionally is that even if the forever project is stopped, the port is still occupied, you can see the pid of the occupied project by using ```lsof -i:3003```, and after ```kill```ed it, ```forever start``` can go smoothly.// | ||
| - | |||
| - | ====== Production enviroment ====== | ||
| - | I move the old production environment to mitosearch.old(on m50v251n3.s)\\ Then cloned the repository from GitHub | ||
| - | |||
| - | To update the database files on github | ||
| - | git add . | ||
| - | git commit -m " | ||
| - | git push origin main | ||
| - | | ||
| - | To update the production environment | ||
| - | git pull | ||
| - | | ||
| - | port 3004 | ||
| - | |||
| - | start program | ||
| - | //Record the running logs, and monitor all file changes in the folder// | ||
| - | forever start -l forever.log -a -o out.log -e err.log --workingDir / | ||
| - | | ||
| - | Stop program | ||
| - | forever list # check the running forever program # | ||
| - | pwdx [pid] # check the program' | ||
| - | forever stop[order or pid] #stop the program # | ||
| - | lsof -i: | ||
| - | kill [pid] # kill port-occupying processes # | ||
| - | |||
| - | |||
| - | |||
| - | \\ | ||
| - | \\ | ||
| - | < | ||
| - | |||
| - | 1. 本番環境に移動する。'' | ||
| - | |||
| - | 2. リモートリポジトリ(/ | ||
| - | |||
| - | 2. もし新規に構築した場合、configファイル ''/ | ||
| - | |||
| - | 3. ```git pull```が上手くできない場合(基本的にデプロイ後スクリプトの修正が入るとpullできない)、'' | ||
| - | |||
| - | ※前回デプロイ時、Mitosearch/ | ||
| - | |||
| - | 4. アプリケーションのあるディレクトリに移動。'' | ||
| - | |||
| - | 5. ```forever start --workingDir / | ||
| - | |||
| - | 6. これでデプロイ完了。</ | ||