Build Go with Jenkins from Bitbucket

Bashayr Alabdullah
2 min readJan 1, 2020

--

Push the built binary file to the repository isn’t an efficient way, so we need to make Jenkins handle that. This post shows the simple steps to build Golang using Jenkins from Bitbucket.

Continuous Integration CI

Here simple snippet Golang that only print a statement:

Hello, Build Golang using Jenkins!

Configure Jenkins settings on Your Repo

Webhook to Jenkins for Bitbucket Server

then enable it :)

Install and Configure Go Plugin in Jenkins

Manage Jenkins -> Manage Plugins -> Available -> Go Plugin -> Install

Go Plugin

Manage Jenkins -> Global Tool Configuration -> Add Go

Go Plugin with specific version

then apply -> save :)

Create Job on Jenkins

Freestyle project

then ok :)

don’t forget to add access key to you repo

Source code management
Build Triggers
Build environment

In build, the first command is to download all dependencies before building (Go packages). Second command, to enter the folder (directory) that include the main.go. The final command is to build the Go app.

Build

apply and save your changes.

Now when you create pull request on Bitbucket then merge it to the master, the Jenkins job will detect that then will build the Go app.

I hope you learning from this post!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Bashayr Alabdullah
Bashayr Alabdullah

Written by Bashayr Alabdullah

Salam, I'm Tech Engineer 🚀. I blend technology insights, inspiration, and fun in my feed. #innovation #discovery 🥑🎶🎯🌻 *my personal -own- thoughts*

No responses yet

Write a response