Skip to content

Instantly share code, notes, and snippets.

View jmcshane's full-sized avatar

James McShane jmcshane

View GitHub Profile
{"reqSignature":{},"txn":{"data":{"data":{"alias":"node-1","blskey":"2ftVGBT1x5GQQPEycduUQ5YRewRFGEHQS2tebLKbrmCj7rYb1aTJ3B7cAfgupo9y2fZnvkVFVL8H8sYJZwdSqPbSoWqz6Jx5bKEjmMbki1VJJSycAZh2kweoaQtnidoY2FRfsAeiWuSPGuWMqhoh1xdQTL9Dwi3VyKiUAQwWKdwDktD","blskey_pop":"RGCWEdstJ9Fh7Pzgx2e8kbqjRyapmEWJCK4cg5HBnPYCWQUkJGALzbnuBdVxbVu4JVjys2DjNZ9PoZa8xHD5gneJBvtiBLtbYdBuw5yeHFV7FYPBqMHk7XShsoZowmvhYNiXXTtoULgPXSApVvVwy258cjqrF8WiQdFabiSRnyMkjq","client_ip":"**","client_port":"9702","node_ip":"**","node_port":"9701","services":["VALIDATOR"]},"dest":"BVALuETRsDYWtvZMPLfYhuefrGW8zs2GPEtsMy94YwVw"},"metadata":{"from":"MEjXLjwfcbH9c8PKrzbBq8"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"35971be6e9bb024a895582fe0e42e04848a86da550aaef0fccbfba86f99f617d"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"node-2","blskey":"2VaeeRuGXNa1H3oJnRf6K3dCayHeCrwHUGkwemWHCuvywtK1PckomrAYHLoLodLB4uAi9Xa3SGhp2WdTCjEmjTmCxyNscDsgBLwspZtwNL2MXeXg5qHxWcJ4BA9LTG5zdM3enrqwTdttwGK1PSgxbrDd4f1KanV3bMTqQda5KHjBvVM","blskey_pop":"R5io1f
package main
import "fmt"
func main() {
target := make(chan error)
count := background(target)
for i := 0; i < count; i++ {
err := <-target
if err != nil {
here=$(pwd)
cd $GOPATH/src/github.com/tektoncd/triggers
ko apply -f config/controller.yaml
cd $here
kubectl apply -f trigger.yaml
sleep 10
kubectl run curl --image=curlimages/curl -- /bin/sh -c "sleep 10000"
sleep 10
echo "This will generate a pipelinerun from triggertemplate named: pipeline-trigger"
kubectl exec -it curl -- curl http://el-eventlistener:8080 -H "X-Github-Event: pull_request" --data '{"type":"pipeline"}'
here=$(pwd)
cd $GOPATH/src/github.com/tektoncd/triggers
ko apply -f config/controller.yaml
ko apply -f config/webhook.yaml
cd $here
kubectl apply -f trigger.yaml
sleep 10
kubectl run curl --image=curlimages/curl -- /bin/sh -c "sleep 10000"
echo "This event will not generate a triggered pipelinerun"
kubectl exec -it curl -- curl http://el-eventlistener:8080 -H "X-Internal: match" -H "X-GitHub-Event: pull_request" --data '{"pull_request":{"head":{}}}' -vv
println("Hello from Kotlin!")
for (arg in args) {
println("arg: $arg")
}
@jmcshane
jmcshane / Reactive_Example.postman_collection.json
Created April 10, 2017 02:37
Reactive Postman Collection
{
"variables": [],
"info": {
"name": "ReactiveExample",
"_postman_id": "674b4612-e8d4-9279-5561-546341c192eb",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
@jmcshane
jmcshane / SecurityConfig.java
Created September 22, 2016 02:20
Security config for manifest details endpoint
@Configuration
@EnableWebSecurity
@Order(SecurityProperties.ACCESS_OVERRIDE_ORDER)
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.antMatcher("/**").authorizeRequests().antMatchers("/getManifestDetails").permitAll();
}
}
@jmcshane
jmcshane / ManifestEndpoint.java
Created September 22, 2016 02:15
Endpoint to expose the manifest details of a jar or war file
@Controller
public class ManifestDetailsController {
private static final Logger logger = LoggerFactory.getLogger(ManifestDetailsController.class);
@RequestMapping(value="/getManifestDetails" ,method = RequestMethod.GET)
@ResponseBody
public Map<String,Object> getManifestDetails() {
Enumeration<URL> resource;
Map<String,Object> result = new HashMap<String,Object> ();
@jmcshane
jmcshane / new-project-structure.txt
Created April 25, 2015 04:46
New project structure
src/main/java
src/main/resources
src/main/javascript
src/main/css
src/main/html
src/test/java
src/test/javascript
src/test/resources
src/main/webapp
WEB-INF/
@jmcshane
jmcshane / project-structure.txt
Created April 25, 2015 04:29
Web Application Project Structure
src/main/java
src/main/resources
src/test/java
src/test/resources
src/main/webapp
js/
css/
WEB-INF/
META-INF/