é·ãéã倧èŠæš¡ãª1C-Bitrix Webãããžã§ã¯ãã§ç®¡çè ãããŒãžã£ãŒïŒããçš®ã®ã³ãŒãïŒãšããŠåãæ©äŒããããŸããïŒããŸããŸãªåœã®ããŸããŸãªææ ªçµç¹ãOracleããŒã¿ããŒã¹ãWebã¯ã©ã¹ã¿ãŒãšãã£ã¿ãŒã100 GBãè¶ ãããã¡ã€ã«ãæ°å¹Žã®æŽå²ãæã€40以äžã®ãµã€ããã«ãŒãã«ããã©ãã€ã¢ã»ãã¥ãªãã£ã¢ãŒãã®å€ãã®æŽæ°ã«èããã«ãŒãã«ã®20以äžã®ç·šéãããã³...ããŒãžã§ã³ç®¡çã®ãã³ããªãã§æŠéãµãŒããŒã®ããã³ãºãªã³ãæ©èœãžã®çŽæ¥å€æŽ...
éåžžã«æ²ããåçã§ãå€ãã®ãç£æ¥äºæ ããåŒãèµ·ããã次ã®äºä»¶ã®åŸã«ä¿®æ£ãåœããããŸããã
ãã®èšäºã§ã¯ç§ã®çµéšã«ã€ããŠèª¬æããŸãããäž»ã«ããŒãžã§ã³ç®¡çã·ã¹ãã ã䜿çšããããšããªããã©ãããå§ããã°ãããããããªãå°èŠæš¡ãªã€ã³ã¿ãŒããããããžã§ã¯ãã®ææè ã«åœ¹ç«ã¡ãŸãã
å®éãç§ãã¡ã®ãã©ãã«ã¯ãã¹ãŠ2ã€ã®äž»ãªçç±ã«ãããã®ã§ãã
- 倧ããªãããžã§ã¯ãã¯ãçãã²ãŒãžã®ééã«æ²¿ã£ãŠæããæªæ¥ã«å šéåã§é§ãã€ããŠããããã®æç¹ã§ãã®äžã®ã¬ãŒã«ãå€æŽããã®ã¯å°ãå°é£ã§ããã
- ããŒãžã§ã³ç®¡çã·ã¹ãã ãšç¹ã«GITã«é¢ããèšå€§ãªéã®æç®ããããŸãããã»ãšãã©ãã¹ãŠãã¹ã¯ãªãããšæ確ãªã¬ã€ãã©ã€ã³ã®æ¬ åŠã«èŠããã§ããŸãã ããšãã°ã壮倧ãªPro Gitã¯åã ã®æ©èœãšæäœãå®å šã«èª¬æããŠããŸããããã®å¯ãã©ããã䜿ãå§ãããã«ã€ããŠã¯ã»ãšãã©ããããŸããã
ãã£ããã³ã®èšŒæ
GITã䜿ãå§ããã人ãžã®ç§ã®æ倧ã®ãã³ãã¯ãå§ããããšã§ãã
ãšãããããå°ãªããšãäœãããå§ããŠãã ããã
ãããŠè€éã«ãªããŸãã
å人çã«ã¯ãæ£ã«å°æ¬ãæ瀺ãèŒããã®ã«éåžžã«åœ¹ç«ã¡ãŸããã
ãšãããããå°ãªããšãäœãããå§ããŠãã ããã
ãããŠè€éã«ãªããŸãã
å人çã«ã¯ãæ£ã«å°æ¬ãæ瀺ãèŒããã®ã«éåžžã«åœ¹ç«ã¡ãŸããã
ç©èªã¯ããã€ãã®éšåã«åããããŸãã
- ç¶æ³ã®èª¬æ
- ããŒã«
- 説ææž
- 3.1ãªããžããªã®åæå
- 3.2ããŒãªã³ã°ã¿ã¹ã¯ã®æŽæ°
- 3.3æ¯æ¥ã®å€æŽãã³ãããããïŒäžæ¥ã®çµããïŒ
- 3.4ããŒã«ããã¯ã®å€æŽ
- ãããã«
- ãããã質å
ããŒã1-ç¶æ³ã®èª¬æ
ç§ã¯é¡§å®¢ã®é åã«çŽæ¥äœçœ®ããŠããã顧客ãšéçºè ã®éã®äžçš®ã®ãžã£ã³ããŒãšããŠæ©èœããŸãã
ã客æ§ã®åªããã»ãã¥ãªãã£ã¬ãŒãã¯ãäœã§ã眮ãæããããšãã§ãããã¹ãŠã®ãã®ãžã®ã¢ã¯ã»ã¹ãå¶éããŸãã
ãããããç§ãšéçºè ãSSH / FTPã¢ã¯ã»ã¹ãæã£ãŠããã°ããã®èšäºã¯æ±ºããŠç»å Žããªãã£ãã§ãããïŒãããŠããã®èåŸã«æœãåé¡ã¯ã¯ããã«å°ãªãã£ãã§ãããïŒã
ãã ããçŽç²ã«åœ¢åŒçã«ã¯2ã€ã®æ¹æ³ã§å€æŽãè¡ãããšãã§ããããããã®ãããªã¢ã¯ã»ã¹ã¯ãããŸããã§ããã
- 1C-Bitrix管çããã«ãä»ããŠãªã¢ãŒãã§
- 顧客ã®é åã§çŽæ¥ïŒå³å¯ãªç£ç£ã®äžã§ïŒ
ãã®ãããäžéšã®ã¿ã¹ã¯ãããŒã«ãªãŒããŒããããšãã«ãéçºè ãããŒãžã£ãŒããå®æçã«é»è©±ãåããŸããã
ã¢ã¬ã¯ã»ã€ãããã§ã¿ã¹ã¯XXXãããŒã«ãããã init.phpãä¿åããŠãã ãã
åœç¶ã®ããšãªããããããªãã¯æ±ºããŠç¥ããªãããæã æ¥ãŠãæå®ããããã¡ã€ã«ã埩å ããèŠæ±ã¯ãã§ãŒã³å šäœã«è¡ãããã®æç¹ã§ãµã€ãã¯å©çšã§ããŸããã§ãã...
åæ§ã«ãã»ã³ãã©ã«ãªããžããªïŒGitLabïŒãžã®ã¢ã¯ã»ã¹ã¯ãäœæãããæç¹ã§ã¯ãã客æ§ã®é åã«å®å šã«å¶éãããŠããŸããã ããã«ãããGITã®å®è£ ã«éèŠãªå¶éãçããŸãã
- éçºè ã¯é¡§å®¢ã®ãµãŒããŒãããªããžããªãååŸã§ããŸããïŒæã§.gitãã©ã«ããŒãã³ããŒããå Žåã®ã¿ïŒ
- éçºè ã¯GITã䜿çšããŠæŽæ°ãããŒã«ã§ããŸããã ããŒã«ããã¯ã¯æåã§è¡ãããŸãã
ã客æ§ãšéçºè ã®ããŒãžã§ã³ç®¡çã·ã¹ãã ã¯ãå®è³ªçã«çžäºã«åé¢ãããŠããŸãïŒ1C-Bitrix管çããã«ãä»ããæåã¢ãŒãã§ã®ã¿éä¿¡ãè¡ãããŸãïŒã
ãŸãã管çã¢ã¯ã»ã¹ïŒ1C-Bitrixã®1ã°ã«ãŒãïŒã«ã¯æéãå¶éãããŠããŸãã ããŒã¿ããŒã¹ã¬ãã«ïŒOracleïŒã§ç§ãšéçºè ã«9.00ã§æš©å©ãé åžãã17.50ã¢ã¹ã¯ã¯æéã§éžæããç¹å¥ãªã¹ã¯ãªããããããŸãã
ããã¯æªå€¢ã§ãã ã³ã¡ã³ãã§ãããæãåºããªãã§ãã ããã =ïŒ
ããŒã2-ããŒã«
2.1ãµãŒããŒ
Prodã¯ã¡ã€ã³ã®æŠéãµãŒããŒã§ãã
Battle Serverã«å ããŠãHeadsã®æ瀺ã§2ã€ã®ã³ããŒãäœæãããŸããã
- ãã¹ã -ãªã¯ãšã¹ãã«å¿ããŠåäœæã§ããŸãïŒä»ã®éšéã®äººãé¢äžããå¿ èŠããããããããã»ã¹ã¯æéãããããŸããæšå®å®è£ æéã¯1æ¥ã§ãïŒã ãµãŒããŒã«ã¯ã顧客ãšéçºè ã®ãããã¯ãŒã¯ããã®ã¿ã¢ã¯ã»ã¹ã§ããŸãã
- Prelive - 1æ¥ã« 1åïŒå€éïŒèªåçã«åäœæãããè¡ããããã¹ãŠã®å€æŽãäžæžãããäœææã«Battle Serverã®çŸåšã®ããŒãžã§ã³ãååŸããŸãã ãµãŒããŒã«ã¯ã顧客ãšéçºè ã®ãããã¯ãŒã¯ããã®ã¿ã¢ã¯ã»ã¹ã§ããŸãã
ç§ãšéçºè ã®äž¡æ¹ã«ãšã£ãŠã3ã€ãã¹ãŠã®ãµãŒããŒãžã®ã¢ã¯ã»ã¹ã¯httpsçµç±ã®ã¿ã§ã ïŒãã®å Žåã蚌ææžã¯èªåçã«1C-Bitrixã«ãã°ã€ã³ããŸãïŒã
SSH / FTPã¢ã¯ã»ã¹ã¯ãç§ã®çŽå±ã®äžåžãšã®ã¿ã§ãã =ïŒ
GitLab - GitLabããããã€ããããã®å¥åã®ãµãŒããŒã§ãäžå€®ãªããžããªãšããŠäœ¿çšãããŸãã ãµãŒããŒã¯ãçŽæ¥IPãä»ããŠã客æ§ã®ãããã¯ãŒã¯ããã®ã¿ã¢ã¯ã»ã¹ã§ããŸãïŒãã®èšäºã®è©³çŽ°ã«ã€ããŠã¯172. ***ã***ã61ãšä»®å®ããŸãããå®éã«ã¯ãããšãã°github.comãªã©ã®ä»»æã®IPãŸãã¯ãã¡ã€ã³ã䜿çšã§ããŸãïŒ ã
3ã€ã®WebãµãŒããŒïŒProd / Test / PreliveïŒã¯ãã¹ãŠGitLabã«sshã¢ã¯ã»ã¹ã§ããŸãã
httpçµç±ã§ã®ã¿GitLabã«ã¢ã¯ã»ã¹ã§ããŸãïŒå®éããªããžããªã®äœæ/åé€ãšãæã®ããçŸããç»åããèŠãããšãã§ããŸããïŒã
DEV-éçºè ã®ãµãŒããŒãšã¯ãŒã¯ã¹ããŒã·ã§ã³ã®ã»ã°ã¡ã³ãã®æå®ã èšäºã¯èæ ®ãããŸããã ã»ã°ã¡ã³ãããã®ãã¹ãŠã®å€æŽã¯ãç§ãŸãã¯éçºè ã1C-Bitrix管çããã«ãéããŠæåã§ã客æ§ã®ãµãŒããŒã«è»¢éããŸãã
æåã®ã¿ã¹ã¯ããŒã«ã¢ããã¹ããŒã ã§ã¯ããã§ãŒã³å šäœãæž¡ãå¿ èŠããããŸããã
DEVâTESTâPRELIVEâPROD
ã¿ã¹ã¯ãæŠéã«å ¥ãåã«ãæçµãã§ãã¯ã¯ãæãé¢é£æ§ã®é«ãããã¬ãªã¥ãŒãã§è¡ãããããšã«ãªã£ãŠããã ã¹ããŒã ã¯åœç¶éåžžã«éå±ã§ã»ãšãã©åœ¹ã«ç«ããªãããšãå€æããŸããã
çŸæç¹ã§ã¯ãã¿ã¹ã¯ã®ãã§ãã¯ã«2å°ã®ãµãŒããŒã䜿çšããããšã«è³æããŸããïŒãã¹ãã§ã¯é·ããã§ãã¯ãå¿ èŠã§ãPreliveã§ã¯ããã«ãã§ãã¯ãããŸãïŒã
DEVâTEST / PRELIVEâPROD
ã³ãŒãã¯ãã»ã³ãã©ã«ãªããžããªïŒGitLabïŒãä»ããŠã®ã¿é¡§å®¢ã»ã°ã¡ã³ãã®1ã€ã®ãµãŒããŒããå¥ã®ãµãŒããŒã«è»¢éããããããããŒã«ã¢ããã¹ããŒã ã¯æ¬¡ã®ããã«è¡šãããšãã§ããŸãã
2.1.1ãµãŒããŒäžã®GIT
ã·ã¹ãã 管çè ã«ãã£ãŠã€ã³ã¹ããŒã«ãããŸãã æ®å¿µãªããããã®ãããã¯ã«é¢ããŠæçšãªããšã¯äœãèšããŸããïŒè³ªåã¯ç§ã®èœåãè¶ ããŠããŸãïŒã
SSHããŒã®çæ以å€ã®ç¹å¥ãªæäœã¯ãããŸããïŒãµãŒããŒãšäžå€®ãªããžããªïŒGitLabïŒéã®éä¿¡çšïŒã
æé ã¯ç°¡åã«ã°ãŒã°ã«ã§æ€çŽ¢ã§ããŸãããŸãã¯ãGitLabãã«ãã»ã¯ã·ã§ã³ã«èšèŒãããŠããŸãã
2.1.2ãµãŒããŒäžã®Webã³ã³ãœãŒã«ïŒgit_console.phpïŒ
åè¿°ã®ããã«ãç§ãéçºè ããµãŒããŒã«SSHã¢ã¯ã»ã¹ã§ããªããããGITã³ãã³ããéä¿¡ããã«ã¯ããã©ãŠã¶ãŒã«ã³ã³ãœãŒã«ãå®è£ ããå¥ã®ã¹ã¯ãªãããã€ã³ã¹ããŒã«ããå¿ èŠããããŸããã
圌ã«æè¬ããŸãElfet ïŒ Habré ã®ã³ã³ãœãŒã«ã«é¢ããèšäº ïŒ
éåžžã«å°ããªå€æŽãå ããŸããã
- 圌ãã¯ããµãŒããŒèªäœã®éçºè
ãã¢ã¯ã»ã¹ã§ããªããã£ã¬ã¯ããªã«ã³ã³ãœãŒã«èªäœãé
眮ããŸãïŒãã®ãããéçºè
ãç§
ããæœåšçãªæ»æèãã³ã³ãœãŒã«ã®ã³ãŒããå€æŽã§ããŸããïŒã åæã«ãã«ãŒãã«ã«ã管çè ã䜿çšã§ããgit_console.phpãã¡ã€ã«ãé 眮ããŸããããã«ãããè žããã®ã¹ã¯ãªãããåçŽã«æ¥ç¶ãããŸãã - ã¹ã¯ãªããèšå®ã§ã¯ãã³ãã³ãã®å®è¡ã«å¶éãèšããããŸããïŒgitãpwdãcdã®ã¿ïŒã
- ã³ã³ãœãŒã«ã®èæ¯è²ãå€æŽããŸããïŒãã¹ã-ç·ããã¬ã©ã€ã-ã°ã¬ãŒã補å-é»ïŒã ããã¯ã2ã3人ãåãã§ã¿ã¹ã¯ãnot thereããéå§ããåŸã«è¡ãããŸãã =ïŒ
- 圌ãã¯ã蚌ææžã«ããã¢ã¯ã»ã¹å¶éãè¿œå ããŸããïŒã€ãŸãããã¹ãŠã®ç®¡çè ãã³ã³ãœãŒã«ã«ã¢ã¯ã»ã¹ã§ããããã§ã¯ãããŸããããã¹ãæéäžãç§ã¯ã¢ã¯ã»ã¹ã®ã¿ãæã£ãŠããŸããã
ãã®ãœãªã¥ãŒã·ã§ã³ã®éèŠãªå©ç¹ã¯ ãã³ã³ãœãŒã«ã®èªåŸæ§ã§ãïŒ ã€ãŸã éçºè ãinit.phpãå€æŽã
2.1.3ãªããžããªæ§é
æ®å¿µãªãããã·ã¹ãã å ã®ãã¹ãŠã®ãµã€ããããŒãžã§ã³ç®¡çäžã«ããããã§ã¯ãªããããŒã«ãã£ã³ã°ã®ãããããã®ã¿ã§ãã ããã«ãããç¹å®ã®äžäŸ¿ãšåé¡ãçºçããŸãïŒããšãã°ãéçºè ãåšã®1人ã«å¯ŸããŠã«ãŒãã«ãä¿®æ£ããå Žåãªã©ïŒããããã¯åºæ¬çã«ãããã®ãµã€ãã®ææè èªèº«ããå°äžãã§æ±ããåé¡ã§ãã ããããå°æ¥çã«ã¯ããªãŒããŒãããã«ãããããããGITã«ãè¿œå ãããã§ãããã
ãªããžããªã®å®éã®æ§é ã®ã¹ããŒã ïŒååãšã¢ãã¬ã¹ã¯éšåçã«æ¶å»ãããŸãïŒïŒ
æ§é ã«èŠãããããã«ïŒ
- ã«ãŒãã«ã¯å¥ã®ãã£ã¬ã¯ããªã«ãããŸã
- äžéšã®ãµã€ãã®ãã©ã«ãã¯ããæå³ã«åŸã£ãŠãåå¥ã®ãã£ã¬ã¯ããªã«ã°ã«ãŒãåãããŸã
- äžéšã®ãµã€ãã«ã¯ç¬èªã®å人ãã£ã¬ã¯ããª/ããŒã«ã«/
- äžéšã®ãµã€ãã«ã¯ã°ã«ãŒããã£ã¬ã¯ããª/ããŒã«ã«/
- äžéšã®ãªããžããªã«ã¯ãµãã¢ãžã¥ãŒã«ïŒãªããžããªå ã®ãªããžããªïŒããããŸã-ãããã¯éåžžãå®äºåŸã«ãã£ãã«æŽæ°ãããªãç¹å¥ãªãããžã§ã¯ãã§ãããããžãã¯ãšã³ã³ãã³ãã®äž¡æ¹ã«å€§ããªéãããããŸãïŒå€ãã®å Žåã.gitignoreã®å€§å¹ ã«ç°ãªãã«ãŒã«ãé©çšãããŸãïŒã ãããã£ãŠããããã¯ããnotãäœæããªãããã«ãå¥ã ã«åãåºãããŸãã
300 MBãè¶ ãããªããžããªã¯ãããŸããïŒææªã®æ¥ã§ãïŒã
ããã¯ãç¹å®ã®çš®é¡ã®ã³ã³ãã³ãïŒPDFãaviãjpgãªã©ã®ãã€ããªãã¡ã€ã«ïŒã.gitignoreã®å¿ èŠæ§ãšããã«å¯Ÿå¿ããçŠæ¢ãªãã«ãã®ãããªãªããžããªã«å«ããªããšããæ¿æ²»ç決å®ã«ãã£ãŠéæãããŸããã
2.1.4ããã¥ã¡ã³ã
ãã®èšäºã®ãã¹ãŠã®åçïŒãã¡ããKdPVãé€ãïŒã¯ãã客æ§ãç§ãããã³éçºè ãå©çšã§ããç¹å¥ãªãªãœãŒã¹ã«ããããã¥ã¡ã³ãããååŸãããŸãã
æåïŒãã¹ãéçšæéïŒãããã¥ã¡ã³ãã®ãã©ããããã·ã³ã«ä¿åãããŠããŸããããä»ã§ã¯ããŒã å šå¡ãã¢ã¯ã»ã¹ã§ããããã«ãã¹ãŠã®ããã¥ã¡ã³ããå ¬éãããŠããŸãã
ããŒã3-æé
ã ãããç§ãã¡ã¯æãèå³æ·±ãããšã«å°éããŸããã
ããŒã1ã§æžããããã¹ãŠãçŽç²ã«ã³ã³ããã¹ããäœæããããã®ãã®ã§ïŒçµéšè±å¯ãªãŠãŒã¶ãŒã®å¿ãã€ããããïŒãããŒã2ã§ããã«è³ªåãæ·±ããããšã§ãïŒç§ãã¡ã®å€§ããªãããžã§ã¯ãã®ããã«ãå°å¹³ç·ã«æ¥éã«è¿ã¥ããŠãã人ãã¡ã®ããã«ïŒã€ãã³ãïŒã次ã«ããŒã3-ãããã¯ãç§ãå人çã«éå§ããã®ã«ååã§ã¯ãªãã£ãæ瀺ã®åºæ¬çãªäŸã«ãããŸããã
GITã䜿çšããªãã£ãããéå§ããã人ïŒå ±æãã¹ãã£ã³ã°ã«å°ããªãªã³ã©ã€ã³ã¹ãã¢ãããå Žåã§ãïŒãGITã«æè¡ãµããŒããäŸé Œãã以äžã§èª¬æããã¹ã¯ãªããã䜿çšããŠGitHubãŸãã¯BitBucketãäžå€®ãªããžããªãšããŠäœ¿çšã§ããããšãé¡ã£ãŠããŸãä»äºãå§ããŸãããã ãããŠãã®éçšã§ã圌ãã¯ãã§ã«Pro Gitã®ããã¥ã¡ã³ããç 究ããäœæ¥æ¹æ³ãé©åãããããæè»ã§å®ç§ãªãã®ã«ããããšãã§ããŸãã
äžèšã®ãã¹ãŠã1æ¥ä»¥äžã§çãŸããŸããã ãããããããããããçŸãããšãã§ãããçåã¯ãã®å¯ããã¹ãŠäœ¿çšããæ¹æ³ã«çãŸããŸããã
以äžã®ãã¹ãŠã®æ瀺ã¯
3.1ãªããžããªã®åæå
3.1.1 Prodã§ã®ãªããžããªã®åæåïŒããã³Prod / Preliveã®åæ§ç¯ïŒ
æãç°¡åã§æ£ããæ¹æ³ã
ããã¯ãããã«çšã®ãªããžããªãäœæããŠããããµã€ãå šäœïŒãªããžããªãå«ãïŒãããã«ããTest and Reliveã«ã³ããŒããããšã«ãããŸãã
ããšãã°ããã£ã¬ã¯ããª/ local /ïŒè€æ°ã®ãµã€ãã«å ±éïŒ
Webã³ã³ãœãŒã«ïŒPRODäžïŒ-httpsïŒ//********.ruïŒ1119 / bitrix / admin / git_console.php
cd /u-app/bitrix/Apache/htdocs/site/******/local/
ïŒä»ã®å Žæã®Press Serviceãµã€ãã®ãã£ã¬ã¯ããª/ local / commonã«ç§»åããŸãïŒ
pwd
çŸåšã®ãã£ã¬ã¯ããªã確èªããŸãïŒå Žæã確èªããŸãïŒ
git status
-GITã¹ããŒã¿ã¹ã確èªããŸãïŒãªããžããªã衚瀺ãããªãã¯ãã§ãïŒ
.gitignoreãé 眮ããŸãïŒä»é²ã®ãµã³ãã«ãåç §ïŒ
git init
git config user.name "Zadoiny Alexey"
git config user.email "aleksey.zadoiny@******.ru"
git add -A .
git commit -m 'initital'
ã¬ããžããªãGitLabã§äœæãããŠããªãå ŽåïŒlocal-******ãšããååã§ïŒäœæããŸã
git remote add origin git@172.***.***.61:Alexey.Zadoiny/local-******.git
git push -u origin master
/ local /ã®ãªããžããªã®Gitignoreã®äŸ
/.htaccess
* .log
* .tar
* .gz
* .sql
ïŒ*ãflv
ïŒ*ãmp4
ïŒ*ãpdf
ïŒ*ãavi
ïŒ*ãpng
ïŒ*ãjpg
ïŒ*ãgif
ïŒ*ãbmp
* .rar
* .zip
* .7z
* .webm
ïŒ*ãmp3
ïŒ*ãwav
ïŒ*ãswf
/log.txt
* ._ãã°
/ mail_log /
/_log.txt
*ãµã€ãããã_ *ãxml
.htaccess
urlrewrite.php
* .log
* .tar
* .gz
* .sql
ïŒ*ãflv
ïŒ*ãmp4
ïŒ*ãpdf
ïŒ*ãavi
ïŒ*ãpng
ïŒ*ãjpg
ïŒ*ãgif
ïŒ*ãbmp
* .rar
* .zip
* .7z
* .webm
ïŒ*ãmp3
ïŒ*ãwav
ïŒ*ãswf
/log.txt
* ._ãã°
/ mail_log /
/_log.txt
*ãµã€ãããã_ *ãxml
.htaccess
urlrewrite.php
ãªããžããªãäœæãããã.htaccessãã¡ã€ã«ã
次ã®ã³ã³ãã³ãïŒ
ãã¹ãŠãæåŠ
3.1.2補åäžã®ãªããžããªã®åæåïŒããã³ç©ºã®TEST / PRELIVEãžã®ç§»æ€ïŒ
ãªããããå¿ èŠã§ããïŒ ããšãã°ããã¹ããµãŒããŒãšããã«ãµãŒããŒã¯æ¢ã«äœæããã³æ§æãããŠãããè¿ãå°æ¥ãããã®éã§åæãè¡ãããšã¯ã§ããŸããã
åæã®å¯Ÿè±¡ã§ã¯ãªããå¿ èŠãªãã¡ã€ã«ã®æ°ãå°ãªãããšãéèŠã§ãïŒã€ãŸããããŒã¿ããŒã¹æ¥ç¶ãã¡ã€ã«ã®ã¿ãåæãããŠããªãããããã®æ¹æ³ã¯ã«ãŒãã«ã«é©ããŠããŸãããå€ãã®ã³ã³ãã³ããããå Žåã¯å ¬ééšåã«ã¯é©ããŠããŸããïŒãªããžããªããé€å€ããããã€ããªãã¡ã€ã«ããã以å€ã®å Žåã¯3.1.3é ãåç §
ããšãã°ããã¹ãŠã®ãµã€ãã«å
±éã®ã«ãŒãã«/ bitrix /
æŠãã«ã€ããŠïŒ
äŸ.gitignoreïŒ
ãã¹ã/åçŸïŒ
ãªããžããªãäœæãããã.htaccessãã¡ã€ã«ã
次ã®ã³ã³ãã³ãïŒ
Webã³ã³ãœãŒã«ïŒPRODäžïŒ-httpsïŒ//*******.ruïŒ1119 / bitrix / admin / git_console.php
cd /u-app/bitrix/Apache/htdocs/bitrix/
ïŒä»ã®å Žæãããã¹ãŠã®ãµã€ãã«å ±éã®ãã£ã¬ã¯ããª/ bitrix /ã«ç§»åããŸãïŒ
pwd
çŸåšã®ãã£ã¬ã¯ããªã確èªããŸãïŒå Žæã確èªããŸãïŒ
git status
-GITã¹ããŒã¿ã¹ã確èªããŸãïŒãªããžããªã衚瀺ãããªãã¯ãã§ãïŒ
.gitignoreãé 眮ããŸãïŒä»é²ã®ãµã³ãã«ãåç §ïŒ
git init
git config user.name "Zadoiny Alexey"
git config user.email "aleksey.zadoiny@********.com"
git add -A .
git commit -m 'initital'
ãªããžããªãGitLabã§äœæãããŠããªãå ŽåïŒbitrixãšããååã§ïŒäœæããŸã
git remote add origin git@172.***.***.61:Alexey.Zadoiny/bitrix.git
git push -u origin master
äŸ.gitignoreïŒ
* .log
* .tar
* .gz
* .sql
* .flv
* .mp4
* .avi
* .rar
* .zip
* .7z
* .webm
* .mp3
* .wav
* .swf
ãã£ãã·ã¥
stack_cache
managed_cache
tmp
php_interface / dbconn.php
.settings.php
ãã¹ã/åçŸïŒ
ãã¡ã€ã«/bitrix/.settings.phpããã³/bitrix/php_interface/dbconn.phpïŒGITã䜿çšããŠåæãããªããã®ä»ã®éèŠãªãã¡ã€ã«ïŒã®ããã¯ã¢ããã³ããŒãäœæããŸãã
/ bitrix /ãã©ã«ããŒã®å 容ãåé€ããŸã
Webã³ã³ãœãŒã«ãæ©èœããŠããŸããã éåžžã®ã³ã³ãœãŒã«ã«è¡ããŸãããïŒ
cd /u-app/bitrix/Apache/htdocs/bitrix/
ïŒã©ãããã§ã/ bitrix /ãã£ã¬ã¯ããªã«ç§»åããŸãïŒ
pwd
çŸåšã®ãã£ã¬ã¯ããªã確èªããŸãïŒå Žæã確èªããŸãïŒ
git init
git remote add origin git@172.***.***.61:Alexey.Zadoiny/bitrix.git
git pull origin master
/bitrix/.settings.phpããã³/bitrix/php_interface/dbconn.phpãã¡ã€ã«ã®ããã¯ã¢ããã³ããŒã埩å ããŸã
ãªããžããªãäœæãããã.htaccessãã¡ã€ã«ã
次ã®ã³ã³ãã³ãïŒ
ãã¹ãŠãæåŠ
3.1.3 Prodäžã®ãªããžããªã®åæåïŒããã³ç©ºã§ãªãTEST / PRELIVEãžã®ç§»æ€ïŒ
ãªããããå¿ èŠã§ããïŒ ããšãã°ããã¹ãããã³ããã«ãµãŒããŒã¯æ¢ã«äœæããã³æ§æãããŠãããè¿ãå°æ¥ãããã®éã®åæã¯äžå¯èœã§ããããã£ã¬ã¯ããªã«ã¯ããŒãžã§ã³ç®¡çã·ã¹ãã ã䜿çšããŠåæãããªã倧éã®ã³ã³ãã³ããå«ãŸããŸãïŒããšãã°ããã€ããªã³ã³ãã³ããã¡ã€ã«ïŒpdfãjpgãswfãaviããªã©ïŒ
ããããã®ãµã€ãã®ã¢ãã€ã«ããŒãžã§ã³ã®äŸ
æŠãã«ã€ããŠïŒ
æåŸã®ã³ãã³ãïŒ
ïŒãå®è¡ããŠãã³ãããã®ããã·ã¥ãèŠã€ããŸãïŒ
ãã¹ã/ãªã¬ãŒã§ãGITã«ãã£ãŠå¶åŸ¡ãããäžéšã®ãã¡ã€ã«ãç°ãªãå Žåã«å¿ èŠã«ãªããŸãïŒãã®åŸããã®ã³ãããã«ããŒã«ããã¯ããŸããæŠéã§ã¯ãçŸåšã®ãµãŒããŒã¹ããŒã¿ã¹ããããå®éã«åæããŸãïŒ
äŸ.gitignoreïŒ
ããã§ãã¢ãã€ã«ããŒãžã§ã³ãã£ã¬ã¯ããªã®æš¹ç®ã«è¡šç€ºãããããã«ãã.gitãã©ã«ããŒå šäœãã³ããŒãïŒå éšã«å°ããªãã¡ã€ã«ããããããããããæåã«ã¢ãŒã«ã€ãããæ¹ãããïŒãTest / Reliveã«è»¢éããŸãã
ããã§ããªããžããªã®ç¶æ ã解åããŠç¢ºèªããŸãã
ãªããžããªãäœæãããã.htaccessãã¡ã€ã«ã
次ã®ã³ã³ãã³ãïŒ
Webã³ã³ãœãŒã«ïŒPRODäžïŒ-httpsïŒ//*******.ruïŒ1119 / bitrix / admin / git_console.php
cd /u-app/bitrix/Apache/htdocs/site/******/m-ru/
ïŒã©ãããã§ãã¢ãã€ã«RUãã£ã¬ã¯ããªã«ç§»åïŒ
pwd
çŸåšã®ãã£ã¬ã¯ããªã確èªããŸãïŒå Žæã確èªããŸãïŒ
git status
-GITã¹ããŒã¿ã¹ã確èªããŸãïŒãªããžããªã衚瀺ãããªãã¯ãã§ãïŒ
.gitignoreãé 眮ããŸãïŒä»é²ã®ãµã³ãã«ãåç §ïŒ
git init
git config user.name "Zadoiny Alexey"
git config user.email "aleksey.zadoiny@******.ru"
git add -A .
git commit -m 'MOBILE RU 2014 initital'
ã¬ããžããªãGitLabã§äœæãããªãã£ãå ŽåïŒm-ru2014ãšããååã§ïŒäœæããŸã
git remote add origin git@172.***.***.61:Alexey.Zadoiny/m-ru2014.git
git push -u origin master
git log
æåŸã®ã³ãã³ãïŒ
git log
ïŒãå®è¡ããŠãã³ãããã®ããã·ã¥ãèŠã€ããŸãïŒ
ãã¹ã/ãªã¬ãŒã§ãGITã«ãã£ãŠå¶åŸ¡ãããäžéšã®ãã¡ã€ã«ãç°ãªãå Žåã«å¿ èŠã«ãªããŸãïŒãã®åŸããã®ã³ãããã«ããŒã«ããã¯ããŸããæŠéã§ã¯ãçŸåšã®ãµãŒããŒã¹ããŒã¿ã¹ããããå®éã«åæããŸãïŒ
äŸ.gitignoreïŒ
ãããªãã¯ã¹
ããŒã«ã«
ã¢ããããŒããã
docs
/.htaccess
* .log
* .tar
* .gz
* .sql
* .flv
* .mp4
* .avi
* .png
* .jpg
* .gif
* .bmp
* .rar
* .zip
* .7z
* .webm
* .mp3
* .wav
* .swf
/log.txt
* ._ãã°
/ mail_log /
/_log.txt
*ãµã€ãããã_ *ãxml
.htaccess
urlrewrite.php
ããã§ãã¢ãã€ã«ããŒãžã§ã³ãã£ã¬ã¯ããªã®æš¹ç®ã«è¡šç€ºãããããã«ãã.gitãã©ã«ããŒå šäœãã³ããŒãïŒå éšã«å°ããªãã¡ã€ã«ããããããããããæåã«ã¢ãŒã«ã€ãããæ¹ãããïŒãTest / Reliveã«è»¢éããŸãã
ããã§ããªããžããªã®ç¶æ ã解åããŠç¢ºèªããŸãã
Webã³ã³ãœãŒã«ïŒTEST / PRELIVEïŒ-httpsïŒ//*******.ruïŒ1119 / bitrix / admin / git_console.php
cd /u-app/bitrix/Apache/htdocs/site/******/m-ru/
ïŒã©ãããã§ãã¢ãã€ã«RUãã£ã¬ã¯ããªã«ç§»åïŒ
pwd
çŸåšã®ãã£ã¬ã¯ããªã確èªããŸãïŒå Žæã確èªããŸãïŒ
git status
-GITã¹ããŒã¿ã¹ã確èªããŸãïŒå€æŽã¯è¡šç€ºãããŸããïŒ
ãŸã å€æŽãããå ŽåïŒ
git reset --hard #HASH#
whereïŒHASHïŒ-ããã«ã§ååŸããã³ãããããã·ã¥ã®æåã®4ã5æåïŒãã£ãšå€ãå ŽåããããŸãããéåžžã¯å°æ°ïŒ
ãªããžããªãäœæãããã.htaccessãã¡ã€ã«ã
次ã®ã³ã³ãã³ãïŒ
ãã¹ãŠãæåŠ
3.1.4 Prodã®ãµãã¢ãžã¥ãŒã«ãªããžããªã®åæåïŒããã³ç©ºã§ãªãTEST / PRELIVEãžã®ç§»æ€ïŒ
ãµãã¢ãžã¥ãŒã«ã®é£ããã¯ãæ¢åã®ãšã³ã·ã¹ãã ã«å€æŽãå ããå¿ èŠããããšããäºå®ã«ãããŸãïŒã€ãŸãããªããžããªãæ¢ã«ååšããçªç¶ãã ãããããã芪æãªãããã§ã³ã¹ããããVasyaã¯ãã§ã³ã¹ã®åŸãã«äœãã§ããŸãïŒã ãïŒ
ç¹ã«ãããã€ãã®æ©èœãæåã«ãããã€ããŠã³ãããããå Žåãäœæãããã¹ãŠã®ãã¡ã€ã«/ãã£ã¬ã¯ããªãåé€ããŠããã®å Žæã«ãµãã¢ãžã¥ãŒã«ãäœæããå¿ èŠããããŸãïŒ ãã®ãããã¯ã«é¢ããTOSTERã®è³ªå ïŒã
æ¢åã®ãªããžããªå
ã«ãµãã¢ãžã¥ãŒã«d ****ãäœæãã
ã»ã³ãã©ã«ãªããžããªïŒGitLabïŒã«æ°ãã空ã®ãªããžããªïŒ****-project-d ****ãšããååïŒãäœæããŸã
æŠéã確èªããååšããå Žåã¯ããã©ã«ããŒ/ u-app / bitrix / Apache / htdocs / site / ********** / ru / ***** / ****** / d *ãåé€ããŸã*** /
Webã³ã³ãœãŒã«ã«ã¢ã¯ã»ã¹ããŸã-httpsïŒ//********.ruïŒ1119 / bitrix / admin / git_console.php
git statusãå®è¡ãããšã次ã®ããã«è¡šç€ºãããŸãïŒ
æŠéã確èªããååšããå Žåã¯ããã©ã«ããŒ/ u-app / bitrix / Apache / htdocs / site / ********** / ru / ***** / ****** / d *ãåé€ããŸã*** /
Webã³ã³ãœãŒã«ã«ã¢ã¯ã»ã¹ããŸã-httpsïŒ//********.ruïŒ1119 / bitrix / admin / git_console.php
cd /u-app/bitrix/Apache/htdocs/site/*********/ru/
ïŒä»ã®å Žæãããªããžããªãã£ã¬ã¯ããªã«ç§»åïŒ
pwd
çŸåšã®ãã£ã¬ã¯ããªã確èªããŸãïŒå Žæã確èªããŸãïŒ
git status
-GITã¹ããŒã¿ã¹ã確èªããŸãïŒã«ãŒããªããžããªã®ååšã衚瀺ããå¿ èŠããããŸãïŒ
git submodule add git@172.***.251.61:Alexey.Zadoiny/****-project-d****.git *****/****/d****/
git statusãå®è¡ãããšã次ã®ããã«è¡šç€ºãããŸãïŒ
git add -A .
git commit -m 'INIT SUBmodule D****
- ããã§ããµãã¢ãžã¥ãŒã«ãç¬ç«ãããªããžããªãšããŠäœ¿çšã§ããŸãïŒãã®ç¶æ ãã³ãããããGitLabãä»ããŠProd / Test / PreliveãµãŒããŒãªã©ã§å€æŽããŸãïŒ
- Test / Preliveã®ã¡ã€ã³ãªããžããªã®ç¶æ ãæŽæ°ãããšãæ°ãããµãã¢ãžã¥ãŒã«ãèªåçã«ã€ã³ã¹ããŒã«ãããŸãïŒ
3.2ããŒãªã³ã°ã¿ã¹ã¯ã®æŽæ°
æåã«ããã®ããã»ã¹ã¯ã¹ããŒã ã«åŸã£ãŠè¡ãããããšã«ãªã£ãŠããããšãæãåºãããŠãã ããã
DEVâTESTâPRELIVEâPROD
ãã®ãããæŽæ°ã¹ããŒã ã«ã¯11ã®ã¡ã€ã³ã¹ããããš4ã€ã®è¿œå ã¹ããããå«ãŸããããã€ãã®ãã©ã³ãããããŸããã
å°çã®ã¹ããŒã³
ãã®æªå€¢ã®æ°Žå¹³ããŒãžã§ã³ã¯ãŸã è·å Žã«æ®ã£ãŠããŸãïŒ ããããåé€ããå¿ èŠããããŸãããç¹å¥ãªãããžã§ã¯ããéå§ããããã«æ¥ãæ°ããè«è² æ¥è ã®ä»£è¡šè ãªã©ãåããŠäžç·ã«åããŠãã人ã ã®æãããã®ããéŠæ¯ããèŠãã®ã¯æ¬åœã«ã°ãããŠããŸã ïŒ
ãã®æªå€¢ã®æ°Žå¹³ããŒãžã§ã³ã¯ãŸã è·å Žã«æ®ã£ãŠããŸãïŒ ããããåé€ããå¿ èŠããããŸãããç¹å¥ãªãããžã§ã¯ããéå§ããããã«æ¥ãæ°ããè«è² æ¥è ã®ä»£è¡šè ãªã©ãåããŠäžç·ã«åããŠãã人ã ã®æãããã®ããéŠæ¯ããèŠãã®ã¯æ¬åœã«ã°ãããŠããŸã ïŒ
ã¹ããŒã ã¯ã
DEVâTEST / PRELIVEâPROD
ã泚æ å®éããã¹ãŠã®æ瀺ã«ã¯ã1ã€ã®äœæïŒcdïŒã§ã¯ãªãããã¹ãŠã®äœæã®ãªã¹ããèšèŒããããã¬ãŒãããããŸãã ã€ãŸã ã¢ã¯ã·ã§ã³ãå®è¡ãããšãã«ããããã1ã€ãéžæããŠå šäœãã³ããŒã§ããŸãïŒç¹å®ã®ã¬ãã®ãã£ã¬ã¯ããªãèŠããããªãã§ãã ããïŒã
ã©ã®ããã«èŠãããã®äŸ
ç°¡æœã«ãããããç°¡æœã«ããããã«ã©ãã§ã1ã€ã®ã¢ãã¬ã¹ã䜿çšããŸãïŒã»ãšãã©ã®æ°ããGITãŠãŒã¶ãŒã¯ããã«å€ãã®ãªããžããªãæäœããå¿ èŠã¯ãªããšèããŠããããã§ãïŒã
åã¹ãããã¯ç¬ç«ããèªåŸçãªãã®ãšèŠãªãããããããªããžããªãã£ã¬ã¯ããªãžã®ç§»è¡ããå§ãŸããŸãã ããã»ã¹ãäžæããªãå Žåãåœä»€ã®ãã®ã»ã¯ã·ã§ã³ã¯åçŽã«ç¡èŠã§ããŸãã
3.2.0ã¿ã¹ã¯æŽæ°ã®ããŒã«ããã¯-ã¹ããã0
cd /u-app/bitrix/Apache/htdocs/bitrix/
-ãããžã§ã¯ããã©ã«ããŒã«ç§»åããŸãã
pwd
èªåèªèº«ã確èªãã
git status
status-ã³ããããããŠããªãå€æŽã¯ãããŸããã
git log
log-æåŸã®ã³ãããã¯ãäžå€®ã®GitLabãªããžããªã®Masterãã©ã³ãã®æåŸã®ã³ãããã«å¯Ÿå¿ããå¿ èŠããããŸã
git log
æåŸã®ã³ãããã衚瀺ãããªãã£ãå Žåã¯ãã¹ããã3.4ã«é²ã¿ãçŸåšã®ç¶æ ãããã«ãããã¹ã/åçŸãŸã§ããŒãªã³ã°ããåŸãæé ãæåããéå§ããŸãã
Nakat-äœããã®æ段ïŒFTPã管çããã«ïŒã§æ©èœããã¿ã¹ã¯ããã¹ã/åçŸããŸãã
3.2.1ã¿ã¹ã¯æŽæ°ããã°ã©ã ã®ããŒã«ã¢ãã-ã¹ããã1
cd /u-app/bitrix/Apache/htdocs/bitrix/
git add -A .
git commit -m 'TIKET ######'
git push origin master:TIKET_######
å€æŽãã³ãããããéçºãã©ã³ãïŒãã¹ã/ãªã©ã€ããµãŒããŒã®ãŠã£ã¶ãŒãïŒããäžå€®ãªããžããªã®ã¿ã¹ã¯ãã©ã³ãã«éä¿¡ããŸãã
代æ¿ãªãã·ã§ã³
git statusãGITã«å¯ŸããŠè¡ãããã¿ã¹ã¯ã®ãã¡ã€ã«ã ãã§ãªãå€æŽã瀺ãå Žåã以äžã䜿çšããããšããå§ãããŸãã
ã©ã¡ãã
ããŒãžã§ã³ç®¡çã·ã¹ãã ã«è¿œå ããå¿ èŠããããã¹ãŠã®ãã£ã¬ã¯ããªãšãã¡ã€ã«ã ãã¹ã®ä»£ããã®ãã€ã³ãã¯ããã¹ãŠã®å€æŽãããïŒããã³äœæããã³åé€ãããïŒãã¡ã€ã«ãã€ã³ããã¯ã¹ä»ãããŸãã
git add -A /puth/
ã©ã¡ãã
git add -A /puth/file.php
ããŒãžã§ã³ç®¡çã·ã¹ãã ã«è¿œå ããå¿ èŠããããã¹ãŠã®ãã£ã¬ã¯ããªãšãã¡ã€ã«ã ãã¹ã®ä»£ããã®ãã€ã³ãã¯ããã¹ãŠã®å€æŽãããïŒããã³äœæããã³åé€ãããïŒãã¡ã€ã«ãã€ã³ããã¯ã¹ä»ãããŸãã
3.2.2ã¿ã¹ã¯æŽæ°ã®ããŒã«ããã¯-ã¹ããã2
cd /u-app/bitrix/Apache/htdocs/bitrix/
git status
git add -A .
git commit -m 'Prod changes ##'
git push origin master
æŠéã¹ããŒã¿ã¹ã確èªããŠãã ããã
ããã«ã¹ããŒã¿ã¹ãå€æŽãããå ŽåïŒããã³ãã¹ã/ãªãªãŒã¹ãããäžé©åãªç¶æ ã«ããå ŽåïŒãå€æŽãã³ãããããåæã®ããã«äžå€®ãªããžããªã«éä¿¡ããŸãã
å€æŽããªãå Žåã¯ãæé 4ã«é²ã¿ãŸãã
3.2.3ã¿ã¹ã¯æŽæ°ã®ããŒã«ããã¯-ã¹ããã3
cd /u-app/bitrix/Apache/htdocs/bitrix/
git pull origin master
Test / Reliveã®ã¿ã¹ã¯ã®ããŒã«ã¢ããäžã«æŠéãå€æŽãããå ŽåïŒã¹ããã2ãåç §ïŒãïŒäžå€®ãªããžããªãä»ããŠïŒæŠéã®å€æŽãTest / Reliveã«ããŒã«ããå€æŽãã¢ãã¬ãŒãããå¿ èŠããããŸãã
GITãåç¬ã§ãã©ã³ããããŒãžã§ããªãå ŽåïŒããšãã°ãåããã¡ã€ã«ã®å€æŽã«ãã競åãçºçããå ŽåïŒã競åãæåã§è§£æ±ºããå¿ èŠããããŸãã
ã¹ãããã®æåŸã«âã¹ããã1ã«æ»ããŸãã
3.2.4ã¿ã¹ã¯æŽæ°ã®ããŒã«ããã¯-ã¹ããã4
cd /u-app/bitrix/Apache/htdocs/bitrix/
git pull origin TIKET_######
äžå€®ãªããžããªããããã«ã«ã¿ã¹ã¯æŽæ°ãããŒã«ããŸã
3.3æ¯æ¥ã®å€æŽãã³ãããããïŒäžæ¥ã®çµããïŒ
æ®å¿µãªãããäžèšã®ããã»ã¹ã«ãé¢ãããã2ã€ã®äž»ãªçç±ã«ãããæŠéã«ã¯åžžã«å€åããããŸãã
- ããã«ãµãŒããŒã®å ¬ééšåã®ãã¡ã€ã«ãå€æŽããã¢ã¯ã»ã¹æš©ãæã€ã³ã³ãã³ããšãã£ã¿ãŒãå€æ°ãããŸãïŒåœç¶ãæš©éãå¶éãããŠãããPHPã³ãŒããç·šéããã¢ã¯ã»ã¹æš©ã¯ãããŸããããhtmlããŒã¯ã¢ãããå€æŽã§ããŸãïŒã
- Daughtersã®ã¿ã¹ã¯ããããã³ã¢/ bitrix /ã«ãã°ãã°åœ±é¿ããŸãïŒèŠåãšããŠããã³ãã¬ãŒããšã³ã³ããŒãã³ãã衚瀺ãŸãã¯å€æŽãããŸãïŒ
ãããã£ãŠãå¶æ¥æ¥ã®çµããã«æ¯æ¥ïŒãããŠã17.50ã¢ã¹ã¯ã¯æéåŸã®èšäºã®åé ããèŠããŠããããã«ãéçºè ãšç§ã¯ããã«ã§phpãç·šéããèœåã倱ããŸãïŒç§ã¯ã¿ã¹ã¯ã®å€ã§è¡ããããã¹ãŠã®ç·šéããŸãšããŠã³ãããããŸãã
æã¯ã©ãããŠïŒ
äœããã®çç±ã§æ©ãã«ä»äºãèŸããªããã°ãªããªãå Žåã¯ãéåžžãã¯ãŒã¯ãããŒãå§ãŸãåã®ç¿æ¥ã«ïŒéçºè
ãæãããããã§å¯ãŠããéã«ïŒãã®ãŸãŸã«ããŸãã
ãã ããPreliveãšProdã¯å€éã«åæããããããããã¯è€éããå¢ããŸãïŒ ã€ãŸã ååäžã®ã³ããããããŠããªãå€æŽã¯ãæŠéã ãã§ãªãåã³ã«ããªããŸãïŒ
ã€ãŸããæ¥äžã¯ç¡æã§ã¿ã¹ã¯ã®å±éãæŸæ£ããããGITã䜿çšããŠãã¡ã€ã«ãåæããå¿ èŠããããŸãã
ãã ããPreliveãšProdã¯å€éã«åæããããããããã¯è€éããå¢ããŸãïŒ ã€ãŸã ååäžã®ã³ããããããŠããªãå€æŽã¯ãæŠéã ãã§ãªãåã³ã«ããªããŸãïŒ
ã€ãŸããæ¥äžã¯ç¡æã§ã¿ã¹ã¯ã®å±éãæŸæ£ããããGITã䜿çšããŠãã¡ã€ã«ãåæããå¿ èŠããããŸãã
- Preliveç¶æ ããæåŸã®ã³ããããžã®ããŒã«ããã¯ïŒ3.4.1ãåç §ïŒ
- çŸåšã®ç¶æ ãGitLabããPreludeã«ããŒã«ã¢ããããŸãïŒgit pullã3.1.3ãåç §ïŒ
ãã®ããã»ã¹ã¯ãæŠéã§ã®å€æŽã®ã³ããããšãŸã£ããåãã§ãïŒ3.1.2ãåç §ïŒã
cd /u-app/bitrix/Apache/htdocs/bitrix/
git status
git add -A .
git commit -m 'Prod changes ##'
git push origin master
3.4ããŒã«ããã¯ã®å€æŽ
- å€æŽãããŒã«ããã¯ããå¿ èŠãããç¶æ³ã¯3çš®é¡ãããŸãïŒç¶æ³ãæªåããããïŒã
- ãã¹ã/ãªã©ã€ãã®ããŒã«ããã¯ïŒãšã©ãŒãçºçããããã¿ã¹ã¯ãæ£åžžã«æ€èšŒããããã¯é¢ä¿ãããŸãã-ããµã€ãã解æŸãããå¿ èŠããããŸãããã¹ã/ãªã©ã€ãã®å€æŽã¯å¿ èŠãããŸããïŒ
- GITãä»ãã軜埮ãªãšã©ãŒã®ããã«ãžã®ããŒã«ããã¯ïŒããŒã¯ãŒãã¯éèŠã§ã¯ãããŸãããããšãã°ãGitLabã§ã®åæã«ã¯ããŒãžã§ã³å±¥æŽãéèŠã§ãããããã«ã«å®å®ããããŒãžã§ã³ãæ»ãå¿ èŠããããŸããFRESHç·šéã«å¯ŸããŠã®ã¿å®è¡ãããŸãïŒ
- é倧ãªãšã©ãŒã®æŠããžã®ããŒã«ããã¯ïŒã·ãªãŒãºã ã·ã§ãããã¹ãŠããªããªã£ã!!!! 1111ã¯ã³ãŠã§ã€ ãã®ç¶æ³ããããžã§ã¯ãã®ããã©ãŒãã³ã¹ãGitLabã®çŸããã¹ããŒãªãŒãããéèŠãªå ŽåïŒ
3.4.1ãã¹ã-æåŸã®å®å®ç¶æ ãžã®ããŒã«ããã¯
ãé ã«æµ®ãã¶ããšããã¿ã¹ã¯ãæã€ãã¹ããµãŒããŒã§ã®äœæ¥ã¯å®è¡ãããŸããã ãã®ãããéçºè ã«ã¯éçºç°å¢ããããŸãã顧客ã«åŒãæž¡ãåã«ãã¹ãããããã ãã«ããã«æ¥ãŸãããããã£ãŠãç¡èç¶æ ã¯å±¥æŽãããéèŠã§ãïŒãã®ããããã©ã°ã¯ç¡¬ãããã§ãã¯ã¢ãŠããªã©ã§ã¯ãªããªã»ãããããŸãïŒã
git reset --hard HEAD
è€æ°ã®ã³ããããããŒã«ããã¯ããå¿ èŠãããå Žåã¯ãGitLabããç¹å®ã®ã³ãããã®ããã·ã¥ãååŸããŠããŒã«ããã¯ããŸãã
git reset --hard #HASH#
3.4.2ãã¡ã€ã-èšåŒµããã¿ã¹ã¯ããšã©ãŒãåŒãèµ·ãããŸãïŒGITçµç±ã§çºçïŒ
ç·šéã«ãã£ãŠãµãŒããŒãé 眮ãããã100ïŒ ãæåŸã®ã³ãããã«ä»å±ãã2ãæåã«äœæãããŠããããæ¢ã«ååãããŠããŠãä»ã®ã¿ã¹ã¯ãšã®äŸåé¢ä¿ãäœæãããå Žåãç·šéããã£ã³ã»ã«ããã«ãŠã³ã¿ãŒã³ããããäœæã§ããŸãã
å©ç¹ã¯ããã®ç·šéã®å±¥æŽãGitLabã«ä¿åããéçºè ïŒã¢ã¯ã»ã¹ã§ããå ŽåïŒãããäžåºŠã³ãããã調ã¹ãé ãåããããšãã§ããããšã§ãã ã¯ããã³ããããGitLabãã¹ã¿ãŒãã©ã³ãã«æ¢ã«å°éããŠããå Žåãåé¡ã¯ãããŸããã
ç·šéãæŠéã§ããã«è¡ãããå ŽåïŒèª°ãæãé¢ãã¹ããïŒïŒããã®æŠç¥ã§ã¯ãæåã«ã³ãããããå¿ èŠããããŸãããããã¯æããã«åççã§ã¯ãããŸããã
git revert HEAD
ååã®å€æŽãç Žæ£ããŠãã«ãŠã³ã¿ãŒã³ããããäœæããŸãã
3.4.3æŠã-ç·šéãæŠããå£ããïŒå®å šã«ïŒ
ãã¹ãŠãéåžžã«æªãå ŽåïŒãµãŒããŒãåãã€ããŠãããããŸãã¯ãéåžžã«éèŠãªæ©èœãããã£ãšåã«å£ããŠããããšãçªç¶å€æããå Žåãç¹ã«è¡ãå Žæã¯ãããŸããïŒ
git reset --hard HEAD
è€æ°ã®ã³ããããããŒã«ããã¯ããå¿ èŠãããå Žåã¯ãGitLabããç¹å®ã®ã³ãããã®ããã·ã¥ãååŸããŠããŒã«ããã¯ããŸãã
git reset --hard #HASH#
ãã®ãããªããŒã«ããã¯ã®çµæãç Žæ£ãããã³ããããGitLabã®masterãã©ã³ãã«æ¢ã«ãããããŠããããšãå€æããå Žåãé åºã埩å ããã«ã¯ãGitLabã®ãªããžããªå šäœãåé€ããŠåäœæããæ¹ãç°¡åãªããšããããããŸãã =ïŒ
ãããã«
説æããã·ããªãªã¯éåžžã«åçŽã§ãã ããã¯åæã«é·æãšçæã§ãã
- å©ç¹ -åå¿è ã®GITãŠãŒã¶ãŒã§ãããŒãžã§ã³ç®¡çã·ã¹ãã ã䜿çšã§ããŸãïŒäŒæäžã«2é±éäžåžã§ãã¹ãæžã¿ïŒ
- æ¬ ç¹ã¯ãçµéšè±å¯ãªãŠãŒã¶ãŒããããæè»ã§èå³æ·±ãã·ããªãªãèŠãŠãäžé£ã®åçŽãªã¢ããªã±ãŒã·ã§ã³ã«ãŒã«ã«åœ¢åŒåããã®ãé£ããããšã§ãã ãã®ãããéçºãšå®è£ ãæåããåŸã Pro Gitã®æ¬ãèªãããšããå§ãããŸãã
ãã ãããã®ãããªéãããããŒã«ãããã§ããGitLabã§ãã®ãããªçŽ æŽãããåçã芳å¯ã§ããŸãã
ããã€ãã®ã³ãããã¯ãç§ã®ã«ãŒã«ã«åŸã£ãŠååãä»ããããŠããŸãããããã¯ãã¿ã¹ã¯ãããŒã«ãªãŒããŒãããšãã«ãéçºè ãTest / PreliveãµãŒããŒã®æ©èœããã°ããèšå®ããçµæã§ãã ãã®ãããªå ŽåãTIKET _ ###### Patch _ ##ïŒãã±ããçªå·ãšãããã·ãªã¢ã«çªå·ïŒãäœæããŠããã©ãã«ãŒãé¢é£ããã¿ã¹ã¯ãç°¡åã«èå¥ã§ããããã«ããŸããã
äžéšã®ã¿ã¹ã¯ã¯ãéçºè ã§ã¯ãªããç§ã«ãã£ãŠçŽæ¥å®è£ ãããŸãã ãã®å ŽåãTiketã§ã¯ãªãTaskããåŒã³åºããå¥ã®äŒèšã·ã¹ãã ã®é¢é£ã¿ã¹ã¯ã®IDã瀺ããŸãã
å®éããã®ãããªæã亀差ç¹ã¯ãŸã£ããçŽ æŽããããã®ã§ã¯ãããŸããã ã¯ãŒã«ã«èŠããŸãããå®éã«ã¯ããã§ãã¯ã®ããã«1é±éãŸãã¯1ãæ延æããããã¹ãŠã®ã¿ã¹ã¯ã¯ã誰ãã«hemoæ žãäœæããããããã¹ãŠãçµ±åããŸãã
äœããå£ããŠããããã§ã¯ãããŸããïŒãã ããGITã§ä¿®æ£ã§ããªã競åãæ°åãã£ãããã解決ããªããã°ãªããŸããã§ããïŒã ããããããã¯ããªããç·åŒµãããŸãã
ãããã質å
QïŒãã©ã³ããå€ãããŸããïŒ
AïŒååãšããŠãåãµãŒããŒã«ã¯1ã€ã®ãã©ã³ãïŒãã¹ã¿ãŒïŒãããããŸããã å€ãã®ãã©ã³ãã¯ãäžå€®ãªããžããªïŒGitLabïŒã«ã®ã¿ååšããŸãã ããããåå¥ã®ãã©ã³ããããŠã³ããŒãããå¿ èŠã¯ã»ãšãã©ãããŸããïŒãã®ã·ããªãªã¯ãçããããäžè¬çã§ã¯ãªãããã説æããŠããŸããïŒã èªç¶ã«äžèŠãªãã©ã³ãïŒã³ãããããã¹ã¿ãŒã«ããŒãžãããïŒã¯å®æçã«ã¯ãªãŒã³ã¢ããããå¿ èŠããããŸãã SVNã«éåžžã«äŒŒãŠããããšãç解ããŠããŸãããç§ãã¡ã«ãšã£ãŠã¯ããŸãæ©èœããå€ãã®å©ãã«ãªããŸãã
QïŒããŒãžã説æãããŠããŸããã ã©ããã£ãŠããã®ïŒ
AïŒååãšããŠãããŒãžã¯GITã«ãã£ãŠèªåçã«å®è¡ãããŸãã ãŸãã«ã競åã®è§£æ±ºãå¿ èŠã§ãã ãã®å ŽåãèªåããŒãžã倱æãããšããéç¥ãåãåããŸãã
ãã®æç¹ã§gitã¹ããŒã¿ã¹ãå®è¡ãããšã競åãããã¡ã€ã«ã®ãªã¹ããåä¿¡ãããŸãã ãããã調ã¹ãŠãã¹ãŠã®ç«¶åã解決ããå¿ èŠããããŸãïŒç¹å¥ãªããŒã«ãŒã¯ãç°ãªãã³ãããããã®ã³ãŒãã®äžéšã匷調衚瀺ããŸãïŒã
ãã ããçµç¹çãªæ¹æ³ãšã®ããŒãžã®ç«¶åã解決ãããããåé¿ããæ¹ãç°¡åã§ãã ãããã«ããŠããå€ãã®å Žåãçµéšè±å¯ãªããã°ã©ããŒã ãããããè¡ãããšãã§ããŸãã
ããã ãšããã°ãPro Gitã®ããŒãžã«é¢ããç« ã¯éåžžã«äŸ¿å©ã§ãã
QïŒã³ãŒãäŸããã¢ã¹ã¿ãªã¹ã¯ãåé€ããããåçã®å¡ãã€ã¶ããå Žæãåé€ãããããããšã¯ã§ããŸããïŒ
AïŒé°è¬ç¥åŠã®ãã®å·šå€§ãªåµé ã«ã€ããŠèªè ã«è¬çœªããŸãã
ããã¯ãå®éã®æ瀺ã®æå°éã®ããã¿ã§ãããã»ãã¥ãªãã£äžã®çç±ããã顧客ã®ä»£è¡šè ã¯ãã©ããèšäºã«åæããããšã«åæããŸããã
AïŒååãšããŠãåãµãŒããŒã«ã¯1ã€ã®ãã©ã³ãïŒãã¹ã¿ãŒïŒãããããŸããã å€ãã®ãã©ã³ãã¯ãäžå€®ãªããžããªïŒGitLabïŒã«ã®ã¿ååšããŸãã ããããåå¥ã®ãã©ã³ããããŠã³ããŒãããå¿ èŠã¯ã»ãšãã©ãããŸããïŒãã®ã·ããªãªã¯ãçããããäžè¬çã§ã¯ãªãããã説æããŠããŸããïŒã èªç¶ã«äžèŠãªãã©ã³ãïŒã³ãããããã¹ã¿ãŒã«ããŒãžãããïŒã¯å®æçã«ã¯ãªãŒã³ã¢ããããå¿ èŠããããŸãã SVNã«éåžžã«äŒŒãŠããããšãç解ããŠããŸãããç§ãã¡ã«ãšã£ãŠã¯ããŸãæ©èœããå€ãã®å©ãã«ãªããŸãã
QïŒããŒãžã説æãããŠããŸããã ã©ããã£ãŠããã®ïŒ
AïŒååãšããŠãããŒãžã¯GITã«ãã£ãŠèªåçã«å®è¡ãããŸãã ãŸãã«ã競åã®è§£æ±ºãå¿ èŠã§ãã ãã®å ŽåãèªåããŒãžã倱æãããšããéç¥ãåãåããŸãã
ãã®æç¹ã§gitã¹ããŒã¿ã¹ãå®è¡ãããšã競åãããã¡ã€ã«ã®ãªã¹ããåä¿¡ãããŸãã ãããã調ã¹ãŠãã¹ãŠã®ç«¶åã解決ããå¿ èŠããããŸãïŒç¹å¥ãªããŒã«ãŒã¯ãç°ãªãã³ãããããã®ã³ãŒãã®äžéšã匷調衚瀺ããŸãïŒã
ãã ããçµç¹çãªæ¹æ³ãšã®ããŒãžã®ç«¶åã解決ãããããåé¿ããæ¹ãç°¡åã§ãã ãããã«ããŠããå€ãã®å Žåãçµéšè±å¯ãªããã°ã©ããŒã ãããããè¡ãããšãã§ããŸãã
ããã ãšããã°ãPro Gitã®ããŒãžã«é¢ããç« ã¯éåžžã«äŸ¿å©ã§ãã
QïŒã³ãŒãäŸããã¢ã¹ã¿ãªã¹ã¯ãåé€ããããåçã®å¡ãã€ã¶ããå Žæãåé€ãããããããšã¯ã§ããŸããïŒ
AïŒé°è¬ç¥åŠã®ãã®å·šå€§ãªåµé ã«ã€ããŠèªè ã«è¬çœªããŸãã
ããã¯ãå®éã®æ瀺ã®æå°éã®ããã¿ã§ãããã»ãã¥ãªãã£äžã®çç±ããã顧客ã®ä»£è¡šè ã¯ãã©ããèšäºã«åæããããšã«åæããŸããã