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
function git-branch-name { | |
git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3 | |
} | |
function git-branch-prompt { | |
local branch=`git-branch-name` | |
if [ $branch ]; then printf " [%s]" $branch; fi | |
} | |
PS1="\u@\h \[\033[0;36m\]\W\[\033[0m\]\[\033[0;32m\]\$(git-branch-prompt)\[\033[0m\] \$ " |
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
curl -X POST --data-urlencode \ | |
'payload={ | |
"channel": "#SLACK-CHANNEL", | |
"username": "Bamboo Bot", | |
"text": "New Build Started", | |
"icon_emoji": ":octocat:", | |
"attachments": [ | |
{ | |
"color":"#CFA700", | |
"title": "${bamboo.repository.name} build #${bamboo.buildNumber}", |
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
cd ${bamboo.build.working.directory} | |
if [ -d "test-reports" ] 1> /dev/null 2>&1; then | |
curl -H "Authorization: token <YOUR-GITHUB-TOKEN-HERE>" \ | |
--request POST \ | |
--data \ | |
'{ | |
"state": "success", | |
"context": "Build", | |
"description": "Branch was tested successfully", | |
"target_url": "${bamboo.buildResultsUrl}" |
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
## check for eslint errors. | |
if (grep -c 'severity=\"error\"' test-reports/*.xml 1> /dev/null 2>&1) then | |
curl -H "Authorization: token <YOUR-GITHUB-TOKEN-HERE>" \ | |
--request POST \ | |
--data \ | |
'{ | |
"state": "failure", | |
"context": "ESLint", | |
"description": "Lint errors present", | |
"target_url": "${bamboo.buildResultsUrl}" |
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
## Check for Karma errors | |
if [ -e "test-reports/karma.mocha.json" ]; then | |
if (grep -c '\"failures\": 0,' "./test-reports/karma.mocha.json" 1> /dev/null 2>&1); then | |
curl -H "Authorization: token <YOUR-GITHUB-TOKEN-HERE>" \ | |
--request POST \ | |
--data \ | |
'{ | |
"state": "success", | |
"context": "Karma - Unit tests", | |
"description": "The unit tests were successful", |
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
## Pending ESLint tests | |
curl -H "Authorization: token <YOUR-GITHUB-TOKEN-HERE>" \ | |
--request POST \ | |
--data \ | |
'{ | |
"state": "pending", | |
"context": "Eslint", | |
"description": "Preparing to lint code", | |
"target_url": "${bamboo.buildResultsUrl}" | |
}' \ |
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
cd ${bamboo.build.working.directory} | |
if [ -d "test-reports" ] 1> /dev/null 2>&1; then | |
curl -X POST --data-urlencode \ | |
'payload={ | |
"channel": "#SLACK-CHANNEL", | |
"username": "Bamboo Bot", | |
"text": "Built succesfully", | |
"icon_emoji": ":octocat:", | |
"attachments": [ | |
{ |
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
cd ${bamboo.build.working.directory} | |
if [ -d "test-reports" ] | |
then | |
echo "Test Directory exists - Deleting" | |
rm -r test-reports | |
echo "Done" | |
fi |
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
alias gbpurge='git branch --merged | grep -Ev "(\*|master|develop)" | xargs -n 1 git branch -d' |
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
const express = require('express'); | |
const app = express(); | |
const cheerio = require('cheerio'); | |
const request = require('request'); | |
app.get('/', (req, res, next) => { | |
const url = 'URL HERE'; | |
request(url, (err, resp, body) => { | |
const $ = cheerio.load(body); | |
$('.CLASS_HERE').each(function() { |