Skip to content

Instantly share code, notes, and snippets.

@christiangalsterer
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christiangalsterer/5d84c5b7d0c1167167fe to your computer and use it in GitHub Desktop.
Save christiangalsterer/5d84c5b7d0c1167167fe to your computer and use it in GitHub Desktop.
#!/bin/sh
# Copyright 2015 Christian Galsterer
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Dispatcher script to trigger Jenkins jobs using the Jenkins Git Plugin (https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin) notify commit feature together with Atlassian Stash using the Pull Request Notifier for Stash add-on (https://marketplace.atlassian.com/plugins/se.bjurr.prnfs.pull-request-notifier-for-stash).
# https://gist.github.com/christiangalsterer/5d84c5b7d0c1167167fe
# Modify to point to your stash instance
STASH_SSH_URL_PREFIX='ssh://git@stash'
curl -k "$JENKINS_URL/git/notifyCommit?url=$STASH_SSH_URL_PREFIX/$PULL_REQUEST_TO_REPO_PROJECT_KEY/$PULL_REQUEST_TO_REPO_NAME&branches=$PULL_REQUEST_TO_BRANCH&sha1=$PULL_REQUEST_FROM_HASH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment