Skip to content

Instantly share code, notes, and snippets.

View developer-guy's full-sized avatar
🐾
Every artifact can be verifiably traced to Source Code and Hardware

Batuhan Apaydın developer-guy

🐾
Every artifact can be verifiably traced to Source Code and Hardware
View GitHub Profile
@developer-guy
developer-guy / public.sig
Created September 6, 2021 18:27
public signature
MEUCIF+ZQyvHD2TNhw1TmuZ3V+wEoHQbsCF6PYrRukTovhStAiEA1UEbCS3F3Xfgidxo95sYbpsP18VTEELd8NAFJ1OTtik=
@developer-guy
developer-guy / Makefile
Created August 31, 2021 19:54
makefile kink goreleaser
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
# Set version variables for LDFLAGS
GIT_TAG ?= dirty-tag
GIT_VERSION ?= $(shell git describe --tags --always --dirty)
stages:
- release
goreleaser:
stage: release
image: docker:19.03.5
variables:
DOCKER_API_VERSION: "1.35"
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
@developer-guy
developer-guy / .goreleaser.yml
Created August 31, 2021 18:44
whole goreleaser
project_name: kink
env:
- GO111MODULE=on
- CGO_ENABLED=0
before:
hooks:
- go mod tidy
- go mod download
# .goreleaser.yml
gitlab_urls:
api: https://gitlab.private.com/api/v4/
download: https://gitlab.private.com
skip_tls_verify: false
release:
gitlab:
owner: ""
name: 8141 # the ID of the project: https://goreleaser.com/customization/release/#gitlab
disable: false
@developer-guy
developer-guy / Dockerfile
Created August 31, 2021 18:24
kink Dockerfile for GoReleaser
FROM distroless:static-nonroot-amd64
ADD kink-linux-amd64 /usr/local/bin/kink
USER nonroot
ENTRYPOINT ["kink"]
@developer-guy
developer-guy / .goreleaser.yml
Created August 31, 2021 18:18
dockers section for GoReleaser
dockers:
- image_templates: [ "ghcr.io/developer-guy/kink:{{ .Tag }}" ]
dockerfile: Dockerfile.goreleaser
goos: linux
goarch: amd64
build_flag_templates:
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://gitlab.com/goreleaser/example
- --label=org.opencontainers.image.source=https://gitlab.com/goreleaser/example
@developer-guy
developer-guy / .goreleaser.yml
Created August 31, 2021 13:18
A sample .goreleaser.yaml with 3 builds
builds:
- id: linux-amd64
binary: kink-linux-{{ .Arch }}
main: ./main.go
goos:
- linux
goarch:
- amd64
ldflags:
- "{{ .Env.LDFLAGS }}"
#!/usr/bin/env bash
# Copyright (c) 2019 StackRox Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#!/bin/bash
set -e
usage() {
cat <<EOF
Generate certificate suitable for use with an sidecar-injector webhook service.
This script uses k8s' CertificateSigningRequest API to a generate a
certificate signed by k8s CA suitable for use with sidecar-injector webhook