This note is for anyone who wants to set up the continuous integration environment on Github.
The note includes adding a commit template when you send a PR (Pull Request) and also wants to combine the issue tracking system - YouTrack for their projects which I think should be faster than Jira. Let’s go.
Commit message template
Let’s create a template file called .gitmessage and put it here [~/.gitmessage]. I recommend this template format from Udacity Nanodegree Style Guide, the template would look like this:
1 | type: subject |
The type
keyword which is contained within the title can be one of these types:
- feat: a new feature
- fix: a bug fix
- docs: changes to documentation
- style: formatting, missing semicolons, and other improvements about UI/string content; no code change
- refactor: refactoring production code
- test: adding tests, refactoring test; no production code change
- chore: updating build tasks, package manager configs, and other configurations for project processing; no production code change
Subject, body, and footer are the descriptions for this commit. After creating this .gitmessage file. Open the .gitconfig and add the following code:
1 | [commit] |
When you use git commit,
it would automatically bring the template out, and all you need to do is to fill in the related information for this commit.
Circle CI on Github
You can set up Circle CI on Github from the GitHub Marketplace and install the service. Circle CI provides several plans; for now, I think the free plan is enough to go.
Circle CI Plans
After you integrate with Circle CI, you would get a failed message when trying to build at the first build. That’s because we haven’t had any configurations for Circle CI yet. You would need to create a .circleci.
folder and config.yml
file in the project. Let’s see my configuration file in my mobile project as an example. It’s super easy to understand and config.
1 | version: 1 |
A few hints here:
If you are using Kotlin DSL now, especially using the
build.gradle.kts
. Remember to change all the gradle file names in configuration file to build.gradle.kts:1
jars-{{ checksum "build.gradle.kts" }}-{{ checksum "app/build.gradle.kts" }}
You might encounter the Android SDK license agreement issue, add the following commands:
1
2- run: yes | sdkmanager --licenses || exit 0
- run: yes | sdkmanager --update || exit 0
Issue tracking system by YouTrack
Many developers nowadays are using Jira as an issue/project tracking system in their usual work. Jira lets you plan, track, and manage your agile and software development projects by combining the so-called agile software process or scrum process. You can customize your workflow, collaborate, and release your product.
Although many good points for using Jira, it still has some drawbacks for me to use.
Slow reaction system: I can’t tell if that’s an internal network connection issue, or it’s just so slow.
The system interface is pretty complicated for me.
It’s not free - a critical factor for an independent developer like me. In the very beginning, independent developers might not have enough money to use such an expensive system. So, is there any good alternative to substitute? Yes, YouTrack.
Here’s the introduction for YouTrack from JetBrains. It’s almost the same as Jira, but quicker responding time, and it’s free for less or equals 3 developers.
How do we integrate with Github for tracking PRs? The first step is to establish a connection between your project in YouTrack and a repository in GitHub. To connect with GitHub, you need to generate and store a personal access token. This token grants YouTrack access to the repository based on the access that is granted to your GitHub account.
You can use a single access token to set up multiple integrations. If you don’t have a personal access token, you can use the direct link from YouTrack to generate it during this setup procedure.
Integration with Github on YouTrack
You can read more detail information in here: GitHub Integration - Help | YouTrack Standalone
Once finishing the integration, you can track your commit to YouTrack now.
Happy coding, enjoy.