GitHub - Weapon of Choice
How to get your Continous Integration/Continous Deploy/Bugtracking/New Feature Integration all in one place?
Well, this is my long time thought. I've been trough several Tools (Jira, Bitbucket, GitLab, SVN, Leantime, and so on). Every Combination has some gaps, Jira is huge and can talk to GitHub, Bitbucket and others, but it is not one in all. So I decided why not give GitHub a chance. GitHub was already my choice of versioning, and all the jira stuff I need, was also there.
So here is where I´ve ended up so far:
Versioning/Code Base
We are developing different stuff, but the main application, running in production is java based. Maven for package managing. Everything what GitHub also provides. Feature/Issue Branches can be directly created, push and sync is integrated into IntelliJ. So this is a "no brainer" so far.
Merge and Compare also comes out of the box in IntelliJ and it is really good, when it comes to merge conflicts.
Issue Tracking
Here comes the first one I really liked, every issue can be reference by #ISSUE_NUM, this integration is also in jira (depending on projects). This concept is also in GitHub, you can spread your issues over projects and reference them in each commit.
New Features via Kanban
All issues can be assigned to projects, these projects can be organized in views how you like. My preferred view, is the kanban view. Here I can track the progress of each issue in different states in different projects (these projects are customers), all referring the same repo. So I can manage changes for each customer on the same repo in different customer projects and have all there issues right to my hand when needed.
Projects (beta)
A project is a customizable spreadsheet that integrates with your issues and pull requests on GitHub. You can customize the layout by filtering, sorting, and grouping your issues and PRs. You can also add custom fields to track metadata. Projects are flexible so that your team can work in the way that is best for them.
further information: GitHub Doc
Continous Integration
Continous Integration helps you out, when your repo is bundled with some test case (i. e. unit-tests). Therefore it is very easy to set-up your repo via GitHub Actions.
Go to your repos actions and create a new workflow. Depending on your repo/language this may differ, I have chosen "Java with Maven" which includes the Build and test of your java repo.
Every push now results in a new workflow run of your defined CI-Workflow. Errors or other failures will be reported to you. The actual build status can also be included as a badge to your repo.
Continous Deploy
Continous Deploy now starts when the build of your repo runs without failures. It can be set-up as for each push or react as a hook on special commit messages like "release....".
The Deploy Workflow for me, works as a release of the actual binary "maven packed jar" to the releases of my repo. I have chosen a prebuilt script for this, described here eric2788.
You will have to add a GitHub token to let the build process access your repo releases (described in eric2788´s release).
This results for me in this workflow script:
The script checks out your repo and builds it in the virtual linux appliance (via Maven). The resulting jar will be released to the releases section of your repo.
How to get the release to your Production System?
The deploy to your production can also be triggered via GitHub Workflow, but this did not work for me. My production System is not hosted via azure and therefore needs a seperate download logic for deployment. Here comes "curl" in, which enables you to download the latest release from your releases and copy the compiled jar to your preferred destination.
Following Curl commands worked for my set-up:
1. curl -H "Authorization: token YOURGITHUBTOKENHERE" https://api.github.com/repos/YOUR-USERNAME/YOUR-REPO/releases/latest -o test.json
2. Query the resulting JSON to identify the ID of your released jar -> jq ".assets|.[]|.url" test.json > output.txt
3. read the url from the output.txt (depending on your os, scripting base)
4. curl -H "Authorization: token YOURGITHUBTOKENHERE" -H "Accept:application/octet-stream" URL_FROM_YOUR_OUTPUT -o MY-DEPLOYMENT.jar
5. copy/move the jar to your deployment location
in my case, I have set-up the download for a windows based system. I could get curl and jq binaries for windows and pack all together with a small vb-script file.
That's it.
Geschrieben am 2022-03-15 10:49:29