20220427_github_setting

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
20220427_github_setting [2022/05/11 06:36] 133.11.144.1220220427_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 
-   
-<del>Unzip [[http://www.suikou.fs.a.u-tokyo.ac.jp/dokuwiki/doku.php?ns=%3A&image=%3Aid_ed25519.zip&do=media&tab_files=files&tab_details=view|The private key file]] and put it into C:\Users\//your user name//\ .ssh</del> 
- 
-Generating a new SSH key 
-  ssh-keygen -t ed25519 -C "suikoucalender@gmail.com" 
-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:suikoucalender/mitosearch.git 
-   
-check if the website work functionally 
-  npm install 
-  npm install ejs 
-  npm install i18n 
-  npm install –save express-session 
-  npm start 
-  localhost:3005 
-   
-After changes occur, push 
-  git add . 
-   
-  git commit -m "your message" 
-   (when you do this step, it may ask "please tell me who you are", use this↓ first) 
-    git config --global user.email "suikoucalender@gmail.com" 
-    git config --global user.name "suikoucalender" 
-   
-  git push origin main 
- 
-Get the latest version remotely and merge to local 
-  git pull 
- 
-====== Test enviroment ======  
-port 3003 
- 
-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 /home/yoshitake/mitosearch_dev/mitosearch/Mitosearch -c "npm start"  --watchDirectory ./ ./ 
-   
- Stop program 
-  forever list           # check the running forever program # 
-  pwdx [pid]           # check the program's name # 
-  forever stop[order or pid]           #stop the program # 
-  lsof -i:3003           # Detect port-occupying processes # 
-  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 "Database files updates" 
-  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 /home/yoshitake/mitosearch_dev/mitosearch/Mitosearch -c "npm start"  --watchDirectory ./ ./ 
-   
- Stop program 
-  forever list           # check the running forever program # 
-  pwdx [pid]           # check the program's name # 
-  forever stop[order or pid]           #stop the program # 
-  lsof -i:3004           # Detect port-occupying processes # 
-  kill [pid]           # kill port-occupying processes # 
- 
- 
- 
-\\ 
-\\   
-<del>2. また、既に実行されているMitoSearchDBを停止させておく。```forever list```で出てくるのはMetaSearchDBやMitoSearchがあるので、どれがMitoSearchDBかを調べるため、pidの数字に対して```pwdx <pid>```とpwdxを使って実行ディレクトリを調べて、```/home/yoshitake/mitosearch/mitosearch```で実行されているプロセスのuid前の数字(0,1,2,...程度の値)を割り出す。それから```forever stop <uid前の数字>```で停止できる。停止まで数分程度かかる様子。 
- 
-1. 本番環境に移動する。''cd /home/yoshitake/mitosearch/'' 
- 
-2. リモートリポジトリ(/home/yoshitake/mitosearch\_repo)から、最新版をPull。''git pull'' (初回構築時は```git pull origin master```の必要あり) 
- 
-2. もし新規に構築した場合、configファイル ''/home/yoshitake/mitosearch/Mitosearch/config/config.json'' とinputFileのシンボリックリンクの配置を''ln -s ~/mitosearch_db/db_fish/ ~/mitosearch/Mitosearch/db_fish''で行う。 
- 
-3. ```git pull```が上手くできない場合(基本的にデプロイ後スクリプトの修正が入るとpullできない)、''git fetch origin master'' でリモートの最新の状態を取り込んだ後、''git reset \--hard origin/master'' でリセットをおこなう。 
- 
-※前回デプロイ時、Mitosearch/data/fish/lat-long-date.txtがローカル環境・本番環境両方から消失した。次回git pull時にはバックアップを取っておくよう注意!!! 
- 
-4. アプリケーションのあるディレクトリに移動。''cd /home/yoshitake/mitosearch/mitosearch'' その後、依存関係を解消する。''npm install'' ''npm install i18n'' ''npm install --save express-session'' 
- 
-5. ```forever start --workingDir /home/yoshitake/mitosearch/mitosearch -c "npm start" ./``` で再起動。\\ ※startが上手くいかない時は取り敢えずPCをrebootした方が楽sudo reboot。foreverを再起動してもすぐ停止してしまうことがある(forever stopしてもポートが占有されている?) 
- 
-6. これでデプロイ完了。</del> 
  • 20220427_github_setting.1652250995.txt.gz
  • 最終更新: 2022/05/11 06:36
  • by 133.11.144.12