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 / build-duration.js
Created October 5, 2022 10:26
Simple GraphQL query to get total build duration from Buildkite API
var graphql = require('graphql.js');
var moment = require('moment');
moment().format();
var graph = graphql("https://graphql.buildkite.com/v1", {
method: "POST",
headers: { "Authorization": "Bearer <api-token>"},
asJSON: true,
debug: true,
});
@jayco
jayco / test.go
Last active July 28, 2021 00:01
test-buildkite-go
package main
import (
"encoding/json"
"fmt"
"log"
"os"
"github.com/buildkite/go-buildkite/v2/buildkite"
mutation scheduleBuild {
pipelineScheduleCreate(
input: {
pipelineID: "UGlwZWxpbmUtLS1teS1waXBlbGluZS11dWlkLWFzLWZvdW5kLWluLXlvdXItcGlwZWxpbmUtc2V0dGluZ3M="
cronline: "0 */4 * * *"
message: "My schedule"
label: "new schedule"
}
) {
clientMutationId
@jayco
jayco / main.go
Last active December 9, 2020 05:51
EventBridge
package main
import (
"bytes"
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"os"
@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 / 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:
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 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'"
@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 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