Git Flow 02 – Release

Lanjutan dari:
Git Flow 01 – Intro

Sebelum rilis, kita bikin dulu release-branch dari develop, pake perintah:

git flow release start (nama rilis/versi)

Contohnya begini:

$ git flow release start v1.0
Switched to a new branch 'release/v1.0'

Summary of actions:
- A new branch 'release/v1.0' was created, based on 'develop'
- You are now on branch 'release/v1.0'

Follow-up actions:
- Bump the version number now!
- Start committing last-minute fixes in preparing your release
- When done, run:

     git flow release finish 'v1.0'

Di branch release/v1.0 ini kita jalanin proses-proses yg perlu buat rilis, misalnya:

  • jalanin build task untuk minifikasi CSS, JS, & optimasi gambar
  • Update config file
  • dan lain-lain

Kita juga bisa mendadak nambahin fitur-fitur baru ke dalam release-branch dengan syarat fitur-fitur itu bisa di-merge tanpa masalah ke master & develop.

Release-branch ini bisa di-upload/deploy ke staging-server buat QA sebelum branch ditutup (finish). Jadi nggak perlu ngotorin master dgn bug fix dll.

Kalo QA udah selesai & rilis udah di-approve, tutup dengan perintah:

git flow release finish (nama rilis/versi)

Contohnya,

$ git flow release finish 'v1.0'
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
Merge made by the 'recursive' strategy.
 .gitignore    |  2 ++
 css/style.css |  0
 index.html    | 12 ++++++++++++
 3 files changed, 14 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 css/style.css
 create mode 100644 index.html
Already on 'master'
Your branch is ahead of 'origin/master' by 4 commits.
  (use "git push" to publish your local commits)
Switched to branch 'develop'
Your branch is up-to-date with 'origin/develop'.
Already up-to-date!
Merge made by the 'recursive' strategy.
Deleted branch release/v1.0 (was 50b10f7).

Summary of actions:
- Release branch 'release/v1.0' has been merged into 'master'
- The release was tagged 'v1.0'
- Release tag 'v1.0' has been back-merged into 'develop'
- Release branch 'release/v1.0' has been locally deleted
- You are now on branch 'develop'

Kita liat dalam bagian Summary di terminal apa aja yang dikerjain sama Git Flow:
1. Merge release/v1.0 ke master & kasih tag
2. Merge tag ke develop
3. Hapus release/v1.0

Sekarang master atau tepatnya, tag v1.0 siap di-upload/deploy. Ee tapi sebelumnya, update dulu origin/master.

git push origin master --tags

Repo jadi begini:

repo

Silakan lanjut ke Bagian 3 tentang Hotfix.

Also in this category ...


Leave a Reply

Your email address will not be published. Required fields are marked *