- in Jenkins set up a multibranch pipeline with Branch source of type
Github
(under it, set up endpoint, credentials, repo name, etc.); - in Github go to the repository Settings and add the user chosen on the previous step to the repository's colaborators;
- go to the Hooks menu and add a webhook pointing to
<your-jenkins-host>/github-webhook/
and select pull request event under Let me select individual events option; - create a pull request - after that Jenkins should automatically start a build;
- go to Branches menu under Settings and add the target branch to Protected branches;
- choose Require status checks to pass before merging and
continuous-integration/jenkins/pr-merge
under it - commit a change into the pull request and see the Jenkins build result on the page.
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 python | |
CONNECT_ENDPOINT = 'http://10.0.0.24:8083' | |
import httplib | |
import json | |
import os | |
import sys | |
action = 'pause' if os.path.basename(sys.argv[0]).startswith('pause') else 'resume' |
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 --cacert /path/to/ca-root.crt \ | |
--cert /path/to/client.crt \ | |
--key /path/to/client.key \ | |
https://service.with.client.auth |
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 java.io.*; | |
import java.net.*; | |
/** | |
* Open URL passed as the first command-line argument and read the first line from it | |
* | |
* Example usage for testing client auth: | |
* java -Djavax.net.ssl.trustStore=/path/to/truststore.jks \ | |
* -Djavax.net.ssl.trustStorePassword=myword \ | |
* -Djavax.net.ssl.keyStore=/path/to/keystore.jks \ |
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 | |
echo '["my-connector-name",{"protocol":"1","table":"my_db_name.my_table_name"}]@{"incrementing":5}' | kafka-console-producer --topic _connect-offsets --broker-list 127.0.0.1:9092 --property parse.key=true --property key.separator=@ | |
# And after issuing this command, restart the connector's task (pausing/resuming the connector isn't enoght) |
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
data = load '$file' using TextLoader(); | |
tokens = foreach data generate FLATTEN(TOKENIZE($0)); | |
words = filter tokens by $0 MATCHES '[A-Za-z]+'; | |
lowers = foreach words generate LOWER($0); | |
groups = group lowers by $0; | |
counts = foreach groups generate group, COUNT(lowers.$0); | |
by_count = order counts by $1 DESC; | |
store by_count into '$file-by-count'; | |
by_word = order counts by $0 ASC; | |
store by_word into '$file-by-word'; |
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
def wrest_dict(orig): | |
pairs = [(g, n) for n in orig.keys() for g in orig[n]] | |
nodes4group = lamdba g: sorted(n[1] for n in pairs if n[0] == g) | |
return {g[0]: nodes4group(g[0]) for g in pairs} |
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
package main | |
import "container/list" | |
type MyList struct { | |
*list.List | |
} | |
func (l *MyList) Reduce(f func(interface{}, interface{}) interface{}) interface{} { | |
s := l.Front() |
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
package main | |
import "container/list" | |
type MyList struct { | |
*list.List | |
} | |
func (l *MyList) Map(f func(interface{}) interface{}) *MyList { | |
nl := &MyList {list.New()} |
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
package main | |
import "container/list" | |
type MyList struct { | |
*list.List | |
} | |
func (l *MyList) Filter(f func(interface{}) bool) *MyList { | |
nl := &MyList{list.New()} |