This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| status=$1 | |
| status=${status:-off} | |
| echo "Will toggle proxy: $status" | |
| IFS=$'\n'; networks=($(networksetup -listallnetworkservices)) | |
| for (( i=1; i<${#networks[@]}; i++ )); do | |
| net=${networks[i]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Return a promise for an object of test values | |
| */ | |
| var Q = require('q'); | |
| var promise1 = getPromiseForValue('someArg1'); | |
| var promise2 = getPromiseForValue('someArg2'); | |
| var promise3 = getPromiseForValue('someArg3'); | |
| return Q.all([ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| run this script to create a environment variable config file in the workspace containing the SHA of the feature branch merge parent. | |
| # put the feature branch parent of the pull request merge sha into a file variable. | |
| echo parentSha=`git rev-list HEAD^2 -n 1` > gitVariables | |
| at the first build step read in the config file in an inject environment variables step | |
| ${WORKSPACE}/gitVariables | |
| In the Stash notify step click Advanced... and set the commit SHA to | |
| $parentSha |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| +refs/pull-requests/*/merge:refs/remotes/origin/stashpr/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Static node server | |
| // package.json fragment | |
| // "devDependencies": { | |
| // "http-server": "", | |
| // "express": "" | |
| // } | |
| var express = require('express'), | |
| http = require('http'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import hudson.model.* | |
| def payloadString = build.buildVariableResolver.resolve("payload") | |
| payloadObject = new groovy.json.JsonSlurper().parseText(payloadString) | |
| targetCommit = payloadObject.pull_request.head.sha | |
| build.addAction(new ParametersAction(new StringParameterValue('targetCommit', targetCommit))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env node | |
| // Grab environment variables | |
| var payloadString = process.env.payload; | |
| // If no payload was received there is nothing to do. Not allowed to use "null". | |
| if (payloadString === "nodata") { // This assume the default payload parameter value is "nodata". Not allowed to use "null". | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env sh | |
| # Parse input | |
| if [ "$#" -gt "0" ] | |
| then | |
| NUMLOOPS=$1 | |
| else | |
| NUMLOOPS=10 | |
| fi |