Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Carlos Alexandro Becker caarlos0

🏠
Working from home
View GitHub Profile
@caarlos0
caarlos0 / .goreleaser.yaml
Created Mar 26, 2022
reproducible builds with goreleaser
View .goreleaser.yaml
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
mod_timestamp: '{{ .CommitTimestamp }}'
View .goreleaser.yml
name: goreleaser
on:
push:
tags:
- '*'
permissions:
contents: write
View goreleaser.schema.json
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/Project",
"definitions": {
"Announce": {
"properties": {
"twitter": {
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/Twitter"
}
@caarlos0
caarlos0 / list-git-branches.groovy
Last active May 28, 2021 — forked from ThabetAmer/list-git-branches.groovy
Jenkins Groovy script to read Git repo branches and list them in an array, can be suited with Active Choice Jenkins Plugin
View list-git-branches.groovy
#!/usr/bin/env groovy
/**
* List all Git branches of a repo.
* @author thabet.amer@gmail.com
* @since Jenkins 2.204.1
* @params String url for Git repo URL, String credentialID, Bool activeChoice if ActiveChoice plugin used, String defaultBranch
* @return String array of branch names
*
* Dependencies:
View gorelease-cla.md

GoReleaser Contributor License Agreement

I give GoReleaser permission to license my contributions on any terms they like. I am giving them this license in order to make it possible for them to accept my contributions into their project.

As far as the law allows, my contributions come as is, without any warranty or condition, and I will not be liable to anyone for any damages related to this software or this license, under any kind of legal claim.

View copy-size-labels-k8s.sh
#!/bin/sh
for size in XL XXL XS S M L; do
curl -sf -H "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/kubernetes/kubernetes/labels/size/$size" |
jq '. | { "name": .name, "color": .color, "description": .description }' |
curl -sfXPOST -d @- -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/$REPO/labels
done
@caarlos0
caarlos0 / five.md
Created Nov 26, 2019 — forked from mfridman/five.md
top 5 most common .goreleaser files
View five.md

10666361bf2ddb7070c9ea6756b1e8ce327a9edb

8 found

builds:
  # List of builds
  - # First Build
    env:
    - CGO_ENABLED=0
@caarlos0
caarlos0 / top-50.md
Created Nov 26, 2019 — forked from mfridman/top-50.md
top 50 project (by stars) using goreleaser
View top-50.md
View relabelings.yaml
prometheus-operator:
kubelet:
serviceMonitor:
metricRelabelings:
- sourceLabels: ["__name__"]
regex: 'storage_operation.*'
action: drop
cAdvisorMetricRelabelings:
- sourceLabels: ["__name__"]
regex: '(container_network_tcp.*|container_network_udp.*|container_fs_.*|container_tasks_state.*|container_memory_failures_total|.*swap.*)'
View kubeval.sh
#!/bin/sh
set -ex
TAR_FILE="/tmp/kubeval.tar.gz"
RELEASES_URL="https://github.com/garethr/kubeval/releases"
test -z "$TMPDIR" && TMPDIR="$(mktemp -d)"
last_version() {
curl -sL -o /dev/null -w %{url_effective} "$RELEASES_URL/latest" |
rev |