การเริ่มต้นใช้งาน¶
ส่วนประกอบหลัก¶
เมื่อทำงานกับ Odoo.sh สิ่งสำคัญคือต้องเข้าใจส่วนประกอบหลักที่เกี่ยวข้อง:
แม้ว่าทั้งหมดนี้จะเชื่อมโยงกัน แต่แต่ละส่วนก็มีบทบาทที่แตกต่างกันในการพัฒนาและการนำแอปพลิเคชัน Odoo ไปใช้งาน เมื่อรวมกันแล้วจะกลายเป็นไปป์ไลน์ที่เชื่อมโยงกัน ตั้งแต่การพัฒนาโค้ดไปจนถึงการใช้งานจริงทางธุรกิจ
GitHub repository¶
GitHub repository เปรียบเสมือนโฟลเดอร์บนคอมพิวเตอร์ของคุณที่มีไฟล์และโฟลเดอร์ทั้งหมดสำหรับโปรเจกต์หนึ่ง ๆ ความแตกต่างคือมันถูกจัดเก็บไว้บน GitHub และสามารถเข้าถึงและแก้ไขได้โดยผู้คนหลายคนบนคอมพิวเตอร์ที่แตกต่างกัน
กล่าวอีกนัยหนึ่ง GitHub repository คือสถานที่ที่คุณสามารถจัดเก็บไฟล์ของโปรเจกต์และแบ่งปันให้ผู้อื่นได้ เพื่อให้พวกเขาสามารถทำงานร่วมกับคุณ แก้ไข และมีส่วนร่วมในโปรเจกต์ของคุณ นอกจากนี้ยังติดตามการเปลี่ยนแปลงทั้งหมดของโปรเจกต์ตลอดเวลา ทำให้คุณสามารถย้อนกลับไปยังเวอร์ชั่นก่อนหน้าได้อย่างง่ายดายหากจำเป็น
นอกจากนี้ GitHub ยังมีฟีเจอร์มากมายที่ช่วยให้คุณจัดการโปรเจกต์ของคุณได้ เช่น การติดตามปัญหา (issue tracking) คำขอดึงข้อมูล (pull requests) และการตรวจสอบโค้ด (code reviews) เป็นเครื่องมือที่ทรงพลังสำหรับการจัดการและทำงานร่วมกันในโปรเจกต์ซอฟต์แวร์ และถูกใช้งานอย่างแพร่หลายโดยนักพัฒนาทั่วโลก เป็นพื้นที่ที่มีการควบคุมเวอร์ชั่นซึ่งเก็บซอร์สโค้ดของแอปพลิเคชัน Odoo ไว้ โดยจะติดตามการเปลี่ยนแปลงทุกครั้ง รองรับการทำงานร่วมกัน และสามารถเป็นแบบสาธารณะหรือส่วนตัวก็ได้
โปรเจกต์ Odoo.sh¶
โปรเจกต์ Odoo.sh คือ Platform as a Service (PaaS) ที่เชื่อมต่อกับ GitHub และช่วยให้การพัฒนา ทดสอบ และนำแอปพลิเคชัน Odoo ไปใช้งานเป็นไปอย่างราบรื่น โดยมีเครื่องมือต่าง ๆ เช่น การสำรองข้อมูลอัตโนมัติ สภาพแวดล้อมสำหรับทดสอบ (staging) และไปป์ไลน์การรวมโค้ดอย่างต่อเนื่อง (continuous integration)
ฐานข้อมูล Odoo¶
ฐานข้อมูล Odoo จัดเก็บข้อมูลการดำเนินงานทั้งหมดที่แอปพลิเคชัน Odoo ใช้และสร้างขึ้น เช่น ข้อมูลทางธุรกิจ การกำหนดค่าต่าง ๆ และข้อมูลผู้ใช้
ประเภทผู้ใช้¶
Odoo.sh เกี่ยวข้องกับผู้ใช้หลายประเภท โดยแต่ละคนมีบทบาทเฉพาะในวงจรชีวิตของโปรเจกต์:
ผู้ใช้ GitHub: นักพัฒนาที่มีสิทธิ์เข้าถึง GitHub repository ที่เชื่อมโยงกับโปรเจกต์ Odoo.sh การมีสิทธิ์เข้าถึง repository ไม่ได้ทำให้บุคคลนั้นกลายเป็นผู้ทำงานร่วม (collaborator) ในโปรเจกต์ Odoo.sh โดยอัตโนมัติ
ผู้ทำงานร่วมใน Odoo.sh: บุคคลที่จัดการโปรเจกต์ Odoo.sh ผู้ทำงานร่วมแต่ละคนต้องเชื่อมโยงกับผู้ใช้ GitHub อย่างไรก็ตาม ผู้ทำงานร่วมไม่ใช่สิ่งเดียวกันกับผู้ใช้ฐานข้อมูล
ผู้ใช้ฐานข้อมูล: ผู้ใช้งานปลายทางของฐานข้อมูล Odoo ที่นำไปใช้งานจริง พวกเขาโต้ตอบกับระบบที่ใช้งานจริง แต่ไม่ได้มีส่วนเกี่ยวข้องกับการพัฒนาหรือการจัดการโปรเจกต์
Technical concepts¶
When working with Odoo.sh, it is also important to understand several technical concepts:
Forking a repository¶
Forking a repository on GitHub is when you create a copy of someone else's repository on your own account. This allows you to make changes to the repository without affecting the original version.
When you fork a repository, you create your own copy of the repository, complete with all the files and folders in the original repository. You can then make changes to the files in your copy of the repository and commit them, just like you would with any other repository.
The benefit of forking a repository is that you can make changes to the code without affecting the original version, which is useful when you want to experiment with new features or fix bugs in someone else's code. You can also use the forked repository as a starting point for your project, making changes as needed.
Once you have made changes to the forked repository, you can submit a pull request to the original repository owner, asking them to merge your changes back into their repository. This is a common approach for open-source projects to accept contributions from other developers, and it can be a great way to get involved in the community and improve your coding skills.
Pushing a commit¶
When you make changes to a file or multiple files in a Git repository on your local computer, those changes are considered uncommitted. In other words, Git knows that changes have been made, but they haven't been officially saved or recorded yet.
To save those changes and add them to the Git repository, you need to create a commit. A commit is a snapshot of the changes you made to the files at a specific point in time. It records what changes were made, who made them, and when.
Once you've created a commit, you can then push it to a remote repository, such as one hosted on GitHub. Pushing a commit means sending the changes you've made in the commit from your local repository to the remote repository so that others can see and use them.
To summarize, pushing a commit means sending the changes you have made to the files in your Git repository from your local computer to a remote repository. It is a way to share your changes with others and collaborate on a project.
Merging a branch¶
Merging a branch into another is the process of combining the changes made in one branch into the
other. For example, let's say you created a new branch called feature-branch to work on a new
feature for your project. Once you've finished making changes to this branch, you can merge those
changes back into the main branch (often called the master or main branch).
When you merge a branch, Git examines the changes in both branches and attempts to combine them. If there are any conflicts between the changes made in the two branches, Git will prompt you to resolve them before completing the merge (code-wise).