Skip to content

Instantly share code, notes, and snippets.

View jayco's full-sized avatar
🏠
Working from home

Jason Jacob jayco

🏠
Working from home
View GitHub Profile
@jayco
jayco / gist:8e7e8dd6065495579d479d34a274c973
Created May 25, 2020 03:07
Pull the process signal information for a job
query {
job(uuid: <JOB-UUID>) {
...on JobTypeCommand {
events(first:100) {
edges {
node {
...on JobEventFinished {
exitStatus
signal
signalReason
@jayco
jayco / main.go
Last active July 14, 2020 21:01
Listen for job finished events and fail fast on builds
package main
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
@jayco
jayco / pipeline.yml
Created June 25, 2020 02:22
Concurrency gate example
steps:
- command: echo "running unit tests"
key: unit-tests
- wait
######################
# START OF GATE 1 #
######################
- command: "exit 0" # start the gate region by using a no-op
@jayco
jayco / pipeline.yml
Created June 25, 2020 07:46
Concurrency Gate
steps:
- command: echo "running unit tests"
key: unit-tests
######################
# START OF GATE 1 #
######################
- command: "exit 0" # start the gate region by using a no-op
concurrency_group: gate
concurrency: 1
@jayco
jayco / main.go
Last active June 30, 2020 12:07
package main
import (
"bytes"
"context"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
@jayco
jayco / pipeline.yml
Created July 9, 2020 00:30
Code Freeze on pipeline
env:
CODE_FREEZE: true
steps:
- command: "buildkite-agent annotate 'code freeze in place' --style 'error'"
if: "build.env('CODE_FREEZE') == 'true'"
- command: "buildkite-agent pipeline upload"
label: ":pipeline:"
if: "build.env('CODE_FREEZE') == 'false'"
steps:
- label: "pre-gate step"
command: echo "pre-gate step"
- wait
- label: "Concurrency gate"
command: exit 0
concurrency_group: gate
concurrency: 1
@jayco
jayco / pipeline.yml
Created November 10, 2020 07:10
Multi environment/region test, build and deploy
env:
DOCKER_IMAGE_TAG: "myservice-${BUILDKITE_BRANCH}-${BUILDKITE_COMMIT:0:7}"
steps:
- name: 'test :hammer:'
agents:
queue: aws-buildkite-agent
command: echo ".buildkite/test.sh"
- wait:
@jayco
jayco / main.go
Created November 27, 2020 01:21
echo
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/http/httputil"
@jayco
jayco / main.go
Last active December 9, 2020 05:51
EventBridge
package main
import (
"bytes"
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"os"