Updates from May, 2022 Toggle Comment Threads | Keyboard Shortcuts
-
Wang
-
Wang
CodeQL
Discover vulnerabilities across a codebase with CodeQL, our industry-leading semantic code analysis engine. CodeQL lets you query code as though it were data. Write a query to find all variants of a vulnerability, eradicating it forever. Then share your query to help others do the same.
CodeQL is free for research and open source. -
Wang
GitHub Copilot
Your AI pair programmer
With GitHub Copilot, get suggestions for whole lines or entire functions right inside your editor.
https://copilot.github.com/ -
Wang
-
Wang
-
Wang
-
Wang
Compile consul source code and generate executable scripts
Recently I have some special requirements which ask to compile consul source code and generate executable scripts, below are the general steps:
1. Make sure you have installed docker, go, nodejs
xxx@xxx consul $ docker version && node --version && go version Client: Docker Engine - Community Version: 18.09.2 API version: 1.39 Go version: go1.10.8 Git commit: 6247962 Built: Sun Feb 10 04:12:39 2019 OS/Arch: darwin/amd64 Experimental: false Server: Docker Engine - Community Engine: Version: 18.09.2 API version: 1.39 (minimum version 1.12) Go version: go1.10.6 Git commit: 6247962 Built: Sun Feb 10 04:13:06 2019 OS/Arch: linux/amd64 Experimental: false v11.14.0 go version go1.12.4 darwin/amd64
2. Download consul source code
cd $GO_HOME && mkdir -p src/github.com/hashicorp cd src/github.com/hashicorp git clone https://github.com/hashicorp/consul.git cd consul && git checkout v1.4.4 -b <BRANCH_NAME>
3. Modify UI templates under ui-v2/app/templates/
4. Compile & generate executable scripts
export RELEASE_UNSIGNED=1 export ALLOW_DIRTY_GIT=1 sh build-support/scripts/release.sh --tag false --sign false --release <RELEASE_NAME>
5. Test consul
bin/consul agent -datacenter='207' -bind='10.49.32.224' -bootstrap-expect=1 -data-dir="data/" -log-level=INFO -server -uiNOTE:
- generate consul packages locations: bin/consul, pkg/bin, pkg/dist
- reference: https://github.com/hashicorp/consul/blob/master/.github/CONTRIBUTING.md
-
Wang
Jenkins pipeline & kubernetes
We build deployment pipeline by Jenkins, Git, Maven, Docker, JFrog, Kubernetes, Slack, below is overall process:
develop -> create branch -> push code -> git hook -> jenkins build -> code check -> unit test -> docker build -> push docker image -> deploy -> notificationa
For every project we generate pipeline scripts by JHipster like this:

ci contains docker related scripts, cd contains kubernetes related scripts.
We configured Jenkins to scan projects from git automatically which followed naming rule, if any changes on git, Jenkins will pull the code and start building.

-
Wang
Test Gitlab CI
Although there are many CI tools, like Jenkins, Travis CI, Circle CI, but personally I like gitlab ci most..
So I wrote a simple .gitlab-ci.yml, and tested on gitlab, below are the result screenshots.
-
Wang
start writing with gist, https://gist.github.com/hongmengwang








Reply