Skip to content

Instantly share code, notes, and snippets.

View otaviof's full-sized avatar

Otávio Fernandes otaviof

View GitHub Profile
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
spec:
params: {}
workspaces: {}
tasks:
- name: git
taskRef:
name: openshift-pipelines/task-git@0.0.1
@otaviof
otaviof / vscode-remote.zsh
Last active June 30, 2023 05:58
Using `code` over SSH (VSCode Remote)
#!/usr/bin/env zsh
# directory where the vscode sock files are traditionally stored
typeset -rx VS_SOCK_DIR="/run/user/$(id -u)"
# glob (pattern) to find the socket files
typeset -rx VS_SOCK_GLOB="${VS_SOCK_DIR}/vscode-ipc-*.sock"
# List the latest file on the informed location, sorting by time (newest).
function ls_latest () {
/bin/ls -t -1 ${~*} |head -n 1
#!/usr/bin/env bash
set -u
function extract_names() {
cat ${1} |
yq --output-format=json |
jq -r '.spec.params[] | .name' 2>/dev/null
}
@otaviof
otaviof / .zlogin
Created March 16, 2022 06:56
SSH-Agent on ZSH
# if no authentication agent or PID is present, fetching the last known info
if [[ ( -z "${SSH_AUTH_SOCK}" || -z "${SSH_AGENT_PID}" ) && -f "${SSH_ENV}" ]] ; then
source "${SSH_ENV}"
fi
# trapping HUP signals to reload ssh-agent via SSH_ENV file (`notify_shells`)
trap "source ${SSH_ENV}" SIGHUP

Halloween Hack-Day 2021

OpenShift Pipelines SCC

oc adm policy add-scc-to-user privileged --serviceaccount=pipeline
oc adm policy add-role-to-user edit --serviceaccount=pipeline

Installing Shipwright

---
apiVersion: shipwright.io/v1alpha1
kind: BuildRun
metadata:
name: nodejs-ex
spec:
buildRef:
name: nodejs-ex
#!/usr/bin/env bash
#
# Installs libgit2 from source-code, after downloading and preparing the system to compile it.
#
set -eu
LIBGIT_HOST="github.com"
LIBGIT_PATH="libgit2/libgit2/archive/refs/tags"
$ go run -v -mod=vendor ./cmd/openshift-tests/... run-test -- "[sig-builds][Feature:Builds][Slow] can use private repositories as build input Build using a username and password should create a new build using the internal gitserver"
I1214 08:58:09.687984 82897 test_context.go:429] Tolerating taints "node-role.kubernetes.io/master" when considering if nodes are ready
Dec 14 08:58:09.721: INFO: Waiting up to 30m0s for all (but 100) nodes to be schedulable
Dec 14 08:58:09.725: INFO: Waiting up to 10m0s for all pods (need at least 0) in namespace 'kube-system' to be running and ready
Dec 14 08:58:09.746: INFO: 0 / 0 pods in namespace 'kube-system' are running and ready (0 seconds elapsed)
Dec 14 08:58:09.746: INFO: expected 0 pod replicas in namespace 'kube-system', 0 are Running and Ready.
Dec 14 08:58:09.746: INFO: Waiting up to 5m0s for all daemonsets in namespace 'kube-system' to start
Dec 14 08:58:09.752: INFO: e2e test version: v0.0.0-master+$Format:%h$
Dec 14 08:58:09.755: INFO: kube-apiserver version
---
apiVersion: build.dev/v1alpha1
kind: BuildRun
metadata:
name: shorty
spec:
buildRef:
name: shorty
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: buildah-shared-ex
spec:
replicas: 1
selector:
matchLabels:
app: buildah-shared-ex