إستراتيجية إصدار البرامج


الإصدار الدلالي 2.0.0.
نظرا لنسخة رقم MAJOR. MINOR. PATCH، زيادة:
الإصدار الرئيسي عند إجراء تغييرات أبي غير متوافقة، نسخة مينور عند إضافة وظيفة بطريقة متوافقة مع الوراء، ونسخة باتش عند إجراء إصلاحات الشوائب متوافق مع الوراء.
تتوفر تسميات إضافية للبيانات الأولية قبل إصدار البيانات وبناءها كإضافات بتنسيق MAJOR. MINOR. PATCH.
المقدمة.
في العالم من إدارة البرمجيات هناك مكان الفزع يسمى "الجحيم التبعية". أكبر نظامك ينمو والمزيد من الحزم التي تدمجها في البرنامج الخاص بك، والأرجح أن تجد نفسك، يوم واحد، في هذا حفرة من اليأس.
في النظم مع العديد من التبعيات، والإفراج عن إصدارات حزمة جديدة يمكن أن تصبح بسرعة كابوسا. إذا كانت مواصفات التبعية ضيقة جدا، فأنت في خطر من قفل الإصدار (عدم القدرة على ترقية حزمة دون الحاجة إلى إصدار إصدارات جديدة من كل حزمة تابعة). إذا تم تحديد التبعيات فضفاضة جدا، وسوف يكون حتما لعض من قبل نسخة الاختلاط (على افتراض التوافق مع الإصدارات المستقبلية أكثر مما هو معقول). الجحيم التبعية هو أين أنت عند قفل الإصدار و / أو إصدار بروميسكويتي يمنعك من بسهولة وأمان نقل المشروع إلى الأمام.
كحل لهذه المشكلة، أقترح مجموعة بسيطة من القواعد والمتطلبات التي تملي كيفية تعيين أرقام الإصدار وزيادة. وتستند هذه القواعد إلى، ولكن لا تقتصر بالضرورة على الممارسات الشائعة الواسعة الانتشار الموجودة سابقا، المستخدمة في كل من البرامج المغلقة والمفتوحة المصدر. لهذا النظام للعمل، تحتاج أولا إلى إعلان أبي العامة. وقد يتكون ذلك من الوثائق أو ينفذها القانون نفسه. وبغض النظر عن ذلك، من المهم أن تكون هذه المعلومات واضحة ودقيقة. بعد تحديد واجهة برمجة التطبيقات العامة، يمكنك توصيل التغييرات إليها بزيادات محددة إلى رقم الإصدار. النظر في صيغة إصدار X. Y.Z (الرائد. ماينور. باتش). إصلاحات الشوائب التي لا تؤثر على زيادة أبي النسخة التصحيح، إضافات أبي متوافق / التغييرات الإضافية زيادة الإصدار الثانوي، وتغييرات أبي غير متوافقة إلى الوراء زيادة الإصدار الرئيسي.
أدعو هذا النظام "الإصدار الدلالي". في إطار هذا المخطط، أرقام الإصدار والطريقة التي تغيرها تنقل معنى حول التعليمات البرمجية الأساسية وما تم تعديله من نسخة واحدة إلى أخرى.
مواصفات الإصدار الدلالي (سيمفر)
يجب أن تكون الكلمات الرئيسية "مست" و "مست نوت" و "ريكيرد" و "شال" و "شال" و "شولد" و "شولد" و "ريكومندد" و "ماي" و "أوبتيونال" في هذا المستند ليتم تفسيرها كما هو موضح في رك 2119.
البرمجيات باستخدام الدلالي فيرسيونينغ يجب أن تعلن أبي العامة. يمكن أن يتم الإعلان عن أبي في التعليمات البرمجية نفسها أو موجودة بدقة في الوثائق. ومع ذلك يتم ذلك، فإنه ينبغي أن يكون دقيقا وشاملا.
يجب أن يكون رقم الإصدار العادي هو النموذج X. Y.Z حيث X و Y و Z عبارة عن أعداد صحيحة غير سالبة، ويجب ألا تحتوي على أصفار رائدة. X هو الإصدار الرئيسي، Y هو الإصدار الثانوي، و Z هو النسخة التصحيح. يجب أن يزيد كل عنصر عدديا. على سبيل المثال: 1.9.0 - & غ؛ 1.10.0 - & غ؛ 1.11.0.
مرة واحدة وقد تم الافراج عن حزمة الإصدار، محتويات هذا الإصدار يجب أن لا يتم تعديلها. يجب إصدار أي تعديلات كإصدار جديد.
النسخة الرئيسية صفر (0.y. z) هو للتطوير الأولي. قد يتغير أي شيء في أي وقت. لا ينبغي اعتبار أبي العامة مستقرة.
الإصدار 1.0.0 يحدد أبي العامة. تعتمد الطريقة التي يتم بها زيادة رقم الإصدار بعد هذا الإصدار على واجهة برمجة التطبيقات العامة هذه وكيفية تغييرها.
التصحيح نسخة Z (x. y.Z | x & غ؛ 0) يجب أن تكون متزايدة إذا تم تقديم إصلاحات الشوائب المتوافقة إلى الوراء فقط. يتم تعريف إصلاح الأخطاء كتغيير داخلي يقوم بإصلاح سلوك غير صحيح.
النسخة الصغرى Y (x. Y.z | x & غ؛ 0) يجب أن تكون متزايدة إذا تم تقديم وظيفة متوافقة جديدة إلى الوراء أبي العامة. يجب أن يتم زيادة إذا تم وضع علامة على أي وظيفة أبي العامة بأنها مهملة. ويمكن زيادتها إذا تم إدخال وظائف أو تحسينات جديدة جوهرية ضمن الشفرة الخاصة. قد تشمل تغييرات مستوى التصحيح. يجب إعادة تعيين التصحيح النسخة إلى 0 عندما يتم زيادة إصدار طفيفة.
الإصدار الرئيسي X (X. y.z | X & غ؛ 0) يجب زيادة إذا تم إدخال أي تغييرات غير متوافقة إلى الوراء إلى أبي العامة. قد تشمل تغييرات طفيفة و مستوى التصحيح. يجب إعادة تعيين التصحيح والنسخة البسيطة إلى 0 عند زيادة الإصدار الرئيسي.
يمكن الإشارة إلى إصدار ما قبل الإصدار عن طريق إلحاق الواصلة وسلسلة من المعرفات المفصولة بنقطة مباشرة بعد إصدار التصحيح. يجب أن تتكون المعرفات فقط من أبجدية رقمية أسي و واصلة [0-9A-زا-z-]. يجب ألا تكون المعرفات فارغة. يجب أن لا تتضمن المعرفات الرقمية الأصفار الرائدة. الإصدارات السابقة للإصدار لها أسبقية أقل من النسخة العادية المرتبطة بها. يشير إصدار ما قبل الإصدار إلى أن الإصدار غير مستقر وقد لا يفي بمتطلبات التوافق المقصودة كما هو موضح في النسخة العادية المقترنة به. أمثلة: 1.0.0-ألفا، 1.0.0-ألفا.1، 1.0.0-0.3.7، 1.0.0-x.7.z.92.
قد يتم إنشاء بيانات التعريف من خلال إلحاق علامة زائد وسلسلة من المعرفات المفصولة بنقطة على الفور بعد التصحيح أو إصدار ما قبل الإصدار. يجب أن تتكون المعرفات فقط من أبجدية رقمية أسي و واصلة [0-9A-زا-z-]. يجب ألا تكون المعرفات فارغة. يجب تجاهل البيانات الوصفية عند تحديد أولوية الإصدار. وبالتالي نسختين تختلفان فقط في البيانات الوصفية للبناء، لها نفس الأسبقية. أمثلة: 1.0.0-ألفا + 001، 1.0.0 + 20180313144700، 1.0.0-بيتا + exp. sha.5114f85.
تشير الأسبقية إلى كيفية مقارنة الإصدارات مع بعضها البعض عند طلبها. يجب أن تحسب الأسبقية عن طريق فصل النسخة إلى معرفات رئيسية، وصغيرة، وتصحيح، وما قبل النشر في هذا الترتيب (بناء البيانات الوصفية لا تعتبر في الأسبقية). وتحدد الأسبقية بالفارق الأول عند مقارنة كل من هذه المعرفات من اليسار إلى اليمين على النحو التالي: تتم دائما مقارنة الإصدارات الرئيسية والثانوية والتصحيحية عدديا. مثال: 1.0.0 & لوت؛ 2.0.0 & لوت؛ 2.1.0 & لوت؛ 2.1.1. عندما تكون كبيرة، طفيفة، والتصحيح متساوية، إصدار ما قبل الإصدار له أسبقية أقل من النسخة العادية. مثال: 1.0.0-ألفا & لوت؛ 1.0.0. يجب تحديد الأسبقية لنسختين مسبقتين مع نفس الإصدار الرئيسي والثانوي والتصحيح من خلال مقارنة كل معرف من النقاط المفصولة من اليسار إلى اليمين حتى يتم العثور على الفرق على النحو التالي: تتم مقارنة المعرفات المكونة من أرقام فقط رقميا ومعرفات تحتوي على أحرف أو الواصلات مقارنة مع ترتيب أسي. وتكون للمعرفات الرقمية دائما أسبقية أقل من المعرفات غير الرقمية. مجموعة أكبر من حقول ما قبل النشر لها أسبقية أعلى من مجموعة أصغر، إذا كانت جميع المعرفات السابقة متساوية. مثال: 1.0.0-ألفا & لوت؛ 1.0.0-alpha.1 & لوت؛ 1.0.0-alpha. beta & لوت؛ 1.0.0-بيتا & لوت؛ 1.0.0-beta.2 & لوت؛ 1.0.0-beta.11 & لوت؛ 1.0.0-rc.1 & لوت؛ 1.0.0.
لماذا استخدام الإصدار الدلالي؟
هذه ليست فكرة جديدة أو ثورية. في الواقع، ربما تفعل شيئا قريبا من هذا بالفعل. المشكلة هي أن "وثيقة" ليست جيدة بما فيه الكفاية. وبدون الامتثال لبعض المواصفات الرسمية، فإن أرقام الإصدارات غير مجدية أساسا لإدارة التبعية. من خلال إعطاء اسم وتعريف واضح للأفكار المذكورة أعلاه، يصبح من السهل على التواصل نواياكم لمستخدمي البرنامج الخاص بك. وبمجرد أن تكون هذه النوايا واضحة، يمكن أخيرا وضع مواصفات تبعية مرنة (ولكنها ليست مرنة جدا).
مثال بسيط سوف يبرهن كيف يمكن للغة الدلالية أن تجعل التبعية الجحيم شيئا من الماضي. النظر في مكتبة تسمى "فيريتروك". فإنه يتطلب حزمة فيرسيونيمد اسميا "سلم". في الوقت الذي يتم إنشاء فيريتروك، سلم في الإصدار 3.1.0. منذ يستخدم فيريتروك بعض الوظائف التي أدخلت لأول مرة في 3.1.0، يمكنك تحديد بأمان التبعية سلم أكبر من أو يساوي 3.1.0 ولكن أقل من 4.0.0. الآن، عندما سلالم الإصدار 3.1.1 و 3.2.0 تصبح متاحة، يمكنك تحريرها إلى نظام إدارة الحزمة الخاصة بك ومعرفة أنها سوف تكون متوافقة مع البرامج المعتمدة القائمة.
كمطور مسؤول سوف، بطبيعة الحال، تريد التحقق من أن أي وظيفة ترقية حزمة كما المعلن عنها. العالم الحقيقي هو مكان فوضوي. لا يوجد شيء يمكننا القيام به حيال ذلك ولكن كن حذرا. ما يمكنك القيام به هو السماح الإصدار الدلالي توفر لك بطريقة عاقل للافراج عن وترقية حزم دون الحاجة إلى لفة إصدارات جديدة من الحزم التابعة، مما يوفر لك الوقت والمتاعب.
إذا كان كل هذا يبدو مرغوبا فيه، كل ما عليك القيام به لبدء استخدام الدلالي فيرسيونينغ هو أن تعلن أن تقوم بذلك ثم اتبع القواعد. رابط إلى هذا الموقع من ريدمي الخاص بك حتى الآخرين يعرفون القواعد ويمكن الاستفادة منها.
كيف يمكنني التعامل مع المراجعات في مرحلة التطوير الأولي 0.y. z؟
أبسط شيء يجب القيام به هو بدء إصدار التطوير الأولي في 0.1.0 ثم زيادة الإصدار الثانوي لكل إصدار لاحق.
كيف أعرف متى يتم إصدار 1.0.0؟
إذا كان يتم استخدام البرنامج الخاص بك في الإنتاج، فإنه من المحتمل أن يكون بالفعل 1.0.0. إذا كان لديك أبي مستقرة التي قد تأتي للمستخدمين الاعتماد، يجب أن يكون 1.0.0. إذا كنت تقلق كثيرا حول التوافق مع الوراء، فمن المحتمل أن تكون بالفعل 1.0.0.
أليس هذا يثبط التطور السريع والتكرار السريع؟
الإصدار الرئيسي الصفر هو كل شيء عن التطور السريع. إذا كنت تقوم بتغيير واجهة برمجة التطبيقات كل يوم يجب أن تكون إما في الإصدار 0.y. z أو على فرع تطوير منفصل يعمل على الإصدار الرئيسي التالي.
إذا كان حتى أصغر التغييرات المتعارضة إلى الوراء إلى أبي العامة تتطلب عثرة نسخة رئيسية، لن ينتهي الأمر في الإصدار 42.0.0 بسرعة كبيرة؟
وهذه مسألة تنمية مسؤولة وبصيرة. يجب عدم إدخال التغييرات غير المتوافقة بشكل خفيف على البرامج التي تحتوي على الكثير من التعليمات البرمجية التابعة. والتكلفة التي يجب تكبدها للترقية يمكن أن تكون كبيرة. إن الاضطرار إلى عثرة الإصدارات الرئيسية لإطلاق تغييرات غير متوافقة يعني أنك ستفكر من خلال تأثير التغييرات، وتقيم نسبة التكلفة / المنفعة المعنية.
توثيق أبي العام بأكمله هو الكثير من العمل!
ومن مسؤوليتكم كمطور محترف لتوثيق البرامج التي يقصد استخدامها من قبل الآخرين بشكل صحيح. إدارة تعقيد البرمجيات هو جزء مهم للغاية من الحفاظ على كفاءة المشروع، وهذا من الصعب القيام به إذا كان لا أحد يعرف كيفية استخدام البرنامج الخاص بك، أو ما هي طرق آمنة للاتصال. على المدى الطويل، الإصدار الدلالي، والإصرار على أبي العامة محددة بشكل جيد يمكن أن تبقي الجميع وكل شيء بسلاسة.
ماذا أفعل إذا قمت بطريق الخطأ بإطلاق تغيير غير متوافق مع الإصدارات السابقة كنسخة ثانوية؟
بمجرد أن تدرك أنك قد كسر مواصفات الإصدار الدلالي، قم بإصلاح المشكلة وقم بإصدار نسخة ثانوية جديدة تقوم بتصحيح المشكلة واستعادة التوافق إلى الوراء. وحتى في ظل هذه الظروف، من غير المقبول تعديل النشرات المصورة. إذا كان ذلك ملائما، فقم بتوثيق النسخة المسيئة وإبلاغ المستخدمين بالمشكلة حتى يكونوا على دراية بالإصدار المسيء.
ماذا علي أن أفعل إذا قمت بتحديث التبعيات الخاصة بي دون تغيير أبي العامة؟
ويعتبر ذلك متوافقا لأنه لا يؤثر على واجهة برمجة التطبيقات العامة. البرمجيات التي تعتمد صراحة على نفس التبعيات كما الحزمة الخاصة بك يجب أن يكون مواصفات التبعية الخاصة بها وسوف يلاحظ المؤلف أي تضارب. تحديد ما إذا كان التغيير هو مستوى تصحيح أو تعديل مستوى ثانوي يعتمد على ما إذا قمت بتحديث التبعيات الخاصة بك من أجل إصلاح الخلل أو إدخال وظائف جديدة. وأتوقع عادة رمز إضافي لهذا المثال الأخير، وفي هذه الحالة فإنه من الواضح زيادة مستوى ثانوي.
ماذا لو غيرت عن غير قصد واجهة برمجة التطبيقات العامة بطريقة لا تتوافق مع تغيير رقم الإصدار (بمعنى أن الرمز يقدم بشكل غير صحيح تغييرا كبيرا في إصدار التصحيح)؟
استخدام أفضل حكم. إذا كان لديك جمهور ضخم من شأنه أن يتأثر بشكل كبير من خلال تغيير السلوك مرة أخرى إلى ما أبي العامة المقصود، ثم قد يكون من الأفضل لأداء إصدار النسخة الرئيسية، على الرغم من أن الإصلاح يمكن أن تعتبر صارمة إطلاق التصحيح. تذكر، الإصدار الدلالي هو كل شيء عن نقل معنى كيف يتغير رقم الإصدار. إذا كانت هذه التغييرات مهمة للمستخدمين، فاستخدم رقم الإصدار لإعلامهم.
كيف يمكنني التعامل مع وظيفة إبطال؟
إن إهمال الوظائف الموجودة هو جزء طبيعي من تطوير البرمجيات وغالبا ما يكون مطلوبا لتحقيق تقدم إلى الأمام. عند إبطال جزء من واجهة برمجة التطبيقات العامة، يجب عليك تنفيذ أمرين: (1) تحديث المستندات لإعلام المستخدمين بالتغيير، (2) إصدار إصدار ثانوي جديد مع الإيقاف في المكان. قبل إزالة الوظيفة بشكل كامل في إصدار رئيسي جديد يجب أن يكون هناك إصدار صغير واحد على الأقل يحتوي على الإيقاف بحيث يمكن للمستخدمين الانتقال بسلاسة إلى واجهة برمجة التطبيقات الجديدة.
هل لدى سيمفر حد حجم على سلسلة الإصدار؟
لا، ولكن استخدام الحكم الجيد. ربما تكون سلسلة إصدار حرف 255 مفرطة، على سبيل المثال. أيضا، قد تفرض أنظمة محددة حدودها الخاصة على حجم السلسلة.
مواصفات تأليف الدلالي تأليف توم بريستون-فيرنر، مخترع غرافاتارس ومؤسس مؤسس جيثب.
إذا كنت ترغب في ترك ردود الفعل، يرجى فتح مشكلة على جيثب.

إستراتيجية إصدار البرامج
الحصول على فيا أب ستور قراءة هذه المشاركة في التطبيق لدينا!
أفضل الممارسات: إصدار البرامج [كلوسيد]
هل هناك أي دليل أو معيار أفضل الممارسات كيفية إصدار البرامج التي تتطور في وقت فراغك للمتعة، ولكن مع ذلك سوف تستخدم من قبل بعض الناس؟ أعتقد أنه من الضروري إصدار مثل هذه البرامج بحيث تعرف عن الإصدار الأول الذي تتحدث عنه (على سبيل المثال لإصلاح الأخطاء والدعم وما إلى ذلك).
ولكن أين يمكنني بدء الإصدار؟ 0.0.0؟ أو 0.0؟ ثم كيف يمكنني زيادة الأرقام؟ تغيير الإصدار الرئيسي. مينور؟ ولا ينبغي أن أي التزام لنظام مراقبة الإصدار يكون نسخة أخرى؟ أو هل هذا فقط للإصدارات التي تستخدم بطريقة منتجة؟
مغلقة في المقام الأول على أساس الرأي من قبل البومى، أنيموسون & # 9830؛ 2 أغسطس 1313 في 15:43.
العديد من الأسئلة الجيدة تولد قدرا من الرأي استنادا إلى خبرة الخبراء، ولكن الإجابات على هذا السؤال سوف تميل إلى أن تستند بشكل كامل تقريبا إلى الآراء، بدلا من الحقائق أو المراجع أو الخبرة المحددة. إذا كان يمكن إعادة صياغة هذا السؤال لتناسب القواعد في مركز المساعدة، يرجى تعديل السؤال.
مقفل بواسطة فليكسو & # 9830؛ 21 مارس 2117 في 21:32.
هذا السؤال موجود لأنه ذو أهمية تاريخية، ولكنه لا يعتبر سؤالا جيدا حول الموضوع لهذا الموقع، لذا يرجى عدم استخدامه كدليل على أنه يمكنك طرح أسئلة مشابهة هنا. يتم تجميد هذا السؤال وإجاباته ولا يمكن تغييره. مزيد من المعلومات: مركز المساعدة.
12 أجوبة.
يجب أن تبدأ مع الإصدار 1، إلا إذا كنت تعرف أن النسخة الأولى التي "الافراج" غير مكتملة بطريقة أو بأخرى.
أما بالنسبة لك كيفية زيادة الإصدارات، وهذا متروك لكم، ولكن استخدام الرئيسية، طفيفة، بناء الترقيم كدليل.
ليس من الضروري أن يكون لديك كل إصدار تلتزم التحكم المصدر كإصدار آخر - سيكون لديك قريبا عدد كبير جدا نسخة في الواقع. تحتاج فقط إلى زيادة رقم الإصدار (في بعض الطريق) عند إصدار نسخة جديدة إلى العالم الخارجي.
حتى إذا قمت بإجراء خطوة تغيير كبير من الإصدار 1.0.0.0 إلى الإصدار 2.0.0.0 (قمت بتغيير من وينفورمز إلى وف على سبيل المثال). إذا قمت بإجراء خطوة تغيير أصغر من 1.0.0.0 إلى 1.1.0.0 (قمت بإضافة دعم لملفات بابوا نيو غينيا). إذا قمت بإجراء تغيير طفيف ثم انتقل من 1.0.0.0 إلى 1.0.1.0 (قمت بإصلاح بعض الخلل).
إذا كنت تريد حقا الحصول على استخدام مفصل العدد النهائي كرقم البناء الذي من شأنه أن يزيد لكل تشيكين / ارتكاب (ولكن أعتقد أن هذا الذهاب بعيدا جدا).
وأود أن استخدام x. y.z نوع من الإصدار.
x - الإصدار الرئيسي.
ذ - الإفراج الطفيفة.
z - رقم البناء.
أنا أساسا اتبع هذا النمط:
عندما يكون جاهزا أنا فرع رمز في الريبو المصدر، علامة 0.1.0 وإنشاء فرع 0.1.0، يصبح الرأس / الجذع 0.2.0 لقطة أو شيء مماثل.
أنا أضيف ميزات جديدة فقط إلى الجذع، ولكن باكبورت إصلاحات للفرع وفي الوقت الذي صدر منه 0.1.1، 0.1.2،.
أعلن الإصدار 1.0.0 عندما يعتبر المنتج ميزة كاملة وليس لديها أوجه القصور الرئيسية.
من ثم على - يمكن للجميع أن يقرر متى لزيادة النسخة الرئيسية.
أستخدم هذه القاعدة لتطبيقاتي:
. y = فيتور نومبر، 0-9. زيادة هذا الرقم إذا كان التغيير يحتوي على ميزات جديدة مع أو بدون إصلاحات الشوائب. z = رقم الإصلاح العاجل، 0-
. زيادة هذا الرقم إذا كان التغيير يحتوي فقط على إصلاحات الأخطاء.
بالنسبة للتطبيق الجديد، يبدأ رقم الإصدار 1.0.0. إذا كان الإصدار الجديد يحتوي على إصلاحات الأخطاء فقط، قم بزيادة رقم الإصلاح العاجل بحيث يكون رقم الإصدار 1.0.1. إذا كان الإصدار الجديد يحتوي على ميزات جديدة مع أو بدون إصلاحات الأخطاء، قم بزيادة رقم الميزة وإعادة تعيين رقم الإصلاح العاجل إلى الصفر بحيث يكون رقم الإصدار 1.1.0. إذا وصل رقم الميزة إلى 9، فقم بزيادة رقم الإصدار الرئيسي وإعادة تعيين العنصر ورقم الإصلاح العاجل إلى الصفر (2.0.0 وما إلى ذلك)
نستخدم a. b.c. d حيث.
(أ) - زيادة كبيرة (زيادة على التسليم إلى العميل) ب - طفيفة (زيادة على التسليم إلى العميل) ج - مراجعة (زيادة على الإصدارات الداخلية) د - بناء (زيادة بواسطة التحكم في الرحلات البحرية)
وهناك مثال آخر لنهج A. B.C هو إصدار إكليبس باندل. حزم الكسوف بدلا من أن يكون الجزء الرابع:
في الكسوف، وتتكون أرقام الإصدار من أربعة (4) شرائح: 3 الأعداد الصحيحة وسلسلة على التوالي اسمه main. minor. service. qualifier. يلتقط كل شريحة نية مختلفة:
يشير الجزء الرئيسي إلى الكسر في أبي يشير الجزء الطفيفة إلى تغييرات "مرئية من الخارج" يشير قطاع الخدمة إلى إصلاحات الأخطاء وتغيير مسار التطوير يشير الجزء المؤهل إلى بنية معينة.
هناك أيضا مخطط إصدار التاريخ، على سبيل المثال: YYYY. MM، YY. MM، يمد.
انها مفيدة للغاية لأن نظرة أولى يعطي انطباعا عن تاريخ الافراج عنه. ولكن أنا أفضل مخطط x. y.z، لأنني أريد دائما أن تعرف نقطة المنتج بالضبط في دورة حياتها (الرائد. مينور. ريليس)
الجواب الأساسي هو "ذلك يعتمد".
ما هو هدفك في فيرسيونينغ؟ يستخدم العديد من الأشخاص version. revision. build ويعلنون فقط version. revision إلى العالم على أنه إصدار إصدار بدلا من إصدار ديف. إذا كنت تستخدم تسجيل الوصول "الإصدار" ثم عليك أن تجد بسرعة أن أرقام الإصدار الخاص بك تصبح كبيرة.
إذا كنت تخطط لمشروعك ثم كنت زيادة مراجعة الإصدارات مع تغييرات طفيفة وإصدار الزيادة للإصدارات مع تغييرات كبيرة، وإصلاح الأخطاء أو وظيفة / الميزات. إذا كنت تقدم الإصدار بيتا أو ليلا بناء الإصدارات ثم تمديد الإصدار لتشمل بناء وزيادة مع كل إصدار.
ومع ذلك، في نهاية اليوم، والامر متروك لكم ولها أن يكون معنى بالنسبة لك.
كما يقول ماهيش: أود استخدام x. y.z نوع من الإصدار.
x - الإصدار الرئيسي y - الإصدار الصغير z - رقم البناء.
قد ترغب في إضافة داتيتيم، ربما بدلا من z.
يمكنك زيادة الإفراج الطفيفة عندما يكون لديك إصدار آخر. من المحتمل أن يبقى الإصدار الرئيسي 0 أو 1، وتغيير ذلك عندما كنت حقا إجراء تغييرات كبيرة (في كثير من الأحيان عندما يكون البرنامج الخاص بك في نقطة حيث أنها لا تتراجع إلى الوراء مع الإصدارات السابقة، أو قمت بتغيير الإطار بأكمله)
كنت أعلم أنك يمكن أن تحقق دائما لمعرفة ما يفعله الآخرون. وتميل برمجيات المصدر المفتوح إلى السماح بالوصول إلى مستودعاتها. على سبيل المثال هل يمكن أن يشير متصفح سفن الخاص بك إلى svn. doctrine-مشروع ونلقي نظرة على نظام الإصدار المستخدم من قبل مشروع حقيقي.
أرقام الإصدار، والعلامات، كل شيء هناك.
نحن نتبع نهج a. b.c مثل:
زيادة "أ" إذا كان هناك بعض التغييرات الرئيسية حدث في التطبيق. مثل نحن ترقية 1.1 تطبيق إلى 3.5.
"b" إذا كان هناك بعض التغييرات الطفيفة مثل أي كر الجديد أو تعزيز يتم تنفيذها.
"c" إذا كان هناك بعض العيوب إصلاحات في التعليمات البرمجية.
أبدأ الإصدار في أدنى (غير الإصلاح العاجل) سيجيمنت. أنا لا أقصر هذا الجزء إلى 10. ما لم تكن تتبع يبني عليك فقط أن تقرر متى تريد تطبيق زيادة. إذا كان لديك مرحلة ضمان الجودة ثم قد يكون حيث يمكنك تطبيق زيادة إلى أدنى شريحة ثم سيجيمنت المقبل عندما يمر كا ويتم تحريرها. اترك الجزء العلوي لتغييرات السلوك / واجهة المستخدم الرئيسية.
إذا كنت مثلي سوف تجعل من هجين من الأساليب وذلك لتتناسب مع وتيرة تقدم البرنامج الخاص بك.
أعتقد أن النمط الأكثر قبولا a. b.c. أو a. bc. cd خاصة إذا كان لديك كا / الامتثال في المزيج. لقد كان الكثير من فلاك حول تاريخ كونها جزءا عاديا من الإصدارات التي أعطيته ل السائدة.
أنا لا تتبع يبني لذلك أود استخدام نمط a. b.c إلا إذا كان هناك إصلاح عاجل. عندما يكون علي تطبيق إصلاح عاجل ثم تطبيق المعلمة د كتاريخ مع مرور الوقت. واعتمدت المعلمة الوقت كما د لأن هناك دائما إمكانات عدة في يوم عندما تفجر الأمور حقا في الإنتاج. أنا فقط تطبيق د قطاع (يمدن) عندما أنا المتباعدة لإصلاح الإنتاج.
أنا شخصيا لن يعارض مخطط البرمجيات من va. b ريفك حيث c هو ييدمد أو يمد.
كل ما قال. إذا كنت تستطيع مجرد عطل أداة لتكوين وتشغيل معها سوف تبقى لكم من الصداع الحاجة إلى مارشال وجوه الرأي من الإصدار ويمكنك أن تقول فقط "استخدام الأداة". لأن الجميع في عملية التنمية عادة ما تكون متوافقة جدا.

DevOpsNet.
عشوائية ديفوبس رامبلينغز.
بناء استراتيجية إصدار.
على مدى السنوات القليلة الماضية، اتبعت استراتيجية إنشاء الإصدار بالتنسيق التالي:
استخدام النقاط العشرية يسمح لنا لتنفيذ استراتيجية لصناعة السيارات في زيادة لدينا يبني، وهذا يعني معرف البناء لا تحتاج إلى أن تتغير يدويا في كل مرة ننتج بناء، حيث يتم أخذ هذا الاهتمام من قبل نظام البناء. كل من مافين والنمل لديهم أساليب بسيطة لزيادة هذا العدد.
ضمان أن كل بناء له رقم إصدار فريد (من خلال زيادة معرف البناء) يسمح لنا بالتمييز بين البنيات، حيث لا يوجد بناءان من نفس المشروع سيكون لهما نفس معرف الإنشاء. يتم تغيير الأرقام الأخرى يدويا، وعند الاقتضاء.
النسخة الرئيسية - تتغير عادة عندما تكون هناك تغييرات كبيرة جدا على المنتج أو المشروع، مثل بعد إعادة كتابة، أو تغيير كبير في وظيفة.
الإصدار الإصدار - زيادة عندما يكون هناك الافراج عن مسؤول من المشروع الذي لا يعتبر تغيير النسخة الرئيسية. على سبيل المثال، قد نخطط لإصدار مشروع إلى عميل في إصدارين أو 3 إصدارات منفصلة. هذه الإصدارات قد تمثل بشكل جيد نفس النسخة الرئيسية (ويقول الإصدار 5) ولكننا لا تزال ترغب في أن تكون قادرة على تحديد حقيقة أن هذه هي الإصدارات المخطط لها لاحقا، وليس بقع.
رقم تصحيح - هذا يدل على التصحيح إلى إصدار موجود. وينعكس الإصدار الذي يجري تصحيحه في الإصدار الإصدار. وعادة ما تصدر التصحيح لإصلاح علة حرجة أو مجموعة من القضايا الرئيسية، وعلى هذا النحو يختلف عن إصدار "المخطط".
معرف البناء - هذه الزيادات التلقائية مع كل إصدار بناء في نظام سي. وهذا يضمن أن كل بناء له رقم إصدار فريد. عندما يتم زيادة النسخة الرئيسية أو الإصدار الإصدار أو رقم التصحيح، يتم إعادة تعيين معرف البناء إلى 1.
17.23.0.9 - يمثل هذا الإصدار 17.23. هو بناء ال 9 من هذا الإصدار.
17.24.0.1 - هذا هو الإصدار التالي، الإصدار 17.24. هذا هو أول بناء من 17.24.
17.24.1.2 - يمثل هذا التصحيح للإصدار 17.24. هذا هو أول التصحيح التصحيح، ويحدث أن يكون بناء الثاني من هذا التصحيح.
شارك هذا:
ذات صلة.
آخر الملاحة.
3 تعليقات.
أعتقد أنه يجب عليك مبادلة حول التصحيح وأرقام البناء & # 8211؛ مجرد تفضيل شخصي.
& # 8220؛ أعتقد أنه يجب عليك مبادلة حول التصحيح وأرقام البناء - فقط تفضيلي الشخصي. & # 8221؛
التفكير في ذلك، 1 التصحيح قد يستغرق بضعة يبني قبل أن يمر جميع البيئات، (أوه تبادل لاطلاق النار عملت ل رصيف ولكن ليس ويبسفير، قرص التكوين X وإعادة بناء!) ولكن (على افتراض أي عملية سي الحقيقية) استحالة أن يكون نفس بناء عدد تحدث أكثر من مرة.
لذلك 1.0.0.b1، و 1.0.0.b2 يمكن أن يحدث، ويبدو لطيفا.
1.0.b1.0 و 1.0.b2.0 تبدو سخيفة، و 1.0.b1.0 و 1.0.b1.1 يجب ألا يحدث أبدا.

استراتيجيات إصدار البرامج.
عالقة الكمال في العالم الحقيقي.
إصدار البرمجيات يمكن أن تكون واحدة من تلك المناطق حيث كنت لا تشعر وكأنك حصلت عليه بالضبط الحق. ليس هناك توجيه محدد هناك مع حل من شأنه أن يرضي الجميع. معظم فرق البرمجيات إما الخلط حول هذا الموضوع، أو يختارون تجاهل ذلك. ويهدف هذا الدليل إلى سد الفجوة، وتقديم نظرة عملية على مختلف الاستراتيجيات الشعبية والمفاضلة.
بعض التقنيات سوف تكون موجهة نحو ميكروسوفت كومة (ويندوز،)، كما هو ما أنا الأكثر خبرة مع، ولكن المبادئ تنطبق بشكل عام. لينكس، Node. js، بيثون & أمب؛ كما تم تطرق روبي قليلا.
إصدارات في كل مكان.
نحن جميعا جميلة تستخدم لمصطلح "نسخة" في الوقت الحاضر. الأكثر شيوعا في العالم البرمجيات، فقد تسربت إلى وسائل الإعلام وغيرها من الصناعات. ويجري حاليا إصدار إصدارات الفيلم - "فاست أند أمب؛ فوريوس 7" (7!؟)، ويجري الآن إصدار الأحذية - "إير جوردان XX8"، والأكثر شعبية، يتم إصدار الكتب - "مدير دقيقة واحدة، طبعة 1984". في الواقع، بالنظر إلى الكتب، والناس قد تم إصدار بعض الوقت الآن - "موسوعة بريتانيكا"، منذ 1768!
الفرضية بسيطة - حيث أن المنتجات تعيش على ومواصلة تحسين، الإصدارات الجديدة يجب أن تكون متميزة عن الإصدارات السابقة. اسم المنتج لا يتغير، لأن السوق أصبحت بالفعل مألوفة معها، لذلك يتم إلحاق شيء في النهاية للإشارة إلى أنه هو أحدث (أو مختلفة).
في حين أن الإصدارات موجودة منذ فترة طويلة من العصر الرقمي، والبرمجيات دفعت حقا القضية إلى الأمام. يعد تعديل نسخة جديدة من البرمجيات وإصدارها عملية سريعة جدا، أسرع بكثير من تغيير خط الإنتاج الصناعي لإنتاج قطعة جديدة من الملابس أو طباعة طبعة جديدة للكتاب. وهكذا دورات التكرار البرمجيات هي أقصر بكثير، وإمكانية للكثير من الطبعات المتزامنة هو أكبر من ذلك بكثير.
ببساطة استخدام سنوات (أو حتى أشهر)، كما هو الحال في طبعات الكتاب، ليست كافية. ويمكن إنتاج إصدارات جديدة من البرنامج في غضون دقائق. وبالإضافة إلى ذلك، والبرمجيات لديها جانب مواز هائل لذلك - تيارات البرمجيات - حيث يمكن أن توجد العديد من الإصدارات الرئيسية، وكلها يمكن تحديثها باستمرار في نفس الوقت. هذا نادرا ما يحدث مع حذائك. (أتمنى لو فعلت ذلك، وأحيانا أنا فقط لا أريد أن الترقية إلى نموذج كتالوج هذا العام، أريد تحسين زوجي القديم!)
لماذا الإصدار؟
قبل الغوص في كيفية تنفيذ الإصدار، دعونا نتوقف وننظر لماذا نحن نريد أن نفعل ذلك في المقام الأول! بعد كل شيء، إذا كنا نعرف الأسباب الدقيقة لماذا هو مفيد، ثم يمكننا أن نحكم بشكل أفضل ما إذا كانت الحلول المقترحة هي مناسبة.
وقد ألمحنا إلى ذلك في القسم الأخير، مشيرا إلى ما يسمى النسخة العامة. هذا هو الإصدار المرئي بشكل عام، وغالبا ما يحمل وزن التسويق (بمعنى أنه من المرجح أن يتم تعريفه من قبل قسم التسويق / المبيعات). "ويندوز 7" و "إفون 5S" و "أوفيس 2018" - كلها أمثلة على إصدار عام.
ويهدف الإصدار العام لتكون بسيطة ولا تنسى، مشيرا إلى العملاء أنه جديد & أمب؛ لامعة (على افتراض أن الناس يريدون عموما "جديدة وبراقة"). الناس لا يفهمون "10.6.6527.14789" - لكنهم يحصلون على "2018" أو "5". لقد كانت شعبية متزايدة لاستخدام السنة من الإفراج عن عدد الإصدار العام، كما أنها ببساطة وبقوة ينقل ما يصل إلى تاريخ الوضع. كانت شركات صناعة السيارات تفعل ذلك لفترة طويلة.
الإصدار الخاص هو ما كنا عليه في عالم البرمجيات. طابع داخلي (نأمل) يحدد بشكل فريد قطعة معينة من البرمجيات. البرمجيات، مثل سيارة، يمكن أن تكون مصنوعة من أجزاء كثيرة. أخذ قياس السيارة كذلك، السيارة "نسخة خاصة" هو رقم الشاسيه فين. المصنعين الافراج عن والحفاظ على كتالوجات ضخمة من أجزاء، ورسم خرائط لسيارة "أرقام الإصدار". يمكن ميكانيكي ثم أمر جزء بالضبط التي تناسب سيارتك.
بدون "رقم الجزء الخاص"، لن تكون قادرا على خدمة البرنامج الخاص بك في البرية، لأنك لن تعرف بالضبط "الشكل" أن وحدة استبدال يجب أن تكون لتناسب النظام العام. تخيل إذا كنت اضطر لتغيير السيارة بأكملها عندما كسر ضوء الذيل.
لذلك، يتم استخدام رقم الإصدار الخاص تماما مثل معرف الكتالوج. الغرض منه هو أن تستخدم عند استكشاف الأخطاء وإصلاحها أو صيانة البرنامج. (أنا أحب جيف أتوود في "دوغتاغ" قياسا!) يجب أن خريطة إلى وصف ما قطعة البرنامج هو مثل - ما هو شكله وظيفة. وما أفضل "وصف" من شفرة المصدر الأصلي نفسه!
الاستخدام يتلخص أساسا إلى:
تحديد شفرة المصدر الأصلية لجزء من البرنامج، لتمكين التصحيح التدريجي وتأكيد عملية معيبة تحديد ما إذا كان جزء واحد "متوافق" مع آخر، أو ما إذا كان يمكن أن يحل محله.
يتم إنجاز كل هذا مع رقم الإصدار الخاص. الإصدار العام هو مجرد علامة التسويق، ويخطط إلى واحد أو أكثر من أجزاء البرمجيات الداخلية، ولكل منها نسخة خاصة بها. (تماما مثل تويوتا كورولا 2018 يحتوي على إطار ZRE142 ومحول عزم الدوران 32000-12420)
استخدام الإصدار.
في ويندوز يتم دعم مفهوم رقم الإصدار بواسطة طبقة من نظام التشغيل. يتم تضمين أرقام الإصدار في كافة الملفات الثنائية القابلة للتنفيذ، ويمكن أن ينظر إليها عند تحوم فوق إيكس / دل في مستكشف ويندوز، أو عند عرض خصائص. في الواقع، أي ملف يمكن أن يكون "الموارد" يمكن أن يكون إصدار، لأنه يتم تخزينها في المورد فيرسيونينفو.
ويستخدم التنسيق العام الذي نستخدمه جميعا: main. minor. build. revision (على سبيل المثال "1.2.360.0"). من المهم أن نلاحظ أن كل عدد يقتصر على 16 بت، وحتى لا يمكن أن يتجاوز 65535. وهذا له بعض الآثار على ما يمكن أن تمثل مع هذه الأرقام.
لاحظ أن تسمية لهذه الأرقام ليست محددة بدقة - فهي بسيطة 4 أعداد صحيحة قصيرة. ويشار إلى الأولين باسم الرئيسية والثانوية جميلة بالإجماع. آخر اثنين هو حيث نرى بعض الاختلاف، اعتمادا على نظام الإصدار.
يستخدم هذا الإصدار بشكل بارز أثناء عملية تحديث ويندوز، والذي يستخدم تقنية ويندوز إنزتالر (مسي) لتحديث أجزاء مختلفة من النظام. بشكل أساسي، يتبع ويندوز إنزتالر قواعد معينة لتحديد ما إذا كان التحديث الذي يتم تثبيته أحدث من ما تم تثبيته بالفعل. إذا كان الإصدار أكبر، ثم انها موافق لتحديث.
بطبيعة الحال هذا المفهوم يتدفق إلى الإطار، الذي بني حول العديد من المفاهيم ويندوز القائمة. لدينا فئة الإصدار، الذي يتبع 4 عدد صحيح نموذج. يمكننا أيضا تعريف أسمبليفيرزيوناتريبوت و أسمبليفيليفرزيوناتريبوت، التي تحدد إصدار التجميع ومصدر إصدار ويندوز على التوالي.
في الإصدار التجميعي موجود بشكل منفصل عن الإصدار الأساسي الذي يستند إلى ويندوز فيرسيونينفو، وهو ما تراه في مستكشف ويندوز (أو خصائص الملف). وهو يشكل جزءا من اسم الجمعية قوية، ويستخدم حصرا من قبل الإطار عند حل التجميعات. اثنين - نسخة التجميع وإصدار ملف ويندوز - يمكن أن تكون مختلفة، ولكن في كثير من الأحيان أنها هي نفسها لتجنب الارتباك.
يستخدم إصدار تتبع التبعية، بمعنى الإشارة إلى نسخ التجميعات المشار إليها، مما يجعلها واضحة عندما يكسر التحديث التوافق للتطبيق الذي يعتمد على مكتبة معينة. هذه خطوة إلى الأمام من إصدار ملف ويندوز الأصلي، والذي كان يستخدم فقط أثناء عملية التحديث، وليس عند الرجوع إلى مكتبة، مما يؤدي إلى سيئة السمعة "الجحيم دل".
ومن الجدير بالذكر أن النسخة ق يسمح 4 أعداد صحيحة 32 بت، في حين أن أسمبليفيليفرزيوناتريبوت يقتصر على 16 بت، كما أنها خرائط مباشرة إلى الموارد فيرسيونينفو. وهكذا، إذا أردنا أسمبليفرزيوناتريبوت و أسمبليفيليفرزيوناتريبوت أن تكون هي نفسها، وهذا يضع فعالا حد على مكونات الإصدار التجمع كذلك.
Linux, in general, uses a different method to address versioning. Binary files don't contain an embedded version stamp, like most Windows binaries do. Instead, a shared library filename indicates its version, e. g. /usr/local/lib/mylib. so.1.5 .
A number of symbolic links are created, e. g. mylib. so -> mylib. so.1 and mylib. so.1 -> mylib. so.1.5 . An application can reference a library via symbolic link, like mylib. so.1 , and get the latest 1.x compatible version installed.
This works fairly well, as long as everyone follows this convention. Each library can then, in turn, load libraries it depends on in the similar manner.
Linux users would also be familiar with the popular "Advanced Package Tool", apt-get, ubiquitously used on the Debian-derived systems like Ubuntu. Being a true Package Manager it supports installing side-by-side versions and tracking dependencies between packages. We take a closer look at advantages of Package Managers in the following sections.
Version Number Schemes.
There are several popular version numbering schemes for software, but all of them are a variation of the same theme and share common traits. Having major and minor version components is the same across the board. What they represent is fairly consistent:
Major number increase: represents major breaking changes in the software system, often not backwards compatible, or addition of large amount of new functionality Minor number increase: represents less substantial evolutionary changes, mainly updates or improvements in existing functionality, or addition of a smaller new feature set.
Above is only one guideline - there are no set rules about what major and minor versions are supposed to represent. Only that they are supposed to increase as more features are added to the software with time.
Windows and binaries specify a 4-part version scheme: major . minor . build . revision . The last two components are fairly free-form, there are many variations in what they represent - some use incremental build counters, some use date/time of the build, and some derive them from source control internal revision numbers.
Many ignore revision number, and focus only on build . Windows Installer, for example, only has 3 components. If you want your version to span both binaries and the containing package, then it is best to limit yourself to just three numbers: major . minor . build .
In any case, the general pattern : the greater the version number, the more recent the software is .
A popular versioning scheme in recent years (especially among open source projects) has been dubbed Semantic Versioning (aka SemVer), and documented at semver. It introduces a few other components, and makes version an alphanumeric string, rather than a pure number - opening a few interesting possibilities.
The first three components are the same as what we already discussed, with patch being optional. Patch is pretty much equivalent to the build component, but semantics can be different. Semantic Versioning actually prescribes when each component should be incremented (based on "public API" changes).
The prerelease , if specified, is an alphanumeric string that is used to tag a version as one that precedes the final release. For example, 1.3.567-rc1 will precede 1.3.567. This is useful to attach more meaning to the version label than by simply using numbers.
Metadata is another optional component, which allows further tagging of the version label (usually with a build timestamp), but it does not participate in version ordering, i. e. versions that only differ in metadata are considered the same.
Prerelease is useful with Package Managers like NuGet, which treat them differently - they are considered unstable and are not visible to general public, unless explicitly requested. This allows releasing alpha/beta versions without affecting those relying on stable releases.
Prerelease tags can also be useful in the internal release flow when dealing with parallel hotfixes and private builds, as discussed later in this article.
Versioning Non-Binary Files.
So we know how to stamp a version on the binary files . But what about the other files comprising a software system - configuration files, images, documents, fonts, etc? How do you stamp a version on them?
What about web frameworks like ASP (or Ruby, Node. js, Python, etc) where source files and pages can be modified in-place, and automatically updated? How can we patch a web system, i. e. update few target files, and still keep it versioned?
The answer is - don't update individual files ! There is no way for you to keep a meaningful version number for your software application, if individual non-binary files can be updated ad-hoc as hotfixes.
Update using a package instead.
Importance of Build and Package.
When you hear the term "build", normally the compilation comes to mind - most compiled languages, such as C#, C++ or Java, have to be compiled into a binary before being able to be executed. And so building is commonly associated with the process of compiling .
But that's not an entire picture. Some languages or frameworks, such as Python or ASP, don't strictly require compilation. They can be either interpreted, in Python's case, or compiled on-the-fly, in ASP's case. What should a build do for these systems? How do you "build" a Python app?
That's why it is more helpful to think of build as an assembly process , or simply packaging . Just like a line of consumer goods, e. g. shoes, gets packaged before shipping to the stores, so does a software system, before being released.
A package concept is essential to versioning , because a package is a single collection of the pieces that comprise a software system, or part of it, and can therefore be identified, and stamped with a version . With the right Package Management system (which we look at in the next section), it can be deployed and updated, and specify dependencies on the other packages.
Software today is never a single binary executable file - it is a collection of various binaries, libraries, documents, configuration files, images, and other resources. A package is what helps us group them together, version and release to the outside world.
A package doesn't have to be sophisticated, although it helps in some situations (e. g. databases). It can even be a simple ZIP file, that can contain version in the file name, or embedded as a text file. In fact, many open source projects do just that - a release is a ZIP or a. tar. gz archive.
The important thing is that a package is a single unit, that is released and updated at the same time, leading to consistency . It is common to have several packages, for example, representing "client" and "server" components, or any other logical grouping applicable to a software system. Each package can then be updated on its own.
Let's take a look at some of the common packaging methods, the versioning approach, and which application they are best suited for.
Windows Installer.
Best Suited : Complete Windows GUI Applications, Windows Services, or Drivers.
The oldest, and for a long time the only recommended way, to install applications on a Windows platform. It has a built-in versioning support and a sophisticated (some would say "complicated") set of rules for determining when to update components. While a Windows Installer package (.msi) is a single file, in essence, it is a collection of small logical components (down to single files) that can be updated independently.
Windows Installer will actually check each individual file that is being installed, whether it has a version and whether the version is greater than a file with the same name already installed. That means it is important to version not just the installer package, but each file contained in it. But it also means that it is incredibly difficult to do downgrades (i. e. rollbacks) with Windows Installer.
It is best suited for traditional Windows Applications (GUI, services, drivers) that are released to the public. It is, however, not the best choice for internally developed & distributed applications, any kind of Web applications, or database systems.
It was also used to deploy distributable libraries (native DLLs) and COM objects, but with today's focus on , it is not the right mechanism for distributing libraries.
Web Deploy.
Best Suited : Web Applications (IIS, ASP)
Web Deploy technology was specifically designed for deploying and synchronizing applications on Microsoft IIS web servers. IIS Web Farm replication uses Web Deploy commands and packages behind the scenes to synchronize sites across a set of servers. IIS Manager has an extension (enabled by installing Web Deploy) to "Import Application", which can install or update a web application using a Web Deploy zip package.
Its biggest disadvantage is that it can only be used for web applications on Microsoft IIS platform, and the limited mechanism for customizing installation. While it could be suited for simple web applications, it can quickly become frustrating for anything more sophisticated, i. e. variables, conditional logic, databases, etc.
In addition, it has no inherent support for versioning .
Package Managers.
Best Suited : Shared Libraries, Dependencies, Command-line Utilities.
Package Managers are great for releasing and versioning shared components, and tracking dependencies between them. For example, if you have a shared library that you want others to use, then a Package Manager allows you to publish multiple versions side-by-side, and for consumers of the library to reference the version they depend on. Package Managers can resolve all inter-package dependencies, and retrieve only the versions that are expected. In effect, Package Managers solve the "DLL Hell" problem.
They are best used during development, to resolve library dependencies. However some Package Manager, like Chocolatey for Windows or apt-get for Ubuntu, are geared towards installing complete software.
Most importantly, Package Managers are designed around the versioning concept . So they are a perfect mechanism for distributing versioned software libraries.
For we have NuGet. A lot of open-source libraries have been published to its online repository, and it is now the defacto standard for distributing 3rd party components. It is encouraged that every team sets up their own NuGet repository to share and publish internally developed libraries in a versioned manner.
NuGet can even be used to release complete software systems - see next section.
Other development environments have their own - npm for Node. js, pip for Python, gems for Ruby, apt-get on Linux. Package Managers have been proven to be extremely useful, and have exploded in popularity.
Octopus Deploy.
Best Suited : Internally Developed & Deployed Software.
Octopus uses NuGet as the packaging and versioning shell. It is similar to an installer, only driven by PowerShell, meaning infinite flexibility in how the software is to be deployed. PowerShell already has a great support for configuring Windows Services, IIS Web Applications, Scheduled Tasks, SQL Server, and more.
For internally developed and distributed software (i. e. for a company running home-grown software solutions) this is a perfect release management vehicle. Packages are versioned and pushed to a shared NuGet feed (e. g. a network share), from where Octopus Deploy can release and deploy each package into the appropriate environment.
NuGet here plays a role of the application package/container, with a version stamped on it. Package can be built once, and then deployed as many times as needed to whatever environment.
Versioning & Packaging Databases.
Database versioning is one of the biggest challenges in software projects. Almost every team I encountered, either completely ignored it or had something inadequate in place. It certainly presents a challenge - database systems mix schema definition with actual live data , and there is no single "file" that can be effectively versioned.
We have to recognize the database as an integral part of the software system. One that executes on a proprietary 3rd-party platform (SQL Server, Oracle, PostgreSQL, etc), but the source of which is part of the software definition. It can be compared to script-based systems, such as Node. js or Python, only the scripts are written in a SQL dialect.
There are essentially three popular approaches to database versioning, that support automated deployments (I am not considering manual approaches, because they are error-prone, and have nothing to do with real versioning!).
DB - Migrations.
"Migrations" is a concept where developers keep a set of organized SQL script files, numbered sequentially, where each script applies modifications to the target DB to bring it to the expected state. Whenever a change is needed to the application database, a developer creates a new migration script that applies the delta changes.
All of the scripts are kept as part of the source control, and are packaged with the application (either embedded into the executable binary, or installed along-side). A migrations library then checks the target database for a dedicated table which holds the last "migration script number" applied, and then runs all the scripts with a number greater than that in order, effectively applying all of the changes in turn.
While this approach is simple to implement, and is favored among several popular frameworks (Ruby Rails, Entity Framework), it has a number of significant short-comings . Firstly, there is no single source view of all database objects (i. e. tables, stored procedures, etc), they are sprinkled through the multiple migration scripts. It is not clear which of the scripts contains which of the modifications. One has to "replay" them all to generate a database, and then look directly in the database (rather than source code).
Secondly, the migration scripts number becomes the "version" of the database, which is different from the software package version number for the rest of the application. This is somewhat confusing. In addition, this "version" does not really identify the state of the database, since a database can be changed outside an application without updating the "version". This may potentially break future installs, because migration scripts expect the database to be in a certain state to work.
Thirdly, developers have to be disciplined enough to follow the structure and apply ALL changes through migration scripts . Furthermore, when developing and debugging locally, one often has to go through several iterations before getting that table or store procedure change right. Yet only the final changes should make it into the migration script , meaning they have to be remembered and written manually. Otherwise, migration scripts would contain all of the intermediate changes made by all developers on the project. It is easy to see how that can grow out of proportion quickly.
Finally, there is an argument that migration scripts are a "history of changes", and it is a bit of a redundancy to store them in source control, which already is a "history" of code changes. We would be storing a history of a history . There's something philosophical about that.
Supported by some frameworks and libraries (Rails, DbUp, RoundHousE, EF Code First) Can work with any database Potentially high degree of control over SQL scripts.
Have to manually maintain all migration scripts Tracking changes through source control is difficult Not robust against target database out-of-band changes.
DB - SQL Compare.
Most often this is used in a manual approach, comparing a database between two environments (e. g. development vs test) to copy over the changes. We are considering an automated approach, suitable for the packaging and versioning strategies being discussed.
In source control, database is represent by a series of creation scripts (e. g. to create tables, stored procedures, triggers, etc), such that a new database with the right schema can be created from scratch. Usually each script file logically represents a corresponding object in the database, e. g. Table1.sql would be the create script for Table1 table. All of the scripts are included in the released package (sometimes even combined into a large single create script, by concatenating them).
The idea is that during automated package deployment a temporary fresh database copy is created, by running all of the creation scripts , and then a SQL Compare tool is executed to compare the pristine copy with the target database to generate a migration delta script on the fly.
The advantage of this approach is that it is robust against the target database out-of-band changes, since delta script is generated during deployment , rather than during development. SQL Compare tools (such a RedGate's SQLCompare or XSQL Compare) are sophisticated and mature enough tools that we can have some confidence in the generate SQL code. Each can be controlled by a multitude of options to fine-tune behavior with respect to renames, reordering columns, avoiding drops, etc.
In this case, target database is considered as a runtime environment , and we avoid having the issue of versioning it . Instead we version the package that contains all of the creation scripts , which is much easier, and use it to synchronize target database with what's expected in each version.
The big disadvantage of this approach is the difficulty of getting it right - there is no off-the-shelf framework that would support it, and it has to be developed. For SQL Server, read the next section for a better approach. For others, some day I may put together the set of scripts and logic necessary to achieve this, based on some of my prior work (unless someone else beats me to it).
Automatically detect and migrate changes, regardless of target DB state Only maintaining DDL (i. e. create) scripts in source control, meaning easy change tracking.
More difficult to setup, especially to be automated Having to create a temporary database during each deployment (need " create database " permission)
DB - DACPAC (SQL Server)
For SQL Server there is now a new recommended approach - DACPAC, and it can be produced by Visual Studio 2018 and above, if using the SQL Server database project. Really, this is a slick variation of the "SQL Compare" method above, just that Microsoft has done all the heavy lifting for you!
Essentially, DACPAC is a zip package which contains an XML schema model of what the target database should look like. It is compiled by Visual Studio based on the creation scripts in your project. In fact, it represents that temporary pristine database that we would have had to create manually. Only it is done automatically and the schema represented in an XML format. The real bonus is that a DACPAC can be versioned , i. e. its metadata supports storing a version number.
SQL Server Data Tools can be used to deploy a DACPAC package, which really performs a SQL Compare operation between the in-memory database model loaded from DACPAC and the target database. It does the same thing as SQL Compare, but avoids having to create the extra temporary database copy to do the comparison.
For applications having SQL Server as a back-end, a DACPAC can be included as one of the deployable packages, stamped with appropriate version generated during the build. Starting with SQL Server 2008 R2, database can be registered as a Data-Tier Application, and the latest DAC version is tracked in a system view that can be queried.
Can package the whole DB definition into a single package (or several packages) Can apply the same version to the package as the rest of the software system Same advantages as the SQL Compare method.
SQL Server only Need to treat lookup data in a special way (post-deploy MERGE script)
Build Auto-versioning.
Given the importance of consistent versioning discussed above, it makes sense to implement a strategy for automatically generating and stamping a version number during the software automated build process. We want the version number to be applied to the produced packages, and also applied to all the binaries generated through compilation.
There are several well-known and not so well-known ways of achieving this. We look at pros and cons of each.
Applying Build Number.
There are some who prefer to update the version number manually just before a release. I will argue that this is a bad practice. Firstly, it is easy to forget to do it, if you don't have an automated system for incrementing the version build number. And, if it is easy to forget, it will be forgotten at some point.
Secondly, without automatically updating build number, there will be multiple packages produced from the source code that have the same version number, but different functionality (as more commits are made to the source control). This will be confusing to say the least.
It is better to have a process, like ones described below, where version number build component is automatically updated whenever a non-local build is made.
Multiple Versions for Multiple Components.
If there are multiple software components, where each needs to have its own version number, then it is best to split them each into its own separate build. Don't mix multiple version numbers in the same build, as it unnecessarily increases the complexity, and raises a question about which of the build numbers should be used to label the build itself (in addition to having to tag each source sub-tree separately).
Developer vs Continuous vs Release Builds.
Release build is the one that will potentially be released to public or a particular environment - test, staging, production, etc. That's the build that needs to be consistently versioned to keep track of changes that are included and to link back to the source code at the time of compilation.
Note that the Release build can scheduled - it is popular to have a Daily or Nightly build. In most situations it should be the Release build, i. e. it should be versioned and packaged ready to be released.
Continuous Integration builds run whenever someone commits to the repository and are used to validate that the code compiles, and passes unit tests. There is no need to version this build, as it is not intended to be released.
Developers must also be able to do a Developer build , whether it is to test/fix the build process itself, or to generate shared software components to be used in development. Such builds are intended to be run locally only and should never be publicly released.
You can default the build part of the version number to "0". This will identify Developer builds, i. e. ones that are not supposed to be released. For Release builds pass the build number to your build scripts as a property. Have MSBuild stamp a version number on all generated assemblies and packages.
Tagging Source Control.
Since one of the primary reasons for having a version number is to be able to link back to source code used to build the software (see beginning of the article), it is important to create tags/labels in source control that identify the state of source code at the time that version was built.
Various systems call it differently - TFS has "Labels", Git has "tags". Tag should include the full version (including the build number) of the build, so that it can later be found, if needed.
Build Number - Version File Auto Increment.
Common technique is to record version number together with source code, usually in a separate file (e. g. "version. txt"). The build process then finds the file, reads the version, increments the build number portion, and commits the file back to repository.
If the commit message also includes the version number, e. g "Auto-increment: 1.3.156.0" , then it comes in handy when viewing commit history. You can see the changes that occurred between versions clearly by seeing the commits between the two "Auto-increment: . " messages.
This works fairly well, but has a few drawbacks. Mainly due to the fact that "version" becomes part of the source code. When merging changes between say release branch and main, you have to resort to "cherry-picking" (i. e. selecting just the code changesets) to avoid merging the modified version number. That requires being always careful, because you can accidentally change the versioning sequence of another branch just by merging the "version file" into it.
Control over the build number sequence (i. e. sequential) Can make it easy to see changes between versions in source control history.
Difficult to control merging between code branches in source control.
Build Number - External.
Overcoming the drawbacks of the auto increment approach, it is possible to track the build number outside of the source tree. Build server software such as CruiseControl or TFS Builds can do that - they track a build number internally for each "project" and are able to pass it as a parameter to MSBuild.
Version file is still used, but it records major and minor versions only, and doesn't have to change between each build. This makes it easier to merge changes from release branches back to main and others, since they will contain only code changes, without being intermingled with version increments. Major/minor version changes would occur early in the development cycle, when starting work on the next update, and are already set by the time release branch is created.
Not modifying source tree on every build makes merging between branches easier Versioned builds are forced to be built by a dedicated build server.
Relies on a build system that can supply a build number (e. g. CruiseControl, TFS Builds) Changing build number sequence can be difficult (e. g. TFS Builds)
Build Number - Derived from Date/Time.
A popular alternative is to derive build number for the date/time of the build. The advantage being that it carries more meaning (useful in diagnosis), and each build inherently should get a different build number (with later builds getting a higher number).
The trick, of course, is fitting all this into a 16-bit number, if using the standard 4-part Windows version number. While some solve it by using both, the build and revision components, I cannot recommend it, because revision cannot always be applied to external packages (like Windows Installer, or NuGet), which use only a 3-part version number.
This only allows only 4 unique builds per day, which is not a lot, unless all you want is a daily build .
Not depending on keeping track of the last build number Build number can be given more meaning, if it derives from a date.
Build number is not sequential (but it increases nevertheless) Limited to 16-bit (maximum 65535), so some overflow into revision (4th) number.
Build Number - Derived from Source Control.
A variation of the previous technique is to derive build number from a unique property in source control. With a centralized SCM like Subversion or TFS, a revision or changeset number is an ever increasing number that is tied directly to the source code. The big problem with it is that it can quickly overflow the 16-bit limit, meaning you may have to accept build numbers looping back to zero.
An alternative in distributed SCM, like Git, is to use the size of the commit history log as the build number. This will monotonously increase for any single branch, as new commits are made. It too can overflow the 16-bit limit, but goes a lot further than the global revision number.
Example: git rev-list HEAD --count.
Not depending on keeping track of the last build number No possibility of "forgetting" to update version file, or accidentally merge it to/from another branch.
Commit history size will grow beyond 65,535 at some point, overflowing the 16-bit build number.
Parallel Branches.
It's no secret that developing for multiple versions requires multiple branches in source control, each representing a "version" stream for the software. They can be roughly divided into:
Development branches - where unstable code for the next version lives, and where developers commit daily work Feature branches - veering off from development branches, encorporating larger feature development, that would otherwise disrupt other team members Release branches - representing versions of released software, or a release undergoing stabilization.
Each release branch needs to have an identifying version, and is usually named after it, e. g. "1.7" . A decision of whether to create a new release branch depends on how long it is expected that it will be in stabilization mode before releasing, and whether concurrent live versions are permitted (i. e. for packaged software). If you need to be able to maintain & hotfix the current released version, while a new version is being tested & stabilized, then create a new branch.
Development and feature branches need to have a version number that is above any of the existing release branches to avoid confusion. For example, if a 1.7 release branch is created, for the upcoming 1.7 release, then immediately update development branch version sequence to 1.8 .
Versioning feature branches is more difficult, since you don't want to start a new versioning sequence for every feature . Nothing should be "released" from feature branches, so this version is for internal purposes only. If using Semantic Versioning, attach a prerelease tag to clearly indicate this is a version for a feature branch, e. g. 1.8.781-dev-feature-x .
In any case, you wouldn't deploy anything built from a feature branch to the shared testing or production environment, or release a package from it. So it is acceptable to have version sequence overlap with that of development branch.
Finally, in the next section we look at how to version patches & hotfixes that are applied to release branches.
Handling Patches / Hotfixes.
Devising a system to handle patches depends heavily on the rest of the software development cycle, which is what many teams forget when searching for the "one, true way" of handling concurrent patching of the released/production software in parallel with working on the new version.
For example, having a short QA/test cycle, where most of the tests are automated, results in a more simplified and robust system, which does not have to deal with multiple parallel hotfixes "in test".
Overlapping hotfixes.
One difficulty that comes with managing parallel development is consistent versioning and deployment strategy that would overcome inherent conflicts. Consider following scenario: you have recently released a software package 1.5.167. Two urgent show-stopping issues have slipped past your QA process and now require a quick fix. You assign two developers to work on each one in parallel. How would they commit their fixes to minimize conflicts? How do you test each fix? How do you release one independent of the other?
This is a good example of the complexity of software release processes that can be encountered in real-world teams. It applies both to internal software and packaged software, but distribution of the hotfix might be slightly different for each one.
First, let's consider what happens if we remove concurrency . In the case where the two issues are worked one after the other , the solution becomes simple. The first fix gets committed into the maintenance/hotfix branch for 1.5 release stream, a new build is generated, with an incremented build number. Build goes through a quick QA cycle to make sure there is no regression, and then it is ready to be deployed. Same process repeats for the second fix.
The problem with concurrent approach is the time when development is in parallel, creating the entangled case where there is no build/package that contains only one of the fixes , i. e. independent of the other. This problem is magnified by a slow QA cycle , usually meaning there are no automated tests. While one fix is in test, if a commit for a second fix is made to the same branch, and a problem is discovered with the first one, it becomes very difficult to separate the two now.
The culprit here is, of course, the concept of a partial fix - the state where the fix is not complete. It has been committed, but has a problem with it, requiring further commits . This can easily create the case of a hotfix branch where the two fixes are "entangled" (quantum physics on the code level!).
Solution is to remove possibility of a partial hotfix .
This means that each hotfix has to be coded and tested in a separate code stream, independent of the other. Once tested, and ready for release, it is merged into the main hotfix release branch, where the automated build can create a new package and apply versioning (i. e. increment build number, for example, to 1.5.168).
Second hotfix, once tested, also has to be merged into the main hotfix release branch. But, because during the work on this second hotfix, the first hotfix got released, we first merge the first hotfix into the second hotfix's branch ! This ensures that we can test how the second hotfix operates, when applied on top of the first hotfix, and merge any code conflicts, if any.
In the end, you want a system with both hotfixes applied - that is the "next" version. So it makes sense that whatever hotfix is "second", it is applied on top of the "first" one. And creating a packaged release from the single hotfix release branch ensures that the version number is consistently incremented for the whole system.
Of course, above means that we must create a separate branch for each hotfix. Some version control systems, namely Git, make this very easy and part of the expected developer workflow. If you are using a version control system like TFS, then creating new branches for each hotfix is a bit more painful. In TFS, I suggest using named Shelvesets feature to emulate Git's process, and perform initial QA tests for a hotfix from a Shelveset-branch build. Then commit Shelveset into the hotfix branch to build the official hotfix package (and perform necessary merging).
What about the versioning of the interim hotfix builds ? The main hotfix release branch would have a standard versioning scheme applied (as discussed above), either incrementing a build number, or using a timestamp. Each new hotfix, applied on top of all previous hotfixes, gets an increased build number , and the software version keeps moving forward.
However, when building from the developer hotfix branch (or Shelveset in TFS), we also need to apply a version to distinguish it from other builds, and be able to deploy it into QA/test environment. We want to be able to test each hotfix in isolation, applied on top of an existing released version of the software system. This becomes problematic, if you have a single test environment .
You do not want to apply both hotfixes into one test environment, because there is no guarantee that they won't conflict or affect each other. If you are able to quickly spin up a test environment for a hotfix development branch, then you can truly parallelize team efforts. For a shared test environment, they have to be applied one at a time :
Force install latest release version (e. g. 1.5.168) to bring environment to a known state Install the hotfix version to be tested Perform the tests (preferably automated) For shared test environnments this is the bottleneck, since no other hotfixes can be tested at the same time (automation can help minimize the time spent in this step) Repeat 1-3, until tests are satisfactory.
What this means is that each hotfix has to have its build version number greater than the latest released version, the one it is being applied on top of. There are several ways to achieve that. If using a derived build number , this should just work out of the box. If incrementing or using external build numbers, then the easiest option is to simply force the build for hotfix development branch (or Shelveset) to use a number greater than latest released version (i. e. .168).
With Semantic Versioning, we can setup hotfix builds to use a "prerelease" tag that clearly marks it as a hotfix-test build. For example - 1.5.169-check14761 , where the trailing number could be a reference to the issue tracking system. This works especially well when using NuGet as the packaging mechanism.
Once tested, the changes can be merged into hotfix release branch, and an official build generated, with incremented build version number.
NOTE: Above process to resolve concurrent hotfixes is undoubtedly complicated. It is intended to solve a particular real-world scenario, but one that does not happen too often. If there are no concurrent fixes expected, you can simplify your life by applying fixes directly to the hotfix release branch.
Patching a large system.
If applying hotfixes to a large system, we don't want to upgrade the whole thing, which may involve a lot of different components - services, GUI applications, scheduled jobs, databases, etc. Instead, we want to apply the fix only to affected parts.
This is where splitting the system into multiple packages helps. Each corresponds to a logically contained piece of the system - for example, each service, application, database, etc is its own package. That means they can be patched independently by applying just that package .
Care must be taken about dependencies, if hotfix affects multiple packages at once. Although, in that case, ask yourself is it really a hotfix or a new minor version?
Patching for specific installation.
Some software shops may have developed the practice of patching the software for individual customers (for packaged software), in other words creating a "custom" version for just that installation, without including this fix in the rest of released software streams. This is one of the worst situations to be in, with regards to versioning, since it creates a large number of variations that have to be maintained separately.
Instead, release a general update , moving the overall software version forward for that release stream. Adopt a "feature" system , where parts of the software can be turned on & off based on configuration. If a specific fix is needed for a particular installation, then that code can be encapsulated behind a configuration switch which turns this section of the code on or off. That particular customer can turn it on , while the rest can have it off!
This is also a popular technique in web applications, of which only one installation exists (on the server), where various "features" can be enabled based on "configuration" for each user , or a set of users.
Patching the changes only.
There is often the temptation to simply patch in the changes to the live/production system by editing/replacing one file, or updating one table or stored procedure. The change is small, and it seems like the fastest way to solve the imminent issue, without changing anything else in the system.
While it seems like a smaller risk to make only the necessary updates directly, it makes it a whole lot harder to know the state of the system in the future. As more and more such "small" patches get applied, there is no longer any reliable way to link the running system back to the original source code, making further maintenance exponentially more complicated (and, ironically, increasing the risk).
Updating individual non-binary (e. g. config files) or altering database objects does not update any version number . That means it is difficult to tell which changes have been made to the system, leading to "maintenance hell" (a variation of the infamous "DLL Hell").
Rule of thumb: Any change to the system should change the version number.
NOTE : Windows Installer allows a so called "small update", where product version number does not have to change, used for small hotfix patches. I believe this creates too much confusion, and so I do not recommend it. Windows Installer does track each patch, through package code, so you always know which patches have been applied. But it means now having to track and remove patches on subsequent product updates, which complicates the process. It may work for Microsoft Windows and Microsoft Office, but I wouldn't recommend using it for any system.
الكلمات الأخيرة.
This turned out to be a much longer article than I originally anticipated when I sat down to write about versioning . I am hoping it proves useful for software engineers out there looking for some guidance on how to apply these concepts in their own projects.
Still this seems like only a partial treatment of the topic.
Everything I wrote above has been learned through the painful process of trial & error over the years. If just a few readers have an "aha!" moment while reading this, then I have achieved my goal!

Software Versioning Without Thinking About It.
Learn some tips for using the open source tool GitVersion for automatic semantic versioning schemes.
الانضمام إلى مجتمع دزون والحصول على تجربة عضو كامل.
Download the blueprint that can take a company of any maturity level all the way up to enterprise-scale continuous delivery using a combination of Automic Release Automation, Automic’s 20+ years of business automation experience, and the proven tools and practices the company is already leveraging.
If you're building libraries, products or any other software system, versioning is usually a pretty big deal. It's the only way to determine what version of that library, product or system you're looking at. Before an organization settles on a versioning strategy, many discussions have been held on what constitutes a major release versus a minor release, how to version the component from a marketing perspective, and how to deal with bug fixes. In addition to that, if that software system involves a library or framework, or just component, then you'd be pretty interested to know when an update to that component involves breaking changes.
Fortunately, the open-source community has solved both of these problems for us. First, we have semantic versioning, which unambiguously defines how to update your version when you do hot fixes and patches, minor back-wards compatible improvements or breaking changes. They even define how you should post-fix your version numbers to denote pre-releases and build numbers. Assuming all decent software project are using Git these days, then the other problem is solved by following the GitFlow branching strategy, an initiative by fellow countryman Vincent Driessen. GitFlow describes in detail on what branch you do your main development work, how you stabilize an upcoming release and how you track production releases.
So I'll assume for a minute you are going to embrace the semantic versioning scheme as well as follow the branching strategy prescribed by GitFlow. Wouldn't it be cool if some kind of tool existed that used the names of the branches and the tags on master (representing the production releases) to generate the proper version numbers for you? Well, once again, the open-source community comes to the rescue. Jake Ginnivan and the guys from ParticularLabs, the company behind NServiceBus, have build just that and named it GitVersion. So let's see how that works.
Showing Off the Beauty of Automatic Versioning.
First, we need to install GitVersion, which is pretty easy through Chocolatey.
This allows you to run it from the command-line. You can also hook it into your build system by copying the single executable into source control or adding it as a NuGet package. It will detect build engines like TeamCity and AppVeyor and adopt its output. Now let's assume you have a new Git project with a first commit on the master branch:
Now run the GitVersion command-line tool.
This will result in the following JSON output:
So, by default your version numbering starts with 0.1.0. Notice the many variables targeted to specific uses. For instance, we store the InformationalVersion that includes the hash of the commit in the AssemblyInformationalVersion attribute of the assembly. Similarly, we use the NuGetVersion for our NuGet packages. Finally, our build numbers are mapped to the FullSemVer variable. That last part is pretty important, because traditional build numbers don't say much about the actual changes. With Git versioning, rebuilding a particular commit renders the exact same number. This creates a whole lot more tracability.
Let's follow Gitflow and continue development on the develop branch and run GitVersion.
Ignoring the remainder of the variables for now, this is the result:
You'll notice two things. First, the minor version number is automatically updated. Second, the version number is post-fixed to make it pretty clear your working a development branch. Now let's add a couple of commits and see what happens.
This will result in the last digit representing the number of commits since we branched of from master.
So let's work on a little feature through a feature branch.
Running Gitversion again will give you:
And again it's crystal clear what version you're working on. To simulate working on some feature, I'll assume a couple of more commits without repeating myself here. Running GitVersion after those changes results in:
Now it's time to integrate those changes back into the develop branch.
So, whatever you do, the version is always in sync with the changes without any manual tasks.
Now suppose principal development has completed and it's time to stabilize the code base. Let's make that explicit by starting a release branch.
So it seems release branches are not for shipping release versions. Instead, they are used to ship beta versions of your system. Again, the +0 is used to denote the number of commits since the last time you shipped a beta package. Consequently, if you do ship such a package, you're supposed to tag that commit with something like 1.0.0-beta.1. When you do, and you add any additional commits to that branch, the following happens.
As long as you're stabalizing a system or shipping intermediate versions for acceptance testing or similar situations, stay on the release branch. By doing so, you can support both the upcoming version as well as the current production version. Now, when you're ready to go into production it's time to merge to master.
What's important to remember is that you should tag the commit you ship, so in this case we're going to tag the merge result with the final release number. Let's see what GitVersion will do with that.
This marks the end of the development cycle. Any hot-fixes should end up on master as well, and will have their last digit incremented, e. g. 1.0.1, 1.0.2. Any successive development should continue on develop again, so as a last step, let's switch back to that branch and see what happens.
Nice isn't it? GitVersion understands the concept of that tag on master and will assume you'll continue with the next minor version on the develop branch. If you really want to continue with a different version, there are ways to make that happen. And I've been just showing you the most common flow. I highly recommend checking out the examples in theGitVersion wiki.
باختصار.
In short, you just need to remember a couple of things:
Development happens on the develop branch Stabilizing upcoming releases and shipping beta packages happens from release - branches The master branch tracks production releases and hot-fixes. Anytime you ship something, you must tag that commit. No need for tracking releases anywhere else.
So what happens if you don't have regular releases and your project needs to deliver continuously? Well, the guys at Github had the same questions and came up with an alternative to GitFlow called GitHubFlow. Fortunately, GitVersion supports this flow out-of-box as well.
So what branching strategy do you use? And how do you track your releases? Let me know by commenting below or tweeting me at @ddoomen.
Download the ‘Practical Blueprint to Continuous Delivery’ to learn how Automic Release Automation can help you begin or continue your company’s digital transformation.
مثل هذه المادة؟ اقرأ المزيد من دزون.
مجانا دزون ريفكارد.
DevOps for Database.
Published at DZone with permission of Dennis Doomen , DZone MVB . See the original article here.
الآراء التي أعرب عنها المساهمين دزون هي الخاصة بهم.

Comments

Popular posts from this blog

تداول الخيارات على بس

تد حساب خيارات التداول

خيارات بيع الأسهم قصيرة