إنني أتطلع إلى تطوير موقع ويب وسيتم تنفيذ كل العمل عن بُعد (بدون خادم تطوير محلي). والسبب في ذلك هو أن شركة الاستضافة المشتركة a2hosting الخاصة بي تحتوي على تكوين محدد (symfony ، mysql ، git) لا أريد أن أقضي وقتًا مكررًا عندما أستطيع أن أقوم بالتطوير والتطوير عن بُعد أو من خلال ميزات netbeans للتحرير عن بُعد.
سؤالي هو كيف يمكنني استخدام git لفصل موقعي في ثلاثة مجالات: مباشر ، التدريج وديف.
وهنا بلدي الفكر الأولي:
التحكم في الإصدار مع بوابة:
الإعداد الأولي:
cd public_html
git init
git add *
git commit -m ‘initial commit of the site’
cd ..
git clone public_html testing
mkdir dev
التنمية:
cd /dev
git clone ../testing ticket#
all work is done in ./dev/ticket#,
then visit www.domain.com/dev/ticket# to visually test
make granular commits as necessary until dev is done
git Push Origin master:ticket#
if the above fails:
merge latest testing state into current dev work: git merge Origin/master
then try the Push again
mark ticket# as ready for integration
عملية التكامل والنشر:
cd ../../testing
git merge ticket# -m "integration test for ticket# --no-ff (check for conflicts )
run hudson tests
visit www.domain.com/testing for visual test
if all tests pass:
if this ticket marks the end of a big dev sprint:
make a snapshot with git tag
git Push --tags Origin
else
git Push Origin
cd ../public_html
git checkout -f (live site should have the latest dev from ticket#)
else:
revert the merge: git checkout master~1; git commit -m "reverting ticket#"
update ticket# that testing failed with the failure details
لقطات:
يجب أن يكون لكل سباق نشر رئيسي اسم قياسي ويجب تتبعه.
العودة إلى الحالة السابقة
إذا حدث خطأ ما ، فارجع إلى اللقطة السابقة وقم بتصحيح المشكلة في مطور باستخدام تذكرة جديدة #. بمجرد إصلاح الخلل ، اتبع عملية النشر مرة أخرى.
أسئلتي:
نعم ، سير العمل منطقي. الشيء الوحيد الذي لا أحصل عليه هو الحاجة إلى نظام اختبار منفصل. أقصد نعم ، من المفيد أن يكون لديك فريق اختبار لمنحهم منصة خاصة بهم ، ولكن إذا كنت أنت فقط؟ ليس كثيرا IMHO ، لفرق التطوير صغيرة الحجم ، هذا النوع من الأشياء غير ضروري ويصبح مشكلة.
سأقترح ما هو واضح هنا (وأنا مستعد لأن أسقط) ، لكن ماذا عن بوابة العودة ؟