Sign inSign up

pk13055/jenkins-test

By pk13055

•Updated almost 7 years ago

Jenkins integration with BitBucket + docker + remoteSSH

Image
0

637

pk13055/jenkins-test repository overview

⁠Testing Jenkins

⁠Introduction

The goal here is this to be a basic representation of a project that can be deployed to the server automatically on merge requests.

⁠Pipeline

  • Code is pushed into feature-branches and tested locally
  • When deployable, this code is merged into the production (ie, master) branch and then jenkins is automatically triggered to "build" this repo:
    • jenkins detects the change (ie new commit in production and starts the pipeline)
    • docker build happens and pushed to a registry
    • docker pull is executed on the production server after which the app/celery is restarted.

⁠Procedure

⁠Bitbucket Webhooks

The first step is to create a webhook on bitbucket and point it to your jenkins installation $JENKINS_URL/some-hook-name/. At this point, (since we want trigger on pull request merged) this explanation is pushed through another branch which will be merged into master.

Pushing directly to master triggers the webhook when the webhook param is set to repository push instead of specific triggers.

The exclude-other-branches branch verifies that when pushing to branches other than master, a build is not triggered. Thus, merging a PR into master -> commiting a change => build would be triggered.

⁠Docker

Pushing to a docker repository can automatically be triggered (on commit to BitBucket) given a user account on docker hub. This commit will highlight that.

Tag summary

Content type

Image

Digest

Size

2.7 MB

Last updated

almost 7 years ago

docker pull pk13055/jenkins-test