Skip to content

Trigger Jenkins build by merging to master event. AWS Lambda-based WebHook helper for helpless CI.

Notifications You must be signed in to change notification settings

pedrodparkes/JenkinsMergedPRBuilder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jenkins-Github-Merge-2-Matser

Use this helper function if you need to trigger Jenkins multibranch build when changes successfully mered to master.

  1. Generate Jenkins User's Token:
	Click your name on the top right corner on every page, then click "Configure" 
	to see your API token
  1. Set necessary values in serverless.yml file:
	environment:
      TRIGGER_BRANCHES: master,stage,etc,comma,separated
      REGION: ${self:custom.region}
      URL_DEFAULT_TTL: ${self:custom.url_default_ttl}
      JENKINS_USER: <username>
      JENKINS_USER_TOKEN: <token>
      JENKINS_URL: https://<jenkins_url>
      JENKINS_PIPELINE_NAME: <multibranch_pipeline_name>
  1. Install Serverless Framework:
	npm install serverless --global
	serverless plugin install --name serverless-python-requirements
  1. Configure aws cli (use your preferred method):
	aws configure --profile dev
	export AWS_PROFILE=dev;
  1. Deploy an app: serverless deploy

  2. Grab endpoint URL:

	serverless info
	 # endpoints:
	 # POST - https://4-20-time.execute-api.us-west-2.amazonaws.com/dev/trigger
  1. Go to GitHub repository settings and create a Webhook:
	Payload URL 	= <lambda url>
	Content type 	= application/json
	Let me select individual events: 
		Pull requests;
		Pushes;
  1. Check the setup (tail Lambda logs):
	serverless logs --function trigger --tail

About

Trigger Jenkins build by merging to master event. AWS Lambda-based WebHook helper for helpless CI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published